Archived
gemma4: a GPTQ calibration tap and recipe for the 31B's w4a8 container, whose tool calls then close their strings
Rounded to nearest, the 31B's w4a8 trunk leaves streamed tool calls inside their string arguments: after `sku:<|"|>MS-110` it prefers `**,` (58%) to the string's close (41%; bf16 ~1.0), and BetterBench's order request stalled in 10 of 20 tries. This adds what it takes to make the same container (same grid, kernels and size) with the trunk's int4 codes chosen by GPTQ against the bf16 model's own activations. - arch/gemma4: with RADIANCE_CALIB_DIR set, the plugin serving the 31B's bf16 checkpoint sums the Gram of every dense linear's bf16 input over the corpus a server is fed (gram_accum into a PERSIST [K, K] f32 buffer a tap) and writes the files at RADIANCE_CALIB_TOKENS, as arch/gemma3's tap does: q|k|v's and gate|up's input whole from rank 0, o_proj's and down's this rank's columns as `<stem>.part`, which libquant places on the diagonal. The files carry the names the w4a8 container gives the weights (gemma4_bf16's attn_qkv, attn_o, ffn_gate_up, ffn_down), so a GPTQ recipe converting that container reads them with calib=DIR. RADIANCE_G4_CALIB_LAYERS=lo:hi records a slice of layers (the 31B's taps are ~364 MiB a layer a rank at --tp 4, and 60 layers of them do not fit beside the bf16 weights). Under the tap a step runs whole and on one lane; without RADIANCE_CALIB_DIR nothing changes. - data/recipes/gemma4-31b-dense-bf16-w4a8g-df2.recipe: the -df2 recipe with `gptq codes=i4 group=128 scale=f16 rule=search calib=$CALIB` on the trunk's four linears. - docs/GEMMA4-31B-GPTQ.md: the route, the corpus, how to run it, and the measurements. Measured (1.11.0, the same tap and recipe): by GPTQ the close is 99.8% and no try stalls; KL against bf16 on the model's own turns falls from 0.341 to 0.251 (the w8a8 container 0.226), at the same speed. The convert takes 75 minutes with OpenBLAS in the image (#220; an estimated days without). A container made this way is on Hugging Face as Ashlyn4202025/gemma4-31b-w4a8-gptq-dflash2, and with the block-16 drafter as Ashlyn4202025/gemma4-31b-w4a8-gptq-dflash2-b16. Tests: engine_e2e takes the tiny Gemma 4 (shaped like the 31B) through the whole route at --tp 2: the tap's files, by name and width on each rank; rad-convert with the two shipped recipes, every trunk linear fitted and none rounded to nearest; and the GPTQ container's KL against the bf16 model on held-out documents more than three times below the round-to-nearest one's (0.0018 against 0.0105). With rank 0's and rank 1's .part blocks swapped the margin is 2.2 times, which fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
66c86b9f89
commit
d8b9ce3a32
7 files changed
+404
-3
No files matched your search
@@ -3488,6 +3488,7 @@ The four slots are what the amdgpu kernel driver leaves to user queues. It keeps
|
||||
| `RADIANCE_CALIB_DIR` | where an engine run writes calibration data for a recipe's `gptq calib=DIR` |
|
||||
| `RADIANCE_CALIB_TOKENS` | with `RADIANCE_CALIB_DIR`, the tokens the calibration tap accumulates before it writes and switches itself off (default 65536) |
|
||||
| `RADIANCE_G3_CALIB_LAYERS` | `lo:hi`: `arch/gemma3`'s calibration tap over layers lo to hi - 1 only, to take a large model's Grams in passes (docs/ARCHITECTURES.md) |
|
||||
| `RADIANCE_G4_CALIB_LAYERS` | `lo:hi`: the same for `arch/gemma4`'s tap, which takes the Gemma 4 31B's Grams from its bf16 checkpoint (docs/GEMMA4-31B-GPTQ.md) |
|
||||
| `RADIANCE_PROFILE_EVERY` | with `--profile-ops`, dump the per-op table every N steps (default 32) |
|
||||
| `RADIANCE_AQL_STAMP`, `RADIANCE_AQL_STAMP_OUT` | `N`: every dispatch of one recorded pass in N on card 0 gets a completion signal of its own, which carries its start and end; the barrier bits and chains stay as unstamped, unlike `--profile-ops`, which plays no recorded pass. One CSV line a dispatch (pass, record, queue, kernel, whether it waited for the one before, whether it was chained, start and end in ns) is appended to `RADIANCE_AQL_STAMP_OUT` (default `/tmp/radiance-stamps-<pid>.csv`) once the card is done with it; `scripts/stampgaps.py` reads it per kind of pass (idle share, gaps before ordered starts, kernels by time). AQL backend only |
|
||||
| `RADIANCE_LOG_STEPS` | log one line per step: its phase, sequences, and each one's token count and context (§4.5) |
|
||||
|
||||
Reference in new issue
Block a user