Downloads · 30 days
24
12% of all-time downloads
rajasingh012/gemma-4-12b-it-quark-w8a8-int8
gemma-4-12b-it-quark-w8a8-int8 is a image-text-to-text model from rajasingh012. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as apache-2.0.
W8A8 INT8 quantized version of google/gemma-4-12b-it using AMD Quark, produced as part of the RetailConcierge AMD AI DevMaster 2026 submission.
Downloads · 30 days
24
12% of all-time downloads
All-time downloads
203
Public
Parameters
12B
13.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors13 GB · 100%
How the weights are stored.
I810.9B · 91%
From the Hugging Face model README
W8A8 INT8 quantized version of google/gemma-4-12b-it using AMD Quark, produced as part of the RetailConcierge AMD AI DevMaster 2026 submission.
| Base Model | google/gemma-4-12b-it |
| Architecture | Gemma4UnifiedForConditionalGeneration (multimodal: text + vision + audio) |
| Parameters | 12 B text decoder (quantized) + vision/audio embedders kept in BF16 |
| Quantization | W8A8 INT8 (per-channel weight + per-token dynamic activation) |
| Quantizer | AMD Quark 0.12.post1 |
| Model Size | ~13 GB (safetensors shards) |
| Original Size | ~23.9 GB (BF16) |
| Compression | ~1.8× size reduction |
| Component | dtype | Granularity | Mode |
|---|---|---|---|
| Weight | INT8 | per-channel (ch_axis=0) | symmetric, static |
| Activation | INT8 | per-token (ch_axis=1) | symmetric, dynamic |
model.vision_embedder.* | BF16 | — | unquantized (multimodal preserved) |
model.embed_vision.embedding_projection | BF16 | — | unquantized |
model.embed_audio.embedding_projection | BF16 | — | unquantized (12B Unified audio modality) |
lm_head (tied) | BF16 | — | unquantized via embed_tokens tie |
# Start the server (single AMD MI300X is enough)
vllm serve rajasingh012/gemma-4-12b-it-quark-w8a8-int8 \
--tensor-parallel-size 1 \
--max-model-len 32768 \
--gpu-memory-utilization 0.9 \
--quantization quark \
--trust-remote-code \
--enable-prefix-caching \
--enable-chunked-prefill
# Chat completion
curl http://localhost:8000/v1/chat/completions -H "Content-Type: application/json" -d '{
"model": "rajasingh012/gemma-4-12b-it-quark-w8a8-int8",
"messages": [{"role": "user", "content": "Recommend a pair of wireless earbuds under 5000 rupees."}],
"max_tokens": 512,
"temperature": 0.7
}'
Requires vLLM >= 0.26 (the --quantization quark loader). Tested on vLLM 0.26.0+rocm723 (AMD ROCm wheel) with --tool-call-parser gemma4.
This model was quantized using AMD Quark's per-token per-channel INT8 scheme (W8A8):
model.vision_embedder.*, model.embed_vision.embedding_projection, model.embed_audio.embedding_projection (vision/audio modalities preserved in BF16). lm_head shares storage with embed_tokens (tie_word_embeddings: True).export_safetensors.gemma4_unified loader does not map (embed_vision.multimodal_embedder.*, embed_vision.patch_*). The fixup renames them to the expected layout and copies chat_template.jinja into the output (vLLM 400s chat requests without it). The fixup is automated in the RetailConcierge repo (scripts/_quark_fix_vllm_keys.py) and is required for any Gemma 4 Unified checkpoint.Full reproducible recipe in the RetailConcierge repo, scripts/ folder:
# On the AMD GPU droplet (see scripts/README.md for full lifecycle)
bash /root/quantize_int8.sh --model google/gemma-4-12b-it
The script handles: preflight (Quark version, transformers >= 5.10.1 for Gemma4UnifiedForConditionalGeneration, BF16 source location), the Quark W8A8 quantize, the post-export key fixup, and output verification. Recipe provenance: nameistoken/Gemma-4-31B-it-Quark-W8A8-INT8 (−0.08pp GSM8K on the 31B dense class); the 12B Unified run is a fresh quantization of the same scheme.
Caveat: the −0.08pp GSM8K figure published on the 31B dense baseline was measured on the older Gemma4ForConditionalGeneration class. The 12B Unified class uses a different multimodal embedding layout; accuracy for this checkpoint is validated via the RetailConcierge tool-call accuracy gate (extract_brief → search_catalog → finalize_recommendations pass rate vs BF16), not yet via GSM8K. Treat as a fresh quantization until independently benchmarked.
If you use this model, please cite the original Gemma 4 release:
@misc{google2026gemma4,
title = {Gemma 4},
author = {Google DeepMind},
year = {2026},
url = {https://huggingface.co/google/gemma-4-12b-it}
}
This model is released under the Apache License 2.0, following the Gemma 4 license under which the upstream google/gemma-4-12b-it weights are distributed by Google DeepMind.
This is a quantized derivative of google/gemma-4-12b-it. Per Apache 2.0 §4:
model.safetensors and the appended quantization_config block in config.json) carry this notice as part of the model card.NOTICE).LICENSE.Original weights © Google DeepMind. Quantization performed by the model author; no warranty of any kind is provided (see LICENSE §7–8).