Files
SRI VILLIAM SAI AandGitHub 86a6213583 perf(safetensors): zero-copy CPU serialization via TensorView (#34)
Avoid unnecessary intermediate heap copies and allocations when serializing
contiguous CPU tensors to safetensors.

- Expose as_bytes() on CpuStorage providing zero-copy access to underlying buffers.
- Introduce TensorView<'a> holding the read lock guard and borrowing raw bytes as Cow::Borrowed.
- Add Tensor::to_safetensors_view() and implement safetensors::View for TensorView.
- Handle packed sub-byte dtypes (F4, F6_E2M3, F6_E3M2) with aligned zero-copy slicing and unaligned repacking.
- Optimize Tensor::save_safetensors, safetensors::save, and add safetensors::serialize.
- Reject duplicate tensor names in save and serialize, and preserve View contract.
- Add comprehensive zero-copy test suite covering all dtypes, views, slices, and roundtrips.
- Bump hanzo-ml to 0.11.121.
2026-11-17 09:18:15 -08:00
..
2026-07-28 06:03:51 -07:00
2026-07-28 06:03:51 -07:00
2026-07-28 06:03:51 -07:00
2026-07-28 06:03:51 -07:00