Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tensorizer/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.9.0"
__version__ = "2.9.1"
8 changes: 5 additions & 3 deletions tensorizer/serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
Loading