]> khamidou — GitHub mirrors - safetensors.git/log
safetensors.git
3 years agoTemporary revert of the breaking change (keep it for 0.4.0). (#336)
Nicolas Patry [Wed, 23 Aug 2023 11:22:28 +0000 (13:22 +0200)]
Temporary revert of the breaking change (keep it for 0.4.0). (#336)

3 years agoPreparing small patch release (Big Endian fix). (#335)
Nicolas Patry [Wed, 23 Aug 2023 11:00:06 +0000 (13:00 +0200)]
Preparing small patch release (Big Endian fix). (#335)

3 years agoReworked the release script entirely (#334)
Nicolas Patry [Tue, 22 Aug 2023 09:25:11 +0000 (11:25 +0200)]
Reworked the release script entirely (#334)

* Rework the release script entirely.

* New release script.

* Ok.

3 years agoimpl `View` for `TensorView` (#329)
Corey Lowman [Mon, 21 Aug 2023 07:14:25 +0000 (03:14 -0400)]
impl `View` for `TensorView` (#329)

The existing impl only exists for `&TensorView`, which means you cannot pass a `Vec<(String, TensorView)>` into `serialize_to_file`. With this new impl, you can.

3 years agoAdd NumPy for all backends dependencies (#332)
Thomas Chaigneau [Mon, 21 Aug 2023 07:13:55 +0000 (09:13 +0200)]
Add NumPy for all backends dependencies (#332)

* Add NumPy for all backends dependencies

* numpy as extras

3 years agoFixing boolean + numpy > 1.20 (#326)
Nicolas Patry [Thu, 17 Aug 2023 06:58:26 +0000 (08:58 +0200)]
Fixing boolean + numpy > 1.20 (#326)

* Fixing boolean + numpy > 1.20

* Adding bool numpy test.

3 years agoFixing big endian. (#327)
Nicolas Patry [Thu, 17 Aug 2023 06:44:48 +0000 (08:44 +0200)]
Fixing big endian. (#327)

* Fixing big endian.

- Many more tests, with numpy coverage.
- Actually test values on disk.

* Re-enabling bf16 (we piggy back f16 byteswap).

* Fmt.

* Black.

3 years agoYaml is nice. (#325)
Nicolas Patry [Wed, 16 Aug 2023 18:16:20 +0000 (20:16 +0200)]
Yaml is nice. (#325)

3 years agoFix Bench GH action. (#323)
Nicolas Patry [Wed, 16 Aug 2023 16:06:37 +0000 (18:06 +0200)]
Fix Bench GH action. (#323)

3 years agoadd tensorshare to featured projects (#322)
Thomas Chaigneau [Wed, 16 Aug 2023 15:52:12 +0000 (17:52 +0200)]
add tensorshare to featured projects (#322)

3 years agoSupporting whisper conversion. (#320)
Nicolas Patry [Fri, 11 Aug 2023 21:29:45 +0000 (23:29 +0200)]
Supporting whisper conversion. (#320)

3 years agoCache dir all the time. (#319)
Nicolas Patry [Fri, 11 Aug 2023 14:12:47 +0000 (16:12 +0200)]
Cache dir all the time. (#319)

3 years agoFixing macos 13 release script (by prebuilding). (#315)
Nicolas Patry [Wed, 9 Aug 2023 07:15:33 +0000 (09:15 +0200)]
Fixing macos 13 release script (by prebuilding). (#315)

* Fixing macos 13 release script (by prebuilding).

* Yaml indent...

3 years agoAdding new target for m1 (#317)
Nicolas Patry [Wed, 9 Aug 2023 07:14:23 +0000 (09:14 +0200)]
Adding new target for m1 (#317)

* Adding new target for m1

* Indent fix.

3 years agoClarify specification around endianness and header padding (#306)
Aarni Koskela [Tue, 8 Aug 2023 10:04:20 +0000 (12:04 +0200)]
Clarify specification around endianness and header padding (#306)

* Clarify that `N` is little-endian

* Clarify the header JSON structure:

* note the data must begin with a `{` byte
* note the data may be padded at the end with whitespace

* Update README.md

Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
---------

Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
3 years agoBack on dev. (#313)
Nicolas Patry [Tue, 8 Aug 2023 10:04:14 +0000 (12:04 +0200)]
Back on dev. (#313)

3 years agoFixes release scripts - Release ready version (#312)
Nicolas Patry [Mon, 7 Aug 2023 21:36:24 +0000 (23:36 +0200)]
Fixes release scripts - Release ready version (#312)

* Creating 0.3.2.rc1 release

* Fixing release.

* Fix mv 2

* Ignore failing mv.

* ?

* Wtf ?

* ???

* What is happenin to my files...

* macos-latest.

* Fixing up release.

3 years agoCreating 0.3.2.rc1 release (#311)
Nicolas Patry [Mon, 7 Aug 2023 13:46:19 +0000 (15:46 +0200)]
Creating 0.3.2.rc1 release (#311)

3 years agofeat: Supporting big endian architecture. (#310)
Nicolas Patry [Mon, 7 Aug 2023 12:53:19 +0000 (14:53 +0200)]
feat: Supporting big endian architecture. (#310)

* Supporting big endian architecture.

`byteswap` before saving and `byteswap` on read.

* Specify platform ?

* Revert "Specify platform ?"

This reverts commit 8d82bbd15374d066eb2578a00f38c7dc91b83f74.

* GH

* With cache ?

* Switch driver for cache ?

* Push

* Using internal registry

* Fix build push.

* Add platform ?

* PlatformS

3 years agofeat: Add filter for shared storage non overlapping tensors (#309)
Nicolas Patry [Mon, 7 Aug 2023 07:08:02 +0000 (09:08 +0200)]
feat: Add filter for shared storage non overlapping tensors (#309)

* feat: Add filter for shared storage non overlapping tensors

Deepspeed does some tensor sharing but not actually overlapping
tensors. (It's not exactly clear why).

This PR fixes it by adding a global check for all shared tensors if the
actual offsets are overlapping or not.
It looks at all (start, stop) pointers of the tensors, sorts them by start pointer, and decides 2 tensors are disjoint if stop(previous) <= start(next)

* Style.

* Update for zero-sized tensors.

* Update test that now passes.

3 years agofix typo in `attacks/README.md` (#305)
Benson Liu [Tue, 1 Aug 2023 12:55:58 +0000 (05:55 -0700)]
fix typo in `attacks/README.md` (#305)

3 years agoAdding `slice` `get_dtype()` method to get the dtype directly on slices. (#303)
Nicolas Patry [Mon, 31 Jul 2023 14:41:25 +0000 (16:41 +0200)]
Adding `slice` `get_dtype()` method to get the dtype directly on slices. (#303)

3 years agoPassing the token around. (#302)
Nicolas Patry [Mon, 31 Jul 2023 14:00:59 +0000 (16:00 +0200)]
Passing the token around. (#302)

* Passing the token around.

* Update Python version (flax is broken on 3.7)

* Fixing flax ?

* Apply suggestions from code review

3 years agoSupport musicgen conversion. (#296)
Nicolas Patry [Tue, 11 Jul 2023 12:52:00 +0000 (14:52 +0200)]
Support musicgen conversion. (#296)

3 years agoFix link to shared tensor page (#294)
Wouter Zwerink [Fri, 7 Jul 2023 13:05:57 +0000 (15:05 +0200)]
Fix link to shared tensor page (#294)

3 years agoAutodoc for save_model and load_model (#293)
Wouter Zwerink [Fri, 7 Jul 2023 11:21:02 +0000 (13:21 +0200)]
Autodoc for save_model and load_model (#293)

3 years agoAdding more control to the chosen weights saved on disk. (#292)
Nicolas Patry [Fri, 7 Jul 2023 09:33:14 +0000 (11:33 +0200)]
Adding more control to the chosen weights saved on disk. (#292)

3 years agoFix docstring Args names. (#290)
Akinori Mitani [Tue, 4 Jul 2023 14:41:59 +0000 (07:41 -0700)]
Fix docstring Args names. (#290)

Fix docstring Args names.

3 years agoRevert dev change (#288)
Mishig [Fri, 30 Jun 2023 13:13:17 +0000 (15:13 +0200)]
Revert dev change (#288)

3 years agoFix failing doc build workflows (#287)
Mishig [Fri, 30 Jun 2023 10:30:41 +0000 (12:30 +0200)]
Fix failing doc build workflows (#287)

* [wip: fix docs]

* wip

* pin tf version for doc-builder

3 years agoSuperseed #279 (#285)
Nicolas Patry [Fri, 30 Jun 2023 08:32:00 +0000 (10:32 +0200)]
Superseed #279 (#285)

* Update README.md

Add note about arbitrary JSON not allowed in __metadata__.

* Update README.md

Co-authored-by: Julien Chaumond <julien@huggingface.co>
* Update other readmes.

---------

Co-authored-by: by321 <by321@hotmail.com>
Co-authored-by: Julien Chaumond <julien@huggingface.co>
3 years agoFixing uniform empty tensor handling (#283)
Nicolas Patry [Fri, 30 Jun 2023 07:53:38 +0000 (09:53 +0200)]
Fixing uniform empty tensor handling (#283)

- Fixes #280

3 years agoFix wrong docstring for SafeTensors' names method (#250) (#284)
Alvaro Moran [Fri, 30 Jun 2023 07:16:05 +0000 (09:16 +0200)]
Fix wrong docstring for SafeTensors' names method (#250) (#284)

3 years agoMissing files. (#282)
Nicolas Patry [Tue, 27 Jun 2023 09:39:55 +0000 (11:39 +0200)]
Missing files. (#282)

* Update README.md

* Missing files.

---------

Co-authored-by: iacore <74560659+iacore@users.noreply.github.com>
3 years agofix syntax error in import statement (#276)
Jakub Kaczmarzyk [Wed, 21 Jun 2023 10:21:48 +0000 (06:21 -0400)]
fix syntax error in import statement (#276)

3 years agoAdd a reference to tch-rs (#274)
Laurent Mazare [Thu, 15 Jun 2023 15:00:03 +0000 (16:00 +0100)]
Add a reference to tch-rs (#274)

3 years agoMake tensor identifier a bit more robust, and transformers compatible (#264)
Thomas Wang [Tue, 13 Jun 2023 16:20:19 +0000 (18:20 +0200)]
Make tensor identifier a bit more robust, and transformers compatible (#264)

* Make tensor identifier a bit more robust, and transformers compatible

* Prove that you need to storage storage size as well

* Lint

* Backward compatility for torch version

* Lint

* Fixing tests.

* Test supporting mutliple torch versions.

* Fixing _flatten share pointer detection.

* More code reuse.

* Better error message.

* Attempting to debug what's wrong.

* Fixing torch 1.13... God this is awful.

* Latest python ?

* Dancing with versions.

* ..

---------

Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
3 years ago[doc build] Use secrets (#270)
Mishig [Fri, 9 Jun 2023 10:59:02 +0000 (12:59 +0200)]
[doc build] Use secrets (#270)

3 years agoRemove ISSUE links. (#269)
Nicolas Patry [Wed, 7 Jun 2023 11:56:51 +0000 (13:56 +0200)]
Remove ISSUE links. (#269)

3 years agoAdding issue templates. (#268)
Nicolas Patry [Wed, 7 Jun 2023 11:45:47 +0000 (13:45 +0200)]
Adding issue templates. (#268)

3 years agofix typos (#257)
Kazuaki Ishizaki [Tue, 6 Jun 2023 13:14:50 +0000 (13:14 +0000)]
fix typos (#257)

3 years ago Add BERTopic in Featured Projects (#267)
Daniel van Strien [Tue, 6 Jun 2023 13:12:43 +0000 (14:12 +0100)]
 Add BERTopic in Featured Projects (#267)

3 years agoAdding error checking, convertion can fail on schedulers. (#266)
Nicolas Patry [Tue, 6 Jun 2023 11:03:30 +0000 (13:03 +0200)]
Adding error checking, convertion can fail on schedulers. (#266)

* Adding error checking, convertion can fail on schedulers.

* Printing messages on using the script directly.

3 years agoAdd `safejax` in "Featured Projects" (#260)
Alvaro Bartolome [Mon, 5 Jun 2023 14:40:06 +0000 (16:40 +0200)]
Add `safejax` in "Featured Projects" (#260)

3 years agoUpdate metadata_parsing.mdx (#261)
Mishig [Fri, 2 Jun 2023 08:26:28 +0000 (10:26 +0200)]
Update metadata_parsing.mdx (#261)

Add links to featured models

3 years agoFixing the spec with mention about the buffer which cannot be non-contiguous. (#253)
Nicolas Patry [Mon, 22 May 2023 14:07:24 +0000 (16:07 +0200)]
Fixing the spec with mention about the buffer which cannot be non-contiguous. (#253)

* Adding specification that the byte buffer needs to be contiguous and
full.

* Fix cargo.lock which messes up benchmarks.

3 years ago[docs] Safetensors format (#248)
Mishig [Mon, 22 May 2023 14:00:54 +0000 (16:00 +0200)]
[docs] Safetensors format (#248)

* [docs] Safetensors format

* More text

* Add format illustration

3 years agoAdded method `len` on `SafeTensors` (#252)
Funtowicz Morgan [Mon, 22 May 2023 13:26:06 +0000 (15:26 +0200)]
Added method `len` on `SafeTensors`  (#252)

* Added method `len` on `SafeTensors` in order to avoid allocating a new tensor through `names()` or `tensors()`

* Make clippy happy with `is_empty() -> bool`

* Apply @Narsil suggestion regarding is_empty

Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
* Fix format.

---------

Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
3 years agoUpdate to actions/checkout@v3 (#251)
Funtowicz Morgan [Mon, 22 May 2023 12:50:23 +0000 (14:50 +0200)]
Update to actions/checkout@v3 (#251)

3 years ago[doc] featured projects (#249)
Mishig [Fri, 19 May 2023 08:47:17 +0000 (10:47 +0200)]
[doc] featured projects (#249)

* [doc] featured projects

* typo

3 years ago[doc] Add logo img to index doc page (#247)
Mishig [Wed, 17 May 2023 13:28:49 +0000 (15:28 +0200)]
[doc] Add logo img to index doc page (#247)

* [doc] Add logo img to index doc page

* Update logo.

---------

Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
3 years agoThere should be `.dev0` while on `main` (#246)
Mishig [Wed, 17 May 2023 13:18:07 +0000 (15:18 +0200)]
There should be `.dev0` while on `main` (#246)

3 years ago[doc] Improve metadata parsing doc (#245)
Mishig [Wed, 17 May 2023 12:59:32 +0000 (14:59 +0200)]
[doc] Improve metadata parsing doc  (#245)

* hfjs link to parsesafetensorsmetadata

* Add conditional image

* better wording

* new images

* Add python example

* Add reference to range request

* capitalization

3 years ago[doc] Add a doc page about (remote) Metadata parsing (#243)
Julien Chaumond [Wed, 17 May 2023 09:16:40 +0000 (11:16 +0200)]
[doc] Add a doc page about (remote) Metadata parsing (#243)

Would close #44

3 years agoAdding a banner to the README. (#244)
Nicolas Patry [Wed, 17 May 2023 09:15:11 +0000 (11:15 +0200)]
Adding a banner to the README. (#244)

* Adding a banner to the README.

* Svg.

* Fix size.

3 years agoFixing conda workflow. (#240)
Nicolas Patry [Tue, 25 Apr 2023 12:34:04 +0000 (14:34 +0200)]
Fixing conda workflow. (#240)

3 years agoPrepare 0.3.2 (#239)
Nicolas Patry [Tue, 25 Apr 2023 08:24:04 +0000 (10:24 +0200)]
Prepare 0.3.2 (#239)

3 years agoNew release candidate. (#224)
Nicolas Patry [Mon, 24 Apr 2023 14:21:09 +0000 (16:21 +0200)]
New release candidate. (#224)

3 years agoFixing shared detection logic. (#232)
Nicolas Patry [Mon, 24 Apr 2023 14:15:32 +0000 (16:15 +0200)]
Fixing shared detection logic. (#232)

* Fixing shared tensor logic.

* Fixing shared detection logic.

* torch 1.10 support.

* Rebase.

3 years agoAdding `save_model` and `load_model` to help with shared tensors with PyTorch. (...
Nicolas Patry [Mon, 24 Apr 2023 10:37:00 +0000 (12:37 +0200)]
Adding `save_model` and `load_model` to help with shared tensors with PyTorch. (#236)

* Adding `save_model` and `load_model` to help with shared tensors

and non contiguous tensors.

* Tmp.

* Adding more docs more tests on the edge cases.

* Adding support for different `keep_name` on disk.

* Torch 1.10 support + save_model failure test.

* Fixes 1.10

* Debugging on remote..

* 1.

* 2.

* 3.

* 4.

* Trying to fix documentation builder version.

* PR documentation + route from error message to new methods.

* ..

* Revert ".."

This reverts commit 564b6863fc11407e19982944733de999c17c95ba.

* Fixing `.[dev]` ?

* Adding contiguous support.

* ?

* Fix.

3 years agoFixing alignment (#235)
Nicolas Patry [Fri, 21 Apr 2023 12:54:22 +0000 (14:54 +0200)]
Fixing alignment (#235)

* Alignment checking.

* Fix alignments.

* Updating python tests.

* Improve a bit readability.

3 years agoFixing the logic to determine if PR is up-to-date. (#230)
Nicolas Patry [Wed, 19 Apr 2023 13:46:04 +0000 (15:46 +0200)]
Fixing  the logic to determine if PR is up-to-date. (#230)

* Fixing  the logic to determine if PR is up-to-date.

* Update bindings/python/convert.py

3 years agoCommitting Cargo.lock. (#233)
Nicolas Patry [Wed, 12 Apr 2023 14:18:58 +0000 (16:18 +0200)]
Committing Cargo.lock. (#233)

* Committing Cargo.lock.

* Update .gitignore

Co-authored-by: Mishig <dmishig@gmail.com>
---------

Co-authored-by: Mishig <dmishig@gmail.com>
3 years agoMinor checks + proptest in python. (#228)
Nicolas Patry [Thu, 6 Apr 2023 11:08:14 +0000 (13:08 +0200)]
Minor checks + proptest in python. (#228)

* Minor checks + proptest in python.

* Fix readme.

* Tf version.

* Fix.

* Jax version.

* Jaxlib.

* Jax.

* Cannot have jax version

- Python 3.7 is minimal version for which they don't have release
  jax>0.4
- Our doc builder relies on jax>0.4

* wtf.

* .

* ...

* Wahtever.

3 years agoSpecify python versions. (#227)
Nicolas Patry [Thu, 6 Apr 2023 08:27:38 +0000 (10:27 +0200)]
Specify python versions. (#227)

3 years ago0-sized tensors allowed. (#226)
Nicolas Patry [Thu, 6 Apr 2023 08:27:30 +0000 (10:27 +0200)]
0-sized tensors allowed. (#226)

3 years agoAdding last missing test for validate. (#225)
Nicolas Patry [Thu, 6 Apr 2023 08:27:13 +0000 (10:27 +0200)]
Adding last missing test for validate. (#225)

3 years agoRemove the breaking change of disallowing zero sized tensors. (#221)
Nicolas Patry [Thu, 30 Mar 2023 12:58:08 +0000 (14:58 +0200)]
Remove the breaking change of disallowing zero sized tensors. (#221)

* Remove the breaking change of disallowing zero sized tensors.

Some files out there might exist with this.
While being questionnable, it's not worth doing a breaking change
since there doesn't seem to be either a security implication
nor a performance hit.

* Full support for zero-sized tensor on torch==1.10

* Adding a nice comment.

3 years agoFixing empty shape test. (#218)
Nicolas Patry [Wed, 29 Mar 2023 08:58:08 +0000 (10:58 +0200)]
Fixing empty shape test. (#218)

3 years agoAdd a safety warning in the convertion script. (#219)
Nicolas Patry [Wed, 29 Mar 2023 08:57:32 +0000 (10:57 +0200)]
Add a safety warning in the convertion script. (#219)

* Add a safety warning in the convertion script.

* Fix test temporarily.

3 years agoAdding arithmetic overflow checks (unchecked in release builds). (#207)
Nicolas Patry [Wed, 29 Mar 2023 08:57:14 +0000 (10:57 +0200)]
Adding arithmetic overflow checks (unchecked in release builds). (#207)

* Adding arithmetic overflow checks (unchecked in release builds).

* Fix rebase

3 years agoOverspecify a bit the format. (#215)
Nicolas Patry [Tue, 28 Mar 2023 13:53:50 +0000 (15:53 +0200)]
Overspecify a bit the format. (#215)

* Updating the README to overspecify JSON.

* Overspecify a bit the format.

* Stop being annoying.

* Fixing python cache + gh action.

* Fix audit.

* Fixing rust cache for python directory ?

3 years agoDisallow erroneous buffer. (#206)
Nicolas Patry [Tue, 28 Mar 2023 13:47:23 +0000 (15:47 +0200)]
Disallow erroneous buffer. (#206)

3 years agoDisallowing zero-width tensor. (#205)
Nicolas Patry [Tue, 28 Mar 2023 13:45:39 +0000 (15:45 +0200)]
Disallowing zero-width tensor. (#205)

* Disallowing zero-width tensor.

* Fix test.

3 years agoAdding simple proptest. (#216)
Nicolas Patry [Tue, 28 Mar 2023 13:45:08 +0000 (15:45 +0200)]
Adding simple proptest. (#216)

3 years agoZero width shape are OK (0-rank tensors). They are simply a scalar. (#208)
Nicolas Patry [Tue, 28 Mar 2023 13:32:41 +0000 (15:32 +0200)]
Zero width shape are OK (0-rank tensors). They are simply a scalar. (#208)

* Zero width shape are OK (0-rank tensors). They are simply a scalar.

Reasosn for support is that both torch and numpy support them, and
they flow naturally from the definition that an empty product has
length 1.

* not allowed -> allowed

3 years agoDeactivating codecov commenting. (#217)
Nicolas Patry [Tue, 28 Mar 2023 13:20:39 +0000 (15:20 +0200)]
Deactivating codecov commenting. (#217)

3 years agoIncrease coverage on the error paths. (#214)
Nicolas Patry [Tue, 28 Mar 2023 12:13:38 +0000 (14:13 +0200)]
Increase coverage on the error paths. (#214)

3 years agoFixing codecov rust tag. (#213)
Nicolas Patry [Tue, 28 Mar 2023 10:46:09 +0000 (12:46 +0200)]
Fixing codecov rust tag. (#213)

3 years agoOops. (#212)
Nicolas Patry [Tue, 28 Mar 2023 10:40:20 +0000 (12:40 +0200)]
Oops. (#212)

3 years agoUpload codecov for main branch. (#211)
Nicolas Patry [Tue, 28 Mar 2023 10:33:56 +0000 (12:33 +0200)]
Upload codecov for main branch. (#211)

3 years agoRemove unwrap in prod code. (#209)
Nicolas Patry [Tue, 28 Mar 2023 10:26:19 +0000 (12:26 +0200)]
Remove unwrap in prod code. (#209)

3 years agoMore badges. (#210)
Nicolas Patry [Tue, 28 Mar 2023 10:24:44 +0000 (12:24 +0200)]
More badges. (#210)

* More badges.

* Update action to create codecov.

* Update readmes.

* Fix doc link.

* Two lines for Python and Rust.

* Doc link.

* Fix badge label.

* Use simpler run to get default working-dir.

* Fix ?

* Audit.

* Ignore criterion issue.

* Better command line ?

* codecov token.

* Working dir.

* Specify file.

* Fixing upload only on ubuntu.

* Code coverage only on linux.

* Fix codecov link.

3 years agoMinor improvements for README (#201)
nickkolok [Tue, 28 Mar 2023 08:20:42 +0000 (11:20 +0300)]
Minor improvements for README (#201)

* Use `s for code

* Fix typos in README

* All readmes.

* Adding Rust cache and latest ubuntu for python tests.

---------

Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
3 years agoAdding a minimal version for torch. (#204)
Nicolas Patry [Mon, 27 Mar 2023 08:30:56 +0000 (10:30 +0200)]
Adding a minimal version for torch. (#204)

3 years agoPython 2.0 added a warning on ByteStorage, so using UntypedStorage (#196)
Nicolas Patry [Fri, 17 Mar 2023 14:56:06 +0000 (15:56 +0100)]
Python 2.0 added a warning on ByteStorage, so using UntypedStorage (#196)

* Python 2.0 added a warning on ByteStorage, so using UntypedStorage

directly for that version.

Small error in their docs, `size` got renamed `nbytes`.

* Remove unused work.

3 years agoAdding commit description to convertion PR. (#198)
Nicolas Patry [Fri, 17 Mar 2023 09:42:34 +0000 (10:42 +0100)]
Adding commit description to convertion PR. (#198)

* Adding commit description to convertion PR.

* Update bindings/python/convert.py

Co-authored-by: Omar Sanseviero <osanseviero@gmail.com>
* Adding suggestion for reporting issues.

---------

Co-authored-by: Omar Sanseviero <osanseviero@gmail.com>
3 years agoNicer error when failed to find tensor in Rust. (#191)
Nicolas Patry [Mon, 13 Mar 2023 10:35:40 +0000 (11:35 +0100)]
Nicer error when failed to find tensor in Rust. (#191)

Co-authored-by: Ubuntu <ubuntu@ip-172-31-34-94.eu-west-3.compute.internal>
3 years agoMaking sure the safetensors existing PR is up-to-date. (#192)
Nicolas Patry [Mon, 13 Mar 2023 10:35:27 +0000 (11:35 +0100)]
Making sure the safetensors existing PR is up-to-date. (#192)

* Making sure the safetensors existing PR is up-to-date.

* Fixed `target_branch` exists only on details.

3 years agoAdding memmap example to read from file. (#189)
Nicolas Patry [Wed, 8 Mar 2023 12:01:26 +0000 (13:01 +0100)]
Adding memmap example to read from file. (#189)

3 years agoRemove too many keywords. (#187)
Nicolas Patry [Wed, 8 Mar 2023 12:01:11 +0000 (13:01 +0100)]
Remove too many keywords. (#187)

3 years agoVersion 0.3.0 (#186)
Nicolas Patry [Fri, 3 Mar 2023 14:21:07 +0000 (15:21 +0100)]
Version 0.3.0 (#186)

3 years agoPreparing for release 0.3rc1. (#185)
Nicolas Patry [Wed, 1 Mar 2023 20:45:08 +0000 (21:45 +0100)]
Preparing for release 0.3rc1. (#185)

* Preparing for release 0.3rc1.

* Full version number.

3 years agoFaster GPU Loads ?? (#184)
Nicolas Patry [Tue, 28 Feb 2023 15:19:40 +0000 (16:19 +0100)]
Faster GPU Loads ?? (#184)

* Faster GPU Loads ??

Beats my expectations. I wonder what I did do to not see this perf
bottleneck/improvements.

* Pyslice still not fixed on PyO3.

* Upgrade PyO3.

* Using newer pyo3.

* Make benches Windows friendly.

3 years agoBetter Rust API (tch-rs) (#179)
Nicolas Patry [Fri, 24 Feb 2023 13:56:51 +0000 (14:56 +0100)]
Better Rust API (tch-rs) (#179)

* Implementing a trait API for the Rust (should make tch-rs interaction
easier).

* Companion type.

* Re-export major formats + 3rd example in the trait doc.

* Even clearer OpaqueGPU type.

* Moving to `Cow<[u8]>`. Feels simpler.

* Fixes.

3 years agoREADME.md proposed clarity (#181)
Dwayne Robinson [Fri, 24 Feb 2023 10:12:57 +0000 (02:12 -0800)]
README.md proposed clarity (#181)

* README.md proposed clarity

I had to look via a hex editor at an existing .safetensors file to figure it out (maybe this will accelerate others slightly to adopt it 😅), because parentheses "(...)" are not legal JSON, and it wasn't clear to me whether the offsets were file relative or byte buffer relative.

* Update other readme.

---------

Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
3 years ago[Major Change] Enforcing tensor alignment (#148)
Nicolas Patry [Tue, 21 Feb 2023 14:23:56 +0000 (15:23 +0100)]
[Major Change] Enforcing tensor alignment (#148)

* [Major Change] Enforcing tensor alignment

- Now the header will automatically align itself to 8 bytes (f64) with
  appending extra spaces as necessary.
- This will allow extra fast memory mapping by reinterpreting bytes as
  f32/f64 etc.. Unaligned bytes do not allow for this. https://www.reddit.com/r/rust/comments/tanaxm/mutating_a_buffer_of_u8s_as_f32s_in_place/
- This does not change contiguousness of tensors
- This does not change the actual spec (we're just putting extra valid bytes
  in the header and using a different serialization ordering)
- Readers should still be able to read old files, they would just need
  to be copied before being cast as their final destination when using
  mmap
- This has no effect for GPU since copy is already necessary (*I think*,
  depends on the cuda API actually if it allows filling f32 addresses
  from raw unaligned bytes).

This change will only be interesting if things like https://github.com/Narsil/fast_gpt2
actually pick up. And even with the copy, load times are still vastly
superior to `pytorch`.

We need to be able to read old files.

* Fixup.

* Clippy fix.

* Cargo fmt (clippy --fix broke it ? :( )

3 years agoadd paddle docs (#177)
yujun [Wed, 8 Feb 2023 10:06:05 +0000 (18:06 +0800)]
add paddle docs (#177)

3 years agoAdd PaddlePaddle backend (#176)
yujun [Tue, 7 Feb 2023 14:44:54 +0000 (22:44 +0800)]
Add PaddlePaddle backend (#176)

* add paddle backend

* add paddle ace

* update docs

* Some modifications.

* Consistency.

* Showing Paddle format.

* donot modify lib.rs

* remove test_deserialization_safe_open test

* rm unused import

* make style

* Style.

---------

Co-authored-by: Nicolas Patry <patry.nicolas@protonmail.com>
3 years agoFixing error message for FileNotFound. (#175)
Nicolas Patry [Mon, 6 Feb 2023 11:05:40 +0000 (12:05 +0100)]
Fixing error message for FileNotFound. (#175)

* Fixing error message for FileNotFound.

* Old PR readme fix.