@@ -142,18 +142,71 @@ The engine and KV compression are architecture-independent. Verified from 270M t
142142
143143---
144144
145+ ## GPU Backends
146+
147+ TurboQuant runs on all major GPU platforms — including AMD.
148+
149+ | Backend | Target | Status | Files |
150+ | ---------| --------| --------| -------|
151+ | ** CUDA** | NVIDIA GPU | Production (1,919 LOC) | ` src/backend/cuda/ ` |
152+ | ** Metal** | Apple Silicon | Production (1,494 LOC) | ` src/backend/metal/ ` |
153+ | ** Vulkan** | ** AMD + cross-platform** | New (2,317 LOC) | ` src/backend/vulkan/ ` |
154+ | ** ROCm/HIP** | ** AMD ROCm** | New (2,174 LOC) | ` src/backend/rocm/ ` |
155+ | ** NEON** | ARM CPU | Production (980 LOC) | ` src/backend/cpu/tq_neon.c ` |
156+ | ** AVX2** | x86 CPU | Expanded (638 LOC) | ` src/backend/cpu/tq_avx2.c ` |
157+
158+ ``` bash
159+ # Build with GPU backends
160+ cmake -B build -DTQ_BUILD_CUDA=ON # NVIDIA
161+ cmake -B build -DTQ_BUILD_METAL=ON # Apple Silicon
162+ cmake -B build -DTQ_BUILD_VULKAN=ON # AMD / cross-platform
163+ cmake -B build -DTQ_BUILD_ROCM=ON # AMD ROCm
164+ ```
165+
166+ Each backend implements 3 core GPU kernels:
167+ 1 . ** ` quantize_key ` ** — RHT + codebook + bit-pack (PolarQuant/QJL)
168+ 2 . ** ` attention_quant ` ** — quantized K x Q dot product + softmax
169+ 3 . ** ` quantize_value ` ** — min-max Q4/Q2 pack + fused dequant-matmul
170+
171+ > AMD users: Vulkan (cross-platform, Vulkan 1.1) or ROCm/HIP (native, CUDA-compatible API).
172+
173+ ---
174+
175+ ## GGUF Model Loading
176+
177+ Load community GGUF models directly — no conversion needed.
178+
179+ ``` bash
180+ # Download from Hugging Face (Unsloth, bartowski, etc.)
181+ ./build/tq_run model.gguf -p " Hello" -k turbo_kv_1b
182+
183+ # Supported: Q8_0, Q4_K, Q5_K, Q6_K, IQ2_XXS, IQ2_S, BF16, F16, F32
184+ # MoE models: top-K expert routing + shared expert + SwiGLU
185+ ```
186+
187+ | Feature | Status |
188+ | ---------| --------|
189+ | GGUF v3 parser (mmap) | 24 quant types supported |
190+ | IQ2_XXS (E8 lattice) | Full codebook dequant |
191+ | IQ2_S (10-bit grid) | Full codebook dequant |
192+ | MoE routing | 256 experts, top-8, shared expert |
193+ | DeltaNet hybrid | Qwen3.5 DeltaNet + self_attn |
194+ | GGUF tokenizer | BPE from metadata |
195+ | On-the-fly weight dequant | No FP32 bulk conversion — saves ~ 5GB |
196+
197+ ---
198+
145199## Under the Hood
146200
147201** Self-built inference engine** — not a fork, not a wrapper. Every component written from scratch.
148202
149- - ** 15 ,000+ lines of C** — transformer, tokenizer, matmul, attention, sampling — zero external dependencies
203+ - ** 20 ,000+ lines of C/C++ ** — transformer, tokenizer, matmul, attention, sampling, GPU kernels — zero external dependencies
150204- ** 12 KV quantization types** — the core differentiator: RHT + Lloyd-Max + QJL for unbiased inner products
205+ - ** 6 compute backends** — CUDA, Metal, Vulkan, ROCm/HIP, NEON, AVX2
151206- ** Fused Q4 attention** — weighted sum directly from packed nibbles, no dequant buffer
152207- ** Adaptive compression** — per-layer bit recommendation, online codebook calibration (49.7% MSE gain)
153- - ** NEON vectorized ** — matmul, attention, RHT butterfly, Hamming distance, Q4 dequant
208+ - ** GGUF v3 loader ** — 24 quant types, IQ2 E8 lattice, MoE expert dispatch, on-the-fly dequant
154209- ** 31 test suites** — perplexity, unbiasedness, attention distribution, codebook theory, NEON consistency, edge cases, rate-distortion, cumulative error
155- - - ** GGUF v3 loading** — Q8_0, Q4_K_M, IQ2_XXS verified; 35B MoE coherent output
156- - ** MoE routing** — top-K expert selection, shared expert, SwiGLU (verified on 35B)
157210
158211---
159212
0 commit comments