Releases: huggingface/safetensors
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_x2
which 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.safetensors
will actuallly silently cast a tensor of shape,[x, y, ...z]
into[x, y, ..., z/2]
, using the last dimension to "swallow" , thex2
contained 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
Display
andError
impls 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
Display
andError
impls 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
Display
andError
impls 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
v0.5.1
v0.5.0
Major changes.
- Using abi3, python 3.8
What's Changed
- Update init.pyi by @w1gs in #533
- Trying some new CI. by @Narsil in #539
- Attempt to fix bench + update TF + maturin abi3 CI. by @Narsil in #540
- Add support for Cambricon mlu devices by @huismiling in #535
- Upgrading PyO3 to 0.23 by @IvanIsCoding in #543
- Upgrade version number. by @Narsil in #550
New Contributors
- @w1gs made their first contribution in #533
- @huismiling made their first contribution in #535
- @IvanIsCoding made their first contribution in #543
Full Changelog: v0.4.5...v0.5.0