Releases: huggingface/safetensors
v0.7.0
What's new
complex64 support
This release adds support for storing complex64 tensors.
What's Changed
- Revert "Early bailing when keys mismatch (faster). (#602)" by @Narsil in #647
- Support using paddle in safe_open by @zeroRains in #630
- Fix clippy lint. by @Narsil in #648
- Support paddle save/load/save_file/load_file without coverting to numpy by @changeyoung98 in #646
- Fix no-std feature configuration to auto-fallback from std to alloc by @antimora in #651
- Fix big endian (S390X) test by @danieldk in #654
- Fixing get_slice. by @Narsil in #655
- Update hashbrown dependency to 0.16 by @danieldk in #658
- Fix documentation build by @danieldk in #667
- Add
packagingas a dependency for thetorchextra by @danieldk in #666 - Support the complex64 data type by @danieldk in #660
- feat: add header size check at serialization by @McPatate in #669
- Set version to 0.7.0-dev.0 by @danieldk in #670
- Fix release CI issues by @danieldk in #673
New Contributors
- @zeroRains made their first contribution in #630
- @changeyoung98 made their first contribution in #646
- @antimora made their first contribution in #651
- @danieldk made their first contribution in #654
Full Changelog: v0.6.2...v0.7.0
v0.6.2
v0.6.1
What's Changed
- Rust release upgrade (cache v1 is discontinued). by @Narsil in #627
- Re-adding support for u16, u32, u64. by @Narsil in #629
- Adding _safe_open_handle. by @Narsil in #608
- Fix test_simple.py for 0.6.0 by @xanderlent in #634
- GH action... once again. by @Narsil in #635
- Preparing for patch 6.0.1. by @Narsil in #638
New Contributors
- @xanderlent made their first contribution in #634
Full Changelog: v0.6.0...v0.6.1
v0.6.1-rc0
What's Changed
- Rust release upgrade (cache v1 is discontinued). by @Narsil in #627
- Re-adding support for u16, u32, u64. by @Narsil in #629
- Adding _safe_open_handle. by @Narsil in #608
- Fix test_simple.py for 0.6.0 by @xanderlent in #634
- GH action... once again. by @Narsil in #635
- Preparing for patch 6.0.1. by @Narsil in #638
New Contributors
- @xanderlent made their first contribution in #634
Full Changelog: v0.6.0...v0.6.1-rc0
v0.6.0
Biggest changes
-
Added support for FP4/FP6 https://www.opencompute.org/documents/ocp-microscaling-formats-mx-v1-0-spec-final-pdf
Support is still nascent in most frameworks (will require torch 2.8 which isn't released yet, and that will only support fp4 with caveats), however being an openspec supported by hardware manufacturers (and therefore hardware support most likely), it fits the bill of implementing it in safetensors (rather than all custom quantized formats existing in the wild in various frameworks.What FP4/FP6 mean, is that now a element of a tensor may have a non byte-aligned size/access. If you store a single fp4, then there is 4 bit on that byte that is outside of the spec. For now, safetensors library will simply raise MisalignedByte exception whenever an operation leads to unused/unaligned bits within a byte. Since most tensors are larger power of 2s, this shouldn't come up too often in practice. Raising an exception now means we have freedom later to actually implement a behavior which could align with tensor libraries.
In that regard
Dtype.size()is now deprecated, as it returns the size of the dtype in bytes, and we now favorbitsize()and it's up to users for now to handle something likelen * bitsize() / 8(and verifying the division is acceptable)On that note, and for Pytorch users specifically, torch doesn't actually implement fp4, it has a dtype called
float4_e2m1fn_x2which actually represents 2 fp4. This is why torch shouldn't have any alignement problems for now (but cannot implement fp6). But that also means that the shape of a [2, 2] tensor for floa4, contains actually 8 values.safetensorswill actuallly silently cast a tensor of shape,[x, y, ...z]into[x, y, ..., z/2], using the last dimension to "swallow" , thex2contained within the types. Again, there is no definite behavior just yet, so this might be subject to change.
What's Changed
- Add safestructures to Featured Projects by @rachthree in #570
- Fixing benchmarks. by @Narsil in #580
- load_file: load tensors ordered by their offsets by @yousong in #571
- Updating python bench ? by @Narsil in #587
- fix(benchmark.rs): "serialize" and "deserialize" typo by @Marco-Christiani in #585
- Add onnx-safetensors to the projects list in documentation by @justinchuby in #581
- Pass device to torch.asarray in get_tensor by @mickvangelderen in #588
- Making py311 the default. by @Narsil in #589
- Fix test by @Narsil in #590
- Fix test by @Narsil in #591
- [WIP] Enabling free-threaded python (without warning). + pyo3 0.24 by @Narsil in #592
- Fix the bench action ? by @Narsil in #603
- fix typo in serialize_file doc-string by @LVivona in #594
- Remove useless code by @cyc4188 in #597
- Early bailing when keys mismatch (faster). by @Narsil in #602
- Fixing the ml_dtypes potentially missing. by @Narsil in #605
- Adding the License to wheels. by @Narsil in #606
- Adding a public API for metadata. by @Narsil in #618
- Update dependencies by @H2CO3 in #614
- Better error handling through improved
DisplayandErrorimpls by @H2CO3 in #616 - Do not force
&Option<T>in public API; useOption<&T>instead by @H2CO3 in #617 - Adding support for MXFP4,6. by @Narsil in #611
- Bumping version because of breaking changes. by @Narsil in #619
- Adding data_len as public API for metadata (to fetch the size of the by @Narsil in #620
- Simplify code and make it more robust by @H2CO3 in #615
- Rename. by @Narsil in #621
- Fixup into pyobject. by @Narsil in #622
- Adding a failing test on the device cast. by @Narsil in #623
New Contributors
- @rachthree made their first contribution in #570
- @yousong made their first contribution in #571
- @Marco-Christiani made their first contribution in #585
- @justinchuby made their first contribution in #581
- @mickvangelderen made their first contribution in #588
- @LVivona made their first contribution in #594
- @cyc4188 made their first contribution in #597
- @H2CO3 made their first contribution in #614
Full Changelog: v0.5.3...v0.6.0
v0.6.0-rc1
What's Changed
- Add safestructures to Featured Projects by @rachthree in #570
- Fixing benchmarks. by @Narsil in #580
- load_file: load tensors ordered by their offsets by @yousong in #571
- Updating python bench ? by @Narsil in #587
- fix(benchmark.rs): "serialize" and "deserialize" typo by @Marco-Christiani in #585
- Add onnx-safetensors to the projects list in documentation by @justinchuby in #581
- Pass device to torch.asarray in get_tensor by @mickvangelderen in #588
- Making py311 the default. by @Narsil in #589
- Fix test by @Narsil in #590
- Fix test by @Narsil in #591
- [WIP] Enabling free-threaded python (without warning). + pyo3 0.24 by @Narsil in #592
- Fix the bench action ? by @Narsil in #603
- fix typo in serialize_file doc-string by @LVivona in #594
- Remove useless code by @cyc4188 in #597
- Early bailing when keys mismatch (faster). by @Narsil in #602
- Fixing the ml_dtypes potentially missing. by @Narsil in #605
- Adding the License to wheels. by @Narsil in #606
- Adding a public API for metadata. by @Narsil in #618
- Update dependencies by @H2CO3 in #614
- Better error handling through improved
DisplayandErrorimpls by @H2CO3 in #616 - Do not force
&Option<T>in public API; useOption<&T>instead by @H2CO3 in #617 - Adding support for MXFP4,6. by @Narsil in #611
- Bumping version because of breaking changes. by @Narsil in #619
- Adding data_len as public API for metadata (to fetch the size of the by @Narsil in #620
- Simplify code and make it more robust by @H2CO3 in #615
- Rename. by @Narsil in #621
- Fixup into pyobject. by @Narsil in #622
New Contributors
- @rachthree made their first contribution in #570
- @yousong made their first contribution in #571
- @Marco-Christiani made their first contribution in #585
- @justinchuby made their first contribution in #581
- @mickvangelderen made their first contribution in #588
- @LVivona made their first contribution in #594
- @cyc4188 made their first contribution in #597
- @H2CO3 made their first contribution in #614
Full Changelog: v0.5.3...v0.6.0-rc1
v0.6.0-rc0
What's Changed
- Add safestructures to Featured Projects by @rachthree in #570
- Fixing benchmarks. by @Narsil in #580
- load_file: load tensors ordered by their offsets by @yousong in #571
- Updating python bench ? by @Narsil in #587
- fix(benchmark.rs): "serialize" and "deserialize" typo by @Marco-Christiani in #585
- Add onnx-safetensors to the projects list in documentation by @justinchuby in #581
- Pass device to torch.asarray in get_tensor by @mickvangelderen in #588
- Making py311 the default. by @Narsil in #589
- Fix test by @Narsil in #590
- Fix test by @Narsil in #591
- [WIP] Enabling free-threaded python (without warning). + pyo3 0.24 by @Narsil in #592
- Fix the bench action ? by @Narsil in #603
- fix typo in serialize_file doc-string by @LVivona in #594
- Remove useless code by @cyc4188 in #597
- Early bailing when keys mismatch (faster). by @Narsil in #602
- Fixing the ml_dtypes potentially missing. by @Narsil in #605
- Adding the License to wheels. by @Narsil in #606
- Adding a public API for metadata. by @Narsil in #618
- Update dependencies by @H2CO3 in #614
- Better error handling through improved
DisplayandErrorimpls by @H2CO3 in #616 - Do not force
&Option<T>in public API; useOption<&T>instead by @H2CO3 in #617 - Adding support for MXFP4,6. by @Narsil in #611
- Bumping version because of breaking changes. by @Narsil in #619
- Adding data_len as public API for metadata (to fetch the size of the by @Narsil in #620
- Simplify code and make it more robust by @H2CO3 in #615
- Rename. by @Narsil in #621
New Contributors
- @rachthree made their first contribution in #570
- @yousong made their first contribution in #571
- @Marco-Christiani made their first contribution in #585
- @justinchuby made their first contribution in #581
- @mickvangelderen made their first contribution in #588
- @LVivona made their first contribution in #594
- @cyc4188 made their first contribution in #597
- @H2CO3 made their first contribution in #614
Full Changelog: v0.5.3...v0.6.0-rc0
v0.5.3
What's Changed
- Updating the dev number. by @Narsil in #558
- Add support for Intel Gaudi hpu accelerators by @asafkar in #566
- Restore compatibility with Rust 1.74 by @tiran in #563
- Return error on out of range index by @oliness in #565
- Remove rogue .DS_Store by @spikedoanz in #573
- support hpu:0 by @IlyasMoutawwakil in #578
New Contributors
- @asafkar made their first contribution in #566
- @tiran made their first contribution in #563
- @oliness made their first contribution in #565
- @spikedoanz made their first contribution in #573
- @IlyasMoutawwakil made their first contribution in #578
Full Changelog: v0.5.2...v0.5.3
v0.5.2
What's Changed
- support no_std by @ivila in #556
- Fix wrong signature of
safe_open.__init__in stub file by @SunghwanShim in #557
New Contributors
- @ivila made their first contribution in #556
- @SunghwanShim made their first contribution in #557
Full Changelog: v0.5.1...v0.5.2