4 releases

new 0.0.4 Nov 17, 2024
0.0.3 Nov 17, 2024
0.0.2 Oct 27, 2024
0.0.1 Oct 25, 2024

#999 in Machine learning

Download history 120/week @ 2024-10-21 144/week @ 2024-10-28 32/week @ 2024-11-04

296 downloads per month
Used in bitnet-cpp

MIT license

6MB
116K SLoC

C++ 55K SLoC // 0.1% comments C 35K SLoC // 0.1% comments CUDA 8K SLoC // 0.0% comments Python 7.5K SLoC // 0.1% comments Metal Shading Language 5K SLoC // 0.0% comments Objective-C 3K SLoC // 0.1% comments GLSL 2.5K SLoC // 0.0% comments Rust 568 SLoC // 0.2% comments INI 120 SLoC Shell 28 SLoC // 0.2% comments

bitnet-cpp-sys

Raw bindings to bitnet.cpp.

See bitnet-cpp for a safe API.

Development

Atomic git patches are incorporated into the build.rs, but if you want to dive deeper, see the patch generation below.

cargo clean && cargo build

How to manually apply generated patches

Apply patches from the python generation:

./patches/apply.sh

Updating submodules

Generate python changes:

cd bitnet
pip install -r requirements.txt
python setup_env.py --hf-repo HF1BitLLM/Llama3-8B-1.58-100B-tokens -q i2_s

Create patches after you're done generating python changes:

./patches/create.sh

Clean git commits from submodules to start over or run commits:

./patches/clean.sh
# this won't build without cleaning first, though normal cargo build works as is.
cargo clean && BUILD_DEBUG=true CMAKE_VERBOSE=true cargo build

Publishing

Check which files will be included in the published crate:

cargo package --list --allow-dirty

Do a dry run:

cargo publish --allow-dirty --dry-run 

Or you can simply remove bitnet/3rdparty/llama.cpp/common/build-info.cpp and run:

cargo publish --dry-run

License

MIT

© 2024, Eugene Hauptmann

Dependencies