by Morrowmake
Smaller. Faster. Sharper. Everywhere.
FITQ is an open, engine-agnostic, hardware-portable weight format for large dense and Mixture-of-Experts (MoE) language models. One .fitq file is designed to run natively across modern GPUs and unified-memory accelerators — built from first principles so any inference engine and any vendor's 8-bit integer matrix units can push both single-user decode and long-context prefill right up to silicon rooflines.
This repository contains the complete FITQ format specification, normative C99 reference decoder and test-vector checker, independent Python + NumPy reader, binary conformance vectors, and the open-source FITQ converter (fitq Python package + multi-arch CUDA trellis encoders) for quantizing dense and MoE Hugging Face models into .fitq checkpoints.
Early-format note: FITQ is brand new. Our first-generation inference kernels (launching first in TensorFold) have only been hardware-tested and tuned on NVIDIA Ampere (
sm_80/sm_86) so far. Newer NVIDIA architectures (sm_89–sm_120) and Apple Silicon (Metal) are early/experimental and not yet hardware-tuned, and AMD, Intel, Vulkan, and fast CPU inference backends do not exist yet. The CUDA converter requires NVIDIA Ampere or newer (sm_80+). See Current Implementation Status below.
Scalar quantization formats (like GGUF K-quants, GPTQ, or AWQ) are fast to unpack, but leave significant model quality on the table below 4 bits per weight. Trellis quantization preserves far more accuracy per bit, yet existing trellis formats pay a heavy runtime tax: high per-weight decode instruction counts or shared-memory lookup tables that stall ALUs, exhaust registers, and bottleneck high-bandwidth GPUs or Apple Silicon.
FITQ was designed to remove that tradeoff by compounding four format-level advantages:
- Fast, branchless, lookup-table-free unpacking (
~0.97ops/weight at 3-bit,~1–2ops across2–6bits): Every FITQ trellis code (t2–t6) decodes 4 weights per step using only 32-bit integer arithmetic — zero lookup tables, zero shared-memory bank conflicts, and no vendor-specific unpack instructions (compare5.26ops/weight in EXL3). Decode instructions hide cleanly behind memory loads, keeping single-stream weight reads at or near the memory-bandwidth roofline even on HBM GPUs and modern high-bandwidth Apple Silicon. - Direct
INT8output (2×matrix-unit compute across every major GPU vendor, virtually lossless vs.BF16): Instead of dequantizing weights back toFP16/BF16, FITQ unpacks straight into packedINT8ready for native 8-bit integer matrix multiplication — where NVIDIA Tensor Cores (mma.sync), Apple SiliconMetal 4matrix units, AMD RDNA 4 / CDNA (WMMA/MFMA, e.g.Radeon AI PRO R9700:383INT8 TOPS vs191FP16 TFLOPS), and IntelXe2(XMX, e.g.Arc Pro B70:367INT8 TOPS vs183.5FP16 TFLOPS) all deliver 2× higher throughput thanFP16/BF16. Because FITQ applies Hadamard rotations to spread outlier channels evenly across every vector,INT8matrix math is virtually lossless compared toBF16— directly doubling matrix compute headroom on prefill, multi-user concurrency, and speculative verify batches without giving up quality (see Current Implementation Status for which backends exist today). - Fine-grained mixed precision (
2.0–6.0 bpw+plain8/int8row/exact): Every linear layer and individual MoE expert can be stored at the exact bit-width its sensitivity warrants (t2,t2p5,t3,t3p5,t4,t5,t6, orplain8), with Hadamard rotations baked cleanly into the format. Because single-user token generation is memory-bandwidth bound — each token must stream the active weights out of VRAM — matching quality at fewer bits per weight directly increases decode speed while freeing VRAM for longer context windows and more concurrent streams. - Self-verifying, portable model folders with generic speculative drafters:
Every
.fitqfile carries per-tensor SHA-256 digests, a provenance-independentweights_sha256, a whole-header signature, and integrity checks over byte-exact copies ofconfig.json, tokenizer files, andLICENSE. Companion speculative drafters pair generically by(model_type, config_sha256), so a single standalone drafter works across every quantization size of the same base model.
FITQ's primary performance comparator is EXL3 and other FP16-output trellis quantization formats. Independent of today's early first-generation kernels, FITQ's ~5.4× lower unpack instruction count and direct INT8 output raise the format-level ceiling across prefill, high-concurrency multi-user decode, speculative verify batches, and single-user decode (calculated from published chip specs and sm_80 SASS counts):
| Hardware Class | Format Ceiling Advantage vs EXL3 / FP16 Trellis Formats |
Underlying Silicon Math |
|---|---|---|
| Desktop GPUs (NVIDIA, AMD, Intel) | 2.0× prefill, multi-user concurrency & speculative decode matrix-compute ceiling |
Direct INT8 matrix units vs FP16 trellis dequant: RTX 4090 (660 vs 330), RTX 3090 (284 vs 142), AMD Radeon AI PRO R9700 (383 vs 191), Intel Arc Pro B70 (367 vs 183.5 INT8 TOPS vs FP16 TFLOPS); 1u decode stays bandwidth-bound where tighter bits/weight cuts VRAM reads |
High-Bandwidth HBM GPUs (CMP 170HX / A100) |
1.63×–2.18× higher 3-bit single-stream decode ceiling + 2.0× prefill & multi-user decode matrix peak |
sm_80 SASS decode roofline (1.55 vs 5.83 total ops/wt): FITQ saturates 100% of HBM while EXL3 stalls on ALU at 46% (CMP 170HX, 180 W) and 62% (A100 80 GB), while high-concurrency & speculative verify batches also gain 2.0× INT8 Tensor Core headroom |
Apple Silicon (M5 Max / M5 Ultra, Metal 4) |
~2.0× prefill & multi-user decode INT8 matrix peak + full 1,228 GB/s 3-bit single-user decode headroom |
< 1 unpack op/weight stays well inside the ~4.85 lane-ops/weight ALU budget at 1,228 GB/s, where ~5+ ops/weight FP16 trellis formats hit an ALU wall |
(These are theoretical format ceilings, not measured performance on every chip — see Current Implementation Status below for which backends are hardware-tested today.)
Evaluated head-to-head against published baselines by forward KL divergence against exact BF16 references, strictly external one-shot validation (240 external documents), and live execution benchmarks:
Qwen3.8-Flash-Next(114.09 GBvsEXL3at114.19 GB— equal disk size):-15.8%lower overall forward KL across7 / 7domain types and-16.2%overall (-19.0%per-document average) across6 / 6external domains (182 / 240item wins,-38.2%fewer high-confidence token flips atp ≥ 0.90), while hitting81.10%onMBPP+,80.41%onBFCL v3(+0.59 ppover BF16), and90.66%onGPQA Diamond 64K.Inkling-2-Mini(15.90 GBvsTFQ3at16.76 GB—5.1%smaller):-26.9%lower overall forward KL across6 / 6open domains and-14.7%across6 / 6external domains (217 / 240wins,98.40%top-1 agreement), ranking #1 on bothMBPP+(75.75%) andBFCL v3(78.05).
Full benchmark receipts, model cards, and serving recipes (launching first on TensorFold) are published alongside this release — follow @Morrowmake for updates and new model drops.
Because FITQ is a brand-new format, runtime coverage is still early: most inference kernels are only lightly tuned or untested on hardware, and several hardware backends do not exist yet.
| Target / Component | Status | Notes |
|---|---|---|
FITQ Converter (fitq plan | quantize | eval | drafter | verify) |
Released & tested | Open-source Apache-2.0 Python package + multi-arch CUDA trellis encoders (sm_80+: Ampere, Ada, Hopper, Blackwell), streamed layer-by-layer conversion, multi-GPU sharding, sensitivity-aware per-expert bit allocation (--quality max), held-out KL/top-1/PPL evaluation (fitq eval), and automatic generic Hugging Face dense & MoE model support. |
Normative C99 decoder (FORMAT.md) & Python reader (reader2/) |
Tested | 19 / 19 spec vectors and 3 / 3 golden .fitq files pass (check_spec.py --plant-fault fails loudly). Correctness references only, not fast inference kernels. |
NVIDIA CUDA — Ampere (sm_80 / sm_86, e.g. CMP 170HX, RTX 3090, A100) |
Hardware-tested & tuned (early) | First-generation kernels in TensorFold; verified by contract tests, sanitizers, and live serving benchmarks, with substantial optimization headroom still ahead. |
NVIDIA CUDA — Ada / Hopper / Blackwell (sm_89 / sm_90 / sm_120) |
Compiled only (untested on hardware) | Release binaries emit SASS via the Ampere mma.sync path and should run, but have not been hardware-tested or tuned for Ada, Hopper (WGMMA/TMA), or Blackwell yet. |
Apple Silicon (Metal) |
Experimental (not yet tuned) | Metal shaders compile cleanly and earlier M4 kernel checks passed, but the backend is not yet end-to-end served or tuned. |
AMD (ROCm / RDNA 4 / CDNA), Intel (SYCL / Xe2), Vulkan, fast CPU (AVX-512 / NEON) |
Not yet implemented | No inference kernels exist yet. The format was designed so native 8-bit matrix units on these platforms can target it directly — contributions and third-party engine ports are very welcome. |
- Container: 16-byte little-endian prefix (
FITQmagic, containerversion = 1, header length), followed by a 64-byte-aligned canonical JSON header and 64-byte-aligned tensor payloads. - Six storage kinds:
packed— Hadamard-rotated trellis-coded linear matrices (t2–t6)packedrow— row-wise trellis-coded lookup tables (t2–t6, row width divisible by 32)plain8— Hadamard-rotated 8-bit linear matricesint8row— 8-bit per-row lookup tables (embeddings, n-gram tables, 2D vision projections)exact— unmodified tensors in original dtype (norms, routers, small gates)signs— packed ±1 sign vectors for input and output Hadamard rotations
- Seven trellis code types:
t2(2.0 bpw),t2p5(2.5 bpw),t3(3.0 bpw),t3p5(3.5 bpw),t4(4.0 bpw),t5(5.0 bpw), andt6(6.0 bpw) — all decoding 4INT8weights per step using only 32-bit integer arithmetic. - Model folders: A converted model is a folder holding a single
*.fitqfile (such asmodel.fitqor a publisher-named file like<Model>-FITQ-<bpw>bpw-<Publisher>.fitq) alongside verified copies ofconfig.json, tokenizer files,fitq_stats.json, andLICENSE. Folders with multiple.fitqfiles are refused cleanly.
| Path | Description |
|---|---|
fitq/ |
Open-source FITQ Python package (fitq plan, fitq quantize, fitq eval, fitq drafter, fitq verify), CUDA trellis encoders (t2–t6), two-sided input/output sensitivity statistics (H_in/H_out), sensitivity-based bit allocator, and model profiles |
docs/CONVERTING.md |
End-to-end converter guide: quality tiers, calibration text, held-out fitq eval, hardware requirements, and adding new model architectures |
CONTRIBUTING.md |
Repository map, 2-file model plugin guide (@register_family, @register_router), source-format registry, and test checklist |
pyproject.toml |
Python package metadata (pip install -e ".[cuda]") |
FORMAT.md |
Complete FITQ binary container specification, storage kinds, seven trellis code types (t2–t6), normative C99 reference decoder, and 19 test vectors |
check_spec.py |
Extracts and compiles the C99 decoder from FORMAT.md (-std=c99 -O2 -Wall -Wextra -Werror) and verifies all 19 test vectors, invariants, and fault controls |
reader2/ |
Independent Python 3 + NumPy reader written directly from FORMAT.md |
vectors/ |
Binary .fitq conformance files (rows.fitq, ends.fitq, drafter.fitq) and EXPECTED.json |
tests/ |
Spec, format, allocator, and CUDA kernel bit-exactness test suite |
LICENSE |
Apache-2.0 licence for code and scripts (Copyright 2026 Morrowmake) |
LICENSE-CC-BY-4.0 |
CC BY 4.0 licence for FORMAT.md and test vectors |
Requirements for GPU conversion: Linux with Python 3.10+, CUDA toolkit (nvcc), and an NVIDIA Ampere or newer GPU (sm_80+: RTX 30/40/50 series, CMP 170HX, A100, H100, B200). CUDA encoder kernels JIT-compile automatically on first run into ~/.cache/fitq/torch_ext.
git clone https://github.com/Morrowmake/fitq.git
cd fitq
pip install -e ".[cuda]"(For CPU-only planning, verification, and container reading without PyTorch/CUDA: pip install -e .)
# Preview a 4.0 bpw mixed-precision plan (local dir or Hugging Face repo ID)
fitq plan --model Qwen/Qwen3-8B --bpw 4.0
# Or target your exact GPU VRAM + context window (shows a context menu if --context is omitted)
fitq plan --model Qwen/Qwen3-30B-A3B --vram 24G --cards 1 --context 32k# Quick start: 4.0 bpw using the bundled offline 6-domain calibration corpus (zero flags needed)
fitq quantize --model Qwen/Qwen3-8B --bpw 4.0 --out ./Qwen3-8B-FITQ-4.0bpw
# Fit a specific VRAM budget + context length with custom calibration data
fitq quantize \
--model /path/to/My-MoE-Model \
--text ./calib.jsonl \
--vram 24G --cards 1 --context 64k \
--out ./My-MoE-FITQ
# Maximum quality on MoE or dense models: sensitivity-guided per-expert bit allocation across multiple GPUs
fitq quantize \
--model /path/to/My-MoE-Model \
--text code=./code.jsonl --text chat=./chat.jsonl \
--bpw 3.9 \
--quality max \
--gpus auto \
--out ./My-MoE-FITQ-3.9bpwKey options:
- Sizing targets (pick one):
--bpw B(average trunk bits/weight),--target-gb G(on-disk GB cap),--vram SIZE --context TOK [--cards N](GPU VRAM + KV budget), or--bits {2,2.5,3,3.5,4,5,6}(uniform width). - Calibration text (
--text, repeatable): accepts.jsonl,.jsonl.gz,.txt,.txt.gz, a directory of text files,category=file.jsonl, orhf:<dataset>[:<subset>]. If omitted, uses the bundled offline 6-domain calibration corpus (~5.8M permissive-license tokens acrosscode,tools,math,multilingual,chat, andstructuredwith automatic MoE coverage sizing); supply your own--text(or own-model replies) for specialized workloads or heavy reasoning models. - Resumable: every stage checkpoints atomically into
<out>.work; re-running the exact same command resumes where it left off and deletes<out>.workautomatically oncefitq verifypasses (pass--keep-workto retain scratch artifacts). - Supported architectures: standard Hugging Face dense and MoE CausalLM models (
llama,qwen2,qwen3,qwen3_moe,qwen3_5,mistral,mixtral,gemma,gemma2,gemma3,phi3,olmoe,deepseek_v3,inkling2_loop,glm5_next, etc.) work out of the box, alongside dedicated plugins forAmazon-FMR/Ergo(ergo: BF16 / MXFP8 / MXFP4) andDeepSeek-V4.1-Flash(deepseek_v41: FP8[32,32]+ FP4 experts, shared KV/indexer, Engram host-RAM n-gram tables, 4-stream hyper-connections — both verified on real HF headers and synthetic GPU checkpoints; full-scale checkpoint runs pending). Pass--trust-remote-codefor checkpoints with custom Hub modeling code, or seeCONTRIBUTING.mdto add a new model plugin in 1–2 files.
# Verify header signature, per-tensor SHA-256 digests, finite scales, and multi-GPU tensor-parallel alignment
fitq verify ./Qwen3-8B-FITQ-4.0bpw
# Measure forward KL divergence, top-1/top-5 agreement, and perplexity
# (omitting --text uses the bundled strictly disjoint 6-domain held-out eval set with a By Domain table;
# pass --text ./heldout.jsonl for your own benchmark)
fitq eval \
--orig Qwen/Qwen3-8B \
--quant ./Qwen3-8B-FITQ-4.0bpw \
--out ./eval_report.json
# Convert a standalone speculative drafter (pairs generically across all quant tiers of the same base model)
fitq drafter --model /path/to/DFlash2 --target ./Qwen3-8B-FITQ-4.0bpw --out ./DFlash2-FITQFor full guidance on quality tiers, calibration corpora, hardware requirements, and converting unfamiliar or newly released architectures, see docs/CONVERTING.md.
Requirements: Python 3.10+, a C99 compiler (cc), and numpy (for reader2).
python3 check_spec.py FORMAT.mdVerify that a planted 1-bit corruption fails loudly (exits non-zero):
python3 check_spec.py --plant-fault FORMAT.mdpython3 reader2/fitq_golden.py --vectors FORMAT.md
python3 reader2/fitq_golden.py --check vectors/EXPECTED.jsonInspect any .fitq file or model folder directly:
python3 reader2/fitq_read.py vectors/rows.fitq --listEverything an inference engine needs to load, verify, and decode FITQ files is self-contained in FORMAT.md:
- Parse the 16-byte prefix and canonical JSON header (
FORMAT.md§3–§4) and verifymeta.signature,meta.source_files, and per-tensor payload digests. - Implement the two small integer decoder families (
t2–t3andt3p5–t6,FORMAT.md§6) against the 19 normative C99 vectors viacheck_spec.py. - Validate end-to-end tensor reconstruction (including Hadamard unrotation,
plain8,int8row,packedrow, and generic drafter pairing) againstvectors/EXPECTED.json.
FITQ is completely engine-agnostic — nothing in the container format, header schema, or trellis decoders depends on any specific runtime. Our Day-1 serving recipes (targeting TensorFold, with early CUDA and Apple Silicon Metal kernels) are live alongside this repository, and additional engine integrations (llama.cpp, vLLM, SGLang, MLX, and others) are welcome.
- Specification (
FORMAT.md) and test vectors (vectors/): Creative Commons Attribution 4.0 International (LICENSE-CC-BY-4.0),Copyright 2026 Morrowmake. - Converter package (
fitq/code and CUDA encoders), reference C99 decoder,check_spec.py, andreader2/: Apache License 2.0 (LICENSE),Copyright 2026 Morrowmake. - Bundled default calibration and evaluation corpora (
fitq/text/default_*.jsonl.gz): Third-party open datasets under their respective upstream permissive licenses (Apache-2.0,CC-BY-4.0,ODC-BY-1.0, andMIT/BSD/ISC). Seefitq/text/NOTICE.mdfor full provenance, attribution notices, and license terms.
Developing and validating FITQ required a huge amount of GPU time across real hardware. A sincere thank you to @iotapi322, @CarlSandburg19, @blockshieldcom, @ashxhart and @MiguelCamba for generously letting us use their machines throughout development — this format genuinely would not have been possible without them.



