perf(gemma4): drop FP8 prefill carve-out (re-measured neutral / long-ctx +7%)#187
Merged
Merged
Conversation
…x win) Removes the auto-disable at engine.cpp:832-844. The 2026-05-09 measurement showing -5..-19% prefill on Gemma-4 (vs FP16) was real at the time but substantially closed by intermediate prefill work (PR #177 device-side ptr-array, PR #181 WMMA cp.async, etc.). Re-measured 2026-05-15 on Gemma-4-26B-A4B-it-Q4_K_M (5 reps, --bench-pp <N> --temperature 0): | pp | FP8 OFF tok/s | FP8 ON tok/s | delta | |-------|---------------|--------------|--------| | 128 | 870 | 879 | +1.0 % | | 512 | 1732 | 1717 | -0.9 % | | 833 | 1649 | 1579 | -4.2 % | | 2048 | 1624 | 1742 | +7.3 % | Net effect is neutral with a long-context advantage. FP8 prefill also halves the activation cache size, which is a real VRAM win at long ctx. Coherence: chat-template gemma + "What is the capital of France?" → "**Paris**." (bit-exact between FP8 and FP16 paths). make verify-fast: green (post-variance re-run — first run regressed on Qwen3-8B baseline, gone on retry; the change is gated `if GEMMA4` so non-Gemma-4 archs are untouched). Closes the last entry in the "Gemma-4 remaining carve-outs" roadmap section (FP8 KV cache, NVFP4 Q*_K decode, FP8 prefill all removed). Users wanting max prefill at medium pp can opt out via [attention] fp8_prefill = "never". Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes the last entry in the "Gemma-4 remaining carve-outs" roadmap section. 6 lines deleted from
src/runtime/engine.cpp:832-844.The 2026-05-09 measurement showing -5..-19 % prefill on Gemma-4 vs FP16 was real at the time but substantially closed by intermediate prefill work (PR #177 device-side ptr-array, PR #181 WMMA cp.async pipeline). Re-measured 2026-05-15 on Gemma-4-26B-A4B-it-Q4_K_M (5 reps,
--temperature 0):Net effect is neutral with a long-context advantage. FP8 prefill also halves the activation cache footprint, which is a real VRAM win at long context.
Test plan
chat-template gemma+What is the capital of France?→**Paris**.(bit-exact between FP8 and FP16 paths).--prefill-chunk-size 512) → coherent summary at 633 tok/s prefill / 160 tok/s decode.test-attention77/77 pass.test-kv34/34 pass.make verify-fastgreen (post-variance re-run — first run regressed on Qwen3-8B baseline due to cuBLAS algo jitter, gone on retry; the change is gatedif GEMMA4so non-Gemma-4 archs are untouched).Opt-out
Users who want max prefill at medium pp (where FP8 is 4 % slower) can disable it via
imp.conf:Gemma-4 chapter closure
This PR removes the last Gemma-4 carve-out. The roadmap "Gemma-4 remaining carve-outs" section now consolidates the three-step history:
Remaining Gemma-4 issues are documented separately (Q4_K_M code-gen drift on complex code prompts — use Q5_K_M / Q8_0).
🤖 Generated with Claude Code