Downloads · 30 days
0
toxzak/fabq-rc-gemma4-12b
fabq-rc-gemma4-12b is a other model from toxzak. Use it for the other task on the model card, and read the license before you ship it in a product. It is set up for fabq-rc. The card lists the license as apache-2.0.
This folder contains the FABQ-RC quantization pipeline for Gemma 4 12B-it.
Downloads · 30 days
0
Access
Public
Updated Jun 9, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.py114 KB · 44%
From the Hugging Face model README
This folder contains the FABQ-RC quantization pipeline for Gemma 4 12B-it.
It includes two variants:
Text quantization notebook (FABQ-RC-Gemma4-12B.ipynb) — quantizes
the model, reports bpw, runs perplexity. Uses the standard
"reconstruct FP16 then matmul" path. Good for ablation studies.
Streaming + native-quantized inference (streaming/) — runs the
model where the forward pass operates directly on the compressed
FABQ-RC buffers, never materializing the FP16 weight matrix. Peak
inference VRAM is ~2.2 GB (vs 24 GB for BF16).
The base notebook was adapted from:
latest notebooks/Main_FABQ_RC_Notebook.ipynb — the Qwen3.6-27B baselinenotebooks/build_v4_flash_notebook.py — the cleaner script-style
structure used to build the DeepSeek V4-Flash notebookOpen FABQ-RC-Gemma4-12B.ipynb in Colab (A100 80GB) and run all cells.
The notebook is self-contained.
This is the variant where the forward pass reads the compressed FABQ-RC buffers directly. It needs a working CUDA toolchain.
# 1. Build the bucket (one-time, ~30-45 min on A100)
cd streaming
python build_bucket.py --source google/gemma-4-12B-it --push
# 2. Run the streaming notebook
jupyter notebook FABQ-RC-Gemma4-12B-Streaming.ipynb
The notebook is self-contained: it builds the CUDA extension in-cell
on first run, then streams the pre-quantized shards from
toxzak/gemma-4-12B-it-fabq-rc-bucket.
tie_word_embeddings: true): 262144 × 3840 =
~1B params, ~2 GB in BF16. We skip the embedding in the linear sweep
and keep it in BF16 for the output logits.gemma4-12b/
├── FABQ-RC-Gemma4-12B.ipynb # text-only quantization (variant 1)
├── build_notebook.py
├── README.md
├── MODEL_CARD.md
├── FABQ_RC_GGUF_SPEC.md
└── streaming/ # native-quantized inference (variant 2)
├── fabq_rc_cuda/ # C++/CUDA extension
├── build_bucket.py # one-time bucket build
├── build_streaming_notebook.py
├── FABQ-RC-Gemma4-12B-Streaming.ipynb
└── STREAMING.md # design doc
The text notebook is the "research" path: standard FP16 reconstruction, easy to ablate, easy to compare to other quant methods.
The streaming variant is the "production" path: peak inference memory is the compressed size (~2.2 GB vs 24 GB), no FP16 weight ever lives in VRAM during inference, ready to plug into an edge deployment or a small-GPU serving setup.
Both share the same underlying FABQ-RC quantization pipeline and the same on-disk format.
Apache 2.0