Thank you for your interest in contributing! Here's how to get started.
git clone https://github.com/quantumaikr/quant.cpp
cd quant.cpp
cmake -B build -DCMAKE_BUILD_TYPE=Debug -DTQ_BUILD_TESTS=ON
cmake --build build -j$(nproc 2>/dev/null || sysctl -n hw.ncpu)
ctest --test-dir build --output-on-failureOr with Docker:
docker build -t quant .
docker run quant models/model.gguf -p "Hello"# All tests
ctest --test-dir build --output-on-failure
# Specific test
./build/test_polar
./build/test_qjl
# With scoring harness (5-dimension evaluation)
bash score.sh # Full evaluation
bash score.sh --quick # Build + correctness only
bash score.sh --bench # Performance benchmarks
bash score.sh --quality # Quantization quality metricsCheck Issues for tasks labeled good first issue or help wanted.
High-impact areas:
- New model architectures (Llama, Phi, Gemma)
- AVX2/AVX-512 SIMD kernels for x86
- Metal GPU compute shaders
- Long context benchmarks (8K, 32K, 128K tokens)
- Add the model config struct to
include/turboquant/tq_engine.h - Implement the forward pass in
src/engine/(one file per architecture) - Register the architecture in
tq_load_model()insrc/engine/tq_model.c - Add a test in
tests/and an example inexamples/ - Verify with
bash score.sh --quick
- Define the type enum in
include/turboquant/tq_types.h(append totq_typeenum) - Add block struct +
static_assertsize check ininclude/turboquant/tq_spec.h - Implement
quantize/dequantize/attentioninsrc/core/tq_<name>.c - Register in the dispatch table in
src/core/tq_traits.c - Add unit tests in
tests/test_<name>.cpp - Update
tools/quant.cto accept the new type name inparse_kv_type()
- C11 for core library (
src/), C++17 for tests and CUDA/Metal wrappers - No external dependencies in core (libc/libm/pthread only)
- Every block struct must have
static_assertsize verification - Every public function needs a unit test
- ONNX LSB-first bit-packing convention for all quantized formats
- Use
refs/code as algorithm reference -- port to C, don't wrap Python
Each module has exclusive files to prevent merge conflicts:
| Module | Files |
|---|---|
polar |
src/core/tq_polar.*, tests/test_polar.* |
qjl |
src/core/tq_qjl.*, tests/test_qjl.* |
turbo |
src/core/tq_turbo.*, tests/test_turbo.* |
uniform |
src/core/tq_uniform.*, src/core/tq_value_quant.* |
engine |
src/engine/* |
cache |
src/cache/* |
simd |
src/backend/cpu/* |
Before submitting, verify:
- NEON intrinsics are inside
#ifdef __ARM_NEONguards - No GCC warnings (
-Wall -Wextra -Wpedantic) - Scalar fallback exists for all SIMD code paths
- Function pointer types match their typedefs
- Fork and create a feature branch
- Make your changes
- Ensure all tests pass and no new warnings
- Submit a PR with a clear description
By contributing, you agree that your contributions will be licensed under the Apache 2.0 License.