b70-optimization-lab

Gemma 4 26B Q8: Record-Stack Node Profile Hotspots

Date: 2026-07-02

Purpose

Refresh the profiler view on the current Gemma 4 26B A4B Q8 record stack after the recent closed verifier and service lanes. The goal was to identify the next non-roulette code target for short-context decode without changing the promoted quality lane.

This is a diagnostic-only run. It passed the fixed cold gate, but GGML_SYCL_NODE_PROFILE=1 disables SYCL graph execution in the runtime and the run used MAX_TOKENS=128, so its throughput must not be submitted or treated as a headline result.

Command

cd /home/steve/llm-optimizations
GPU_INDEX=0 PORT=19110 \
LABEL=gemma4-q8-gpu0-recordstack-profile128-20260702T113037Z \
CTX_SIZE=32768 FLASH_ATTN=on GGML_SYCL_ENABLE_VMM=1 \
BATCH_SIZE=1024 UBATCH_SIZE=1024 \
MAX_TOKENS=128 CANARY_REPEATS=4 \
REALISTIC_GATE=1 REALISTIC_METRIC_TOKENS=100 READINESS_TIMEOUT_S=900 \
LLAMA_MTP_DRAFT_PROFILE=1 LLAMA_SERVER_SPEC_PROFILE=1 \
LLAMA_SPEC_VERIFY_SYNC_PROFILE=1 \
GGML_SYCL_NODE_PROFILE=1 GGML_SYCL_NODE_PROFILE_EVERY=100 \
GGML_SYCL_NODE_PROFILE_DETAIL=1 \
repro/gemma4-26b-a4b-q8-b70/run-vdr2-selecteddown-record.sh

Evidence:

Validity

Diagnostic caveat:

Metrics

Primary metric, generated tokens 1-100 after TTFT:

Full generated output after TTFT:

Wall-clock full-output throughput:

TTFT:

Decision: diagnostic only / no record. The current valid record remains 124.97714084813418 tok/s from data/gemma4-q8-gpu0-finalpostnorm-reproexact-full512-20260701T084728Z/summary.json.

Node Profile Hotspots

Final cumulative node-profile block:

Rank Total ms Calls Avg ms Node
1 817.753 591 1.384 MUL_MAT:node_1715
2 372.032 647 0.575 MUL_MAT_ID:ffn_moe_gate_up-29
3 240.491 584 0.412 MUL_MAT_ARGMAX:mtp_direct_argmax_unroll_token_0
4 238.944 584 0.409 MUL_MAT_ARGMAX:mtp_direct_argmax_unroll_token_1
5 238.825 584 0.409 MUL_MAT_ARGMAX:mtp_direct_argmax_unroll_token_2
6 214.562 647 0.332 MUL_MAT_ID:ffn_moe_gate_up-0
7 210.405 647 0.325 MUL_MAT_ID:ffn_moe_gate_up-1
8 206.061 647 0.318 MUL_MAT_ID:ffn_moe_gate_up-2
9 205.184 647 0.317 MUL_MAT_ID:ffn_moe_gate_up-27
10 202.647 647 0.313 MUL_MAT_ID:ffn_moe_gate_up-7

The top MUL_MAT:node_1715 detail line identifies the target/verifier full-vocabulary LM head:

Q8_0 token_embd.weight [2816,262144] x GET_ROWS:result_norm

The three separate draft nodes are MTP draft direct-argmax LM-head work for the unrolled draft positions. Log detail shows these use q6_K output weights:

src0{NONE:token_embd.weight type=q6_K ne=[1024,262144,1,1]}
src1{MUL:result_norm type=f32 ne=[1024,1,1,1]}

Together they are roughly the same profile scale as the target verifier LM-head node in this diagnostic mode.

Server / MTP Profile

Final cumulative profile lines:

Interpretation:

Next Credible Lanes

  1. Draft argmax batching/fusion is not a simple win. Source audit after the profile found the backend already supports multi-column MUL_MAT_ARGMAX, but these three unrolled draft heads are autoregressive: token 0 feeds draft step 1, and token 1 feeds draft step 2. They cannot be represented as one independent multi-column argmax without changing the draft algorithm. Existing MUL_MAT_ARGMAX tile/reorder/ multi-reuse knobs also have prior negative coverage. A current-record full512 A/B of LLAMA_SYCL_MUL_MAT_ARGMAX_TILE_SUBGROUPS=16 on the draft path passed all gates but did not win (paired median-ratio CI -2.594% / +0.001% / +4.021%). Future draft-side work should target a new single-node q6_K argmax kernel design or a different draft algorithm, not a naive batch of mtp_direct_argmax_unroll_token_0/1/2 or another tile-subgroup retest. Evidence: 20260702-argmaxtile16-draft-q6k-no-win.md.

  2. Exact verifier LM-head reduction, only if non-serial. The target/verifier LM-head is still rank 1, but prior audits show a simple row-by-row accept-prefix design loses badly. Reopen only for a true backend row-adaptive op or a mathematically sound candidate-bound certificate that avoids full-vocab work while preserving exact target verification and the full-match bonus row.

  3. MoE gate-up only with a new structural idea. Many ffn_moe_gate_up-* nodes remain hot, but previous MoE selected-down, gate-up, rowpack, grouped, and epilogue attempts already closed most easy variants. Do not reopen MoE config roulette without a concrete source-level design.

No LocalMaxxing submission was made from this run.