Views
No views yet
| Property | Value |
|---|---|
| Base Model | google/gemma-4-12b-it |
| Quantization Method | RTN (round-to-nearest) |
| Format | float-quantized (FP8) |
| Weight Strategy | channel (per-channel) |
| Activation Strategy | token (per-token, dynamic) |
| Weight Bits | 8 (FP8 E4M3) |
| Model Size | ~15 GB |
| Calibration Data | None (data-free) |
| Variant | GSM8K (flexible) | GSM8K (strict) |
|---|---|---|
| Baseline (BF16) | 87.57% | 86.58% |
| FP8 Dynamic | 87.95% | 86.96% |
| Delta | +0.38% | +0.38% |
FP8 Dynamic quantization shows no accuracy loss on GSM8K — the delta is within noise (stderr ~0.9%).
1from transformers import AutoModelForImageTextToText, AutoProcessor
2from llmcompressor import oneshot
3from llmcompressor.modifiers.quantization import QuantizationModifier
4
5MODEL_ID = "google/gemma-4-12b-it"
6model = AutoModelForImageTextToText.from_pretrained(MODEL_ID, dtype="auto")
7
8recipe = QuantizationModifier(
9 targets="Linear",
10 scheme="FP8_DYNAMIC",
11 ignore=[
12 "lm_head",
13 "re:.*embed_vision.*",
14 "re:.*embed_audio.*",
15 "re:.*vision_embedder.*",
16 ],
17)
18
19oneshot(model=model, recipe=recipe)
20model.save_pretrained("gemma-4-12b-it-FP8-Dynamic", save_compressed=True)1pip install vllm
2vllm serve soyrsoyr/gemma-4-12b-it-FP8-Dynamic --max-model-len 4096 --tensor-parallel-size 21from openai import OpenAI
2
3client = OpenAI(base_url="http://localhost:8000/v1", api_key="unused")
4response = client.chat.completions.create(
5 model="soyrsoyr/gemma-4-12b-it-FP8-Dynamic",
6 messages=[{"role": "user", "content": "Explain quantization in one sentence."}],
7 max_tokens=128,
8)
9print(response.choices[0].message.content)1containers:
2 - name: vllm
3 image: vllm/vllm-openai:latest
4 args:
5 - --model
6 - soyrsoyr/gemma-4-12b-it-FP8-Dynamic
7 - --max-model-len
8 - "4096"
9 - --tensor-parallel-size
10 - "2"
11 resources:
12 limits:
13 nvidia.com/gpu: "2"