diff --git a/CHANGELOG.md b/CHANGELOG.md index 202858c..937268f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,10 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [2.9.1] - 2024-11-27 ### Fixed +- `TensorSerializer` no longer sometimes fails to serialize very large + 1-dimensional tensors with multibyte `dtype`s - `RedisStreamFile.readable()` and `RedisStreamFile.seekable()` now correctly return `True` @@ -407,7 +409,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `get_gpu_name` - `no_init_or_tensor` -[Unreleased]: https://github.com/coreweave/tensorizer/compare/v2.9.0...HEAD +[2.9.1]: https://github.com/coreweave/tensorizer/compare/v2.9.0...v2.9.1 [2.9.0]: https://github.com/coreweave/tensorizer/compare/v2.8.1...v2.9.0 [2.8.1]: https://github.com/coreweave/tensorizer/compare/v2.8.0...v2.8.1 [2.8.0]: https://github.com/coreweave/tensorizer/compare/v2.7.2...v2.8.0 diff --git a/tensorizer/_version.py b/tensorizer/_version.py index 43ce13d..334087f 100644 --- a/tensorizer/_version.py +++ b/tensorizer/_version.py @@ -1 +1 @@ -__version__ = "2.9.0" +__version__ = "2.9.1" diff --git a/tensorizer/serialization.py b/tensorizer/serialization.py index 7b3b182..3b14e7e 100644 --- a/tensorizer/serialization.py +++ b/tensorizer/serialization.py @@ -3510,7 +3510,7 @@ def _mv_suffix(data: "collections.abc.Buffer", start: int): if not isinstance(data, memoryview): data = memoryview(data) try: - if data.ndim != 1: + if data.ndim != 1 or data.format != "B": data = data.cast("B") return data[start:] finally: @@ -3526,13 +3526,15 @@ def _pwrite_syscall( verify if isinstance(verify, int) else self._buffer_size(data) ) bytes_just_written: int = os.pwrite(self._fd, data, offset) - bytes_written += bytes_just_written + if bytes_just_written > 0: + bytes_written += bytes_just_written while bytes_written < expected_bytes_written and bytes_just_written > 0: # Writes larger than ~2 GiB may not complete in a single pwrite call offset += bytes_just_written with self._mv_suffix(data, bytes_written) as mv: bytes_just_written = os.pwrite(self._fd, mv, offset) - bytes_written += bytes_just_written + if bytes_just_written > 0: + bytes_written += bytes_just_written if isinstance(verify, int) or verify: self._verify_bytes_written(bytes_written, expected_bytes_written) return bytes_written