]> khamidou — GitHub mirrors - safetensors.git/commit
Make GPU loading faster by removing all extra CPU copies. (#33)
authorNicolas Patry <patry.nicolas@protonmail.com>
Wed, 2 Nov 2022 15:53:50 +0000 (16:53 +0100)
committerGitHub <noreply@github.com>
Wed, 2 Nov 2022 15:53:50 +0000 (16:53 +0100)
commitbe0683f561f1f742c9253d46325945f6251a0770
tree07902b31e4b3c421260a8c271ca6130efb8498e5
parenta76f9e82979bdbc9ba025edec47fa6005c633833
Make GPU loading faster by removing all extra CPU copies. (#33)

* Faster gpu load.

Use cuda-sys directly.

For slice too.

Fun unsafe.

Reduce unsafe.

Removing CPU unsafe.

Using shared `cuda-sys` (temporary, we need to use torch's cuda version).

Tmp rework

Cleaner device.

Adding some statistics...

Warmup steps.

Removing unsafe GPU accesses.

Removing dead code.

Removing libloading.

Revert "Removing unsafe GPU accesses."

This reverts commit 5325ba2b73fffc16416130193da1690353e0a7db.

Unsafe comments.

Using GILOnceCell for module reuse.

Finding the lib through the real python workload.
Still requires transitive library parsing.

Stable with global lib ref.

Abort.

Weird bug on torch 1.13.

We **need** to get the data_ptr within the loop ?

* Fixing speedup by loading directly the loaded C library within Python.

* Cleanup.

* Finishing touches.

* Remove some code duplication.

Some very weird errors in calling the `cudaMemcpy` that fail depending
on order. Even aliasing the `Symbol` seem to be unsafe.

* Adding some comments.

* Better signature. Static symbol instead of lib.
bindings/python/Cargo.toml
bindings/python/src/lib.rs