@@ -12,6 +12,30 @@ cmake --build build -j$(nproc 2>/dev/null || sysctl -n hw.ncpu)
1212ctest --test-dir build --output-on-failure
1313```
1414
15+ Or with Docker:
16+
17+ ``` bash
18+ docker build -t turboquant .
19+ docker run turboquant models/model.tqm -p " Hello" -k turbo_kv_1b
20+ ```
21+
22+ ## Running Tests
23+
24+ ``` bash
25+ # All tests
26+ ctest --test-dir build --output-on-failure
27+
28+ # Specific test
29+ ./build/test_polar
30+ ./build/test_qjl
31+
32+ # With scoring harness (5-dimension evaluation)
33+ bash score.sh # Full evaluation
34+ bash score.sh --quick # Build + correctness only
35+ bash score.sh --bench # Performance benchmarks
36+ bash score.sh --quality # Quantization quality metrics
37+ ```
38+
1539## What to Work On
1640
1741Check [ Issues] ( https://github.com/quantumaikr/TurboQuant.cpp/issues ) for tasks labeled ` good first issue ` or ` help wanted ` .
@@ -22,12 +46,31 @@ Check [Issues](https://github.com/quantumaikr/TurboQuant.cpp/issues) for tasks l
2246- Metal GPU compute shaders
2347- Long context benchmarks (8K, 32K, 128K tokens)
2448
49+ ## Adding a New Model Architecture
50+
51+ 1 . Add the model config struct to ` include/turboquant/tq_engine.h `
52+ 2 . Implement the forward pass in ` src/engine/ ` (one file per architecture)
53+ 3 . Register the architecture in ` tq_load_model() ` in ` src/engine/tq_model_loader.c `
54+ 4 . Add a test in ` tests/ ` and an example in ` examples/ `
55+ 5 . Verify with ` bash score.sh --quick `
56+
57+ ## Adding a New KV Cache Type
58+
59+ 1 . Define the type enum in ` include/turboquant/tq_types.h ` (append to ` tq_type ` enum)
60+ 2 . Add block struct + ` static_assert ` size check in ` include/turboquant/tq_spec.h `
61+ 3 . Implement ` quantize ` /` dequantize ` /` attention ` in ` src/core/tq_<name>.c `
62+ 4 . Register in the dispatch table in ` src/core/tq_traits.c `
63+ 5 . Add unit tests in ` tests/test_<name>.cpp `
64+ 6 . Update ` tools/tq_run.c ` to accept the new type name in ` parse_kv_type() `
65+
2566## Code Standards
2667
27- - ** C11** for core library (` src/ ` ), ** C++17** for tests
68+ - ** C11** for core library (` src/ ` ), ** C++17** for tests and CUDA/Metal wrappers
2869- No external dependencies in core (libc/libm/pthread only)
29- - Every public function needs a test
30- - Run tests before submitting: ` ctest --test-dir build `
70+ - Every block struct must have ` static_assert ` size verification
71+ - Every public function needs a unit test
72+ - ONNX LSB-first bit-packing convention for all quantized formats
73+ - Use ` refs/ ` code as algorithm reference -- port to C, don't wrap Python
3174
3275## Module Ownership
3376
@@ -38,23 +81,25 @@ Each module has exclusive files to prevent merge conflicts:
3881| ` polar ` | ` src/core/tq_polar.* ` , ` tests/test_polar.* ` |
3982| ` qjl ` | ` src/core/tq_qjl.* ` , ` tests/test_qjl.* ` |
4083| ` turbo ` | ` src/core/tq_turbo.* ` , ` tests/test_turbo.* ` |
84+ | ` uniform ` | ` src/core/tq_uniform.* ` , ` src/core/tq_value_quant.* ` |
4185| ` engine ` | ` src/engine/* ` |
4286| ` cache ` | ` src/cache/* ` |
4387| ` simd ` | ` src/backend/cpu/* ` |
4488
45- ## Pull Request Process
46-
47- 1 . Fork and create a feature branch
48- 2 . Make your changes
49- 3 . Ensure all tests pass and no new warnings
50- 4 . Submit a PR with a clear description
51-
5289## Cross-Platform Checklist
5390
5491Before submitting, verify:
5592- [ ] NEON intrinsics are inside ` #ifdef __ARM_NEON ` guards
5693- [ ] No GCC warnings (` -Wall -Wextra -Wpedantic ` )
5794- [ ] Scalar fallback exists for all SIMD code paths
95+ - [ ] Function pointer types match their typedefs
96+
97+ ## Pull Request Process
98+
99+ 1 . Fork and create a feature branch
100+ 2 . Make your changes
101+ 3 . Ensure all tests pass and no new warnings
102+ 4 . Submit a PR with a clear description
58103
59104## License
60105
0 commit comments