INT4 quantization tooling and CUDA extension
Project description
qgemm
Scaffold for INT4 weight quantization utilities and future CUDA/C++ extensions.
- CPU/Python quantization utilities in
python/quantize.py - LLaMA converter to INT4 safetensors in
python/convert_llama.py - Weight format documented in
docs/weight_format.md - Packaging via
pyproject.tomland wired CUDA extension insetup.py
Build the CUDA/C++ extension (Phase 3)
- Prereqs: PyTorch with CUDA, a CUDA toolkit (nvcc), a GPU with sm80+.
- Via pip/setuptools (in-place build):
QGEMM_BUILD_EXT=1 TORCH_CUDA_ARCH_LIST=80 pip install -e .- or set custom arches:
QGEMM_CUDA_ARCHS="80,90" pip install -e .
- After install, importing
qgemmwill auto-registertorch.ops.qgemm.*.
Build with CMake
cmake -S . -B build -DCMAKE_CUDA_ARCHITECTURES=80cmake --build build -j- Load the produced
libqgemm_ops.sousingtorch.ops.load_libraryif using outside the package.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
qgemm-0.0.2.tar.gz
(25.2 kB
view details)
File details
Details for the file qgemm-0.0.2.tar.gz.
File metadata
- Download URL: qgemm-0.0.2.tar.gz
- Upload date:
- Size: 25.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db6d0d647a7cd6b4289ed69d4c68ae54161533b94c08503dafe7a54147d97c91
|
|
| MD5 |
940ebd4b3d9acc9bf8d99d8ed998046f
|
|
| BLAKE2b-256 |
c575d0d8f58ffbf181d03f7bbe118188d8c6e14e6485579ea03edecb80d580bf
|