https://github.com/tky823/bitlinear158compression
Compare compression models for inference by BitLinear158
https://github.com/tky823/bitlinear158compression
cuda pytorch quantization
Last synced: 10 days ago
JSON representation
Compare compression models for inference by BitLinear158
- Host: GitHub
- URL: https://github.com/tky823/bitlinear158compression
- Owner: tky823
- Created: 2024-12-31T06:30:21.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-04T06:26:40.000Z (over 1 year ago)
- Last Synced: 2025-02-24T15:56:59.204Z (over 1 year ago)
- Topics: cuda, pytorch, quantization
- Language: Python
- Homepage:
- Size: 32.2 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# BitLinear158Compression
In this library, we compare following compression models for inference by BitLinear158:
- `BitLinear158`: Ternary weight is managed by `float32` (naive implementation)
- `BitLinear158Int8Inference`: Ternary weight is managed by `int8`
- `BitLinear158Uint2Inference`: Ternary weight is managed by `uint2` defined in `torchao`
- `BitLinear158CppInference`: Ternary weight is managed by `int8` and forward pass is implemented by C++/CUDA. When weight is on CUDA, CUDA kernel is used under the hood.
## Installation
```sh
pip install .
```
## Test
```sh
python tests/test_bitlinear158_inference.py
```
## NOTE
There is room for improvement of computational speed by setting additional compling arguments in `setup.py`.