Skip to content

Commit

Permalink
Merge pull request #2 from eugenehp/git-patches
Browse files Browse the repository at this point in the history
Create git patches for submodules
  • Loading branch information
eugenehp authored Nov 17, 2024
2 parents 0de8fbd + b7cde57 commit 73c84f3
Show file tree
Hide file tree
Showing 29 changed files with 2,349 additions and 1,610 deletions.
201 changes: 191 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ members = [
]

[workspace.dependencies]
thiserror = "1"
thiserror = "2.0.3"
tracing = "0.1"
bindgen = "0.70.1"
cc = "1.1.31"
cc = "1.2.1"
encoding_rs = "0.8.34"

[workspace.lints.rust]
Expand Down
33 changes: 11 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,25 @@ Almost safe wrapper for [BitNet-cpp](https://github.com/microsoft/BitNet) based

## Development

Add bitnet submodule:

```shell
cd bitnet-cpp-sys
git submodule add --name bitnet --depth 10 -- https://github.com/microsoft/BitNet.git bitnet
```

Pull recursive updates:

```shell
cd bitnet-cpp-sys/bitnet
git submodule update --init --recursive
```

Configure using python:

```shell
cd bitnet-cpp-sys/bitnet
pip install -r requirements.txt
python setup_env.py --hf-repo HF1BitLLM/Llama3-8B-1.58-100B-tokens -q i2_s # only needs gen_code()
```
See [bitnet-cpp-sys](https://github.com/eugenehp/bitnet-cpp-rs/tree/main/bitnet-cpp-sys)

## Roadmap

- [ ] minimize crate size
- [ ] rewrite sampler [PR 9294](https://github.com/ggerganov/llama.cpp/pull/9294)
- [x] rewrite sampler [PR 9294](https://github.com/ggerganov/llama.cpp/pull/9294)
- [ ] look into Metal implementation of MatMul kernerls for BitNet
- [ ] add more examples
- [ ] replace all remaining python from BitNet repo
- [ ] add better division between `arm64` and `x86_64`
- [ ] move python code generation into `patch` files

## Platform support

| arm64 | x64 | OS | comments |
|---|---|---|---|
||| MacOS | tested fully on Apple Silicon macs |
| ⚠️ || Linux | should test on ARM based linux |
||| Windows | we're using patches, so *-sys build won't work yet |

## Thanks

Expand Down
2 changes: 1 addition & 1 deletion bitnet-cpp-sys/BitNet
Submodule BitNet updated from 4943bf to bf11a4
Loading

0 comments on commit 73c84f3

Please sign in to comment.