b70-optimization-lab

2026-06-30 - SYCL FlashAttention DV512/GQA8 Prefill Win

Purpose: speed up Gemma 4 26B A4B Q8 long-context prompt processing without changing target quality, quantization, cache policy, or the promoted short decode recipe.

This is a service/prefill win, not a LocalMaxxing short-decode headline.

Patch

Source worktree:

Patch artifact:

Change:

Rationale:

Build:

cd /home/steve/src/llama.cpp-gemma-record-repro-c926
source /opt/intel/oneapi/setvars.sh
cmake --build build-sycl-b70-aot-bmg-g31-q8reorder-vdr2 --target llama-server -j 8

Paired Near-32K Crossover

Case:

Commands:

# A: control on GPU0, candidate on GPU1.
LONG_CONTEXT_CASE_IDS='lc-22000-middle' \
LONG_CONTEXT_MAX_TARGET_PROMPT_TOKENS=24000 \
CANARY_REPEATS=1 MAX_TOKENS=96 BASE_PORT=18520 \
STAMP=20260630Tfattn-gqa8-controlA \
LANE_SPECS='0:2048:2048:ub2048-control' \
repro/gemma4-26b-a4b-q8-b70/run-vdr2-long-context-service-gate.sh

GGML_SYCL_FATTN_DV512_GQA_NCOLS2=8 \
LONG_CONTEXT_CASE_IDS='lc-22000-middle' \
LONG_CONTEXT_MAX_TARGET_PROMPT_TOKENS=24000 \
CANARY_REPEATS=1 MAX_TOKENS=96 BASE_PORT=18520 \
STAMP=20260630Tfattn-gqa8-candidateA \
LANE_SPECS='1:2048:2048:ub2048-gqa8' \
repro/gemma4-26b-a4b-q8-b70/run-vdr2-long-context-service-gate.sh

# B: crossover, candidate on GPU0, control on GPU1.
GGML_SYCL_FATTN_DV512_GQA_NCOLS2=8 \
LONG_CONTEXT_CASE_IDS='lc-22000-middle' \
LONG_CONTEXT_MAX_TARGET_PROMPT_TOKENS=24000 \
CANARY_REPEATS=1 MAX_TOKENS=96 BASE_PORT=18520 \
STAMP=20260630Tfattn-gqa8-candidateB \
LANE_SPECS='0:2048:2048:ub2048-gqa8-xover' \
repro/gemma4-26b-a4b-q8-b70/run-vdr2-long-context-service-gate.sh

LONG_CONTEXT_CASE_IDS='lc-22000-middle' \
LONG_CONTEXT_MAX_TARGET_PROMPT_TOKENS=24000 \
CANARY_REPEATS=1 MAX_TOKENS=96 BASE_PORT=18520 \
STAMP=20260630Tfattn-gqa8-controlB \
LANE_SPECS='1:2048:2048:ub2048-control-xover' \
repro/gemma4-26b-a4b-q8-b70/run-vdr2-long-context-service-gate.sh

Results:

Lane GPU Prefill tok/s Decode tok/s TTFT s Gate
controlA 0 706.901 68.245 43.005 pass
candidateA 1 939.976 113.140 32.341 pass
candidateB 0 955.203 113.471 31.826 pass
controlB 1 698.310 68.269 43.534 pass

Readout:

Artifacts:

Broad Long-Context Service Gate

Command:

GGML_SYCL_FATTN_DV512_GQA_NCOLS2=8 \
STAMP=20260630Tfattn-gqa8-broadA \
LONG_CONTEXT_CASE_IDS='lc-12288-early lc-16384-late lc-22000-middle' \
LONG_CONTEXT_MAX_TARGET_PROMPT_TOKENS=24000 \
LANE_SPECS='0:1024:1024:ub1024-gqa8 1:2048:2048:ub2048-gqa8 2:2304:2304:ub2304-gqa8 3:2560:2560:ub2560-gqa8' \
CANARY_REPEATS=2 MAX_TOKENS=96 BASE_PORT=18520 \
repro/gemma4-26b-a4b-q8-b70/run-vdr2-long-context-service-gate.sh

Cases:

All lanes passed:

Summary:

Config Median prefill tok/s Median decode tok/s 30400-token prefill tok/s Decision
UB1024 969.770 125.358 892.338 best decode balance
UB2048 1039.603 119.083 950.010 balanced service candidate
UB2304 1075.983 116.999 964.759 best pure prefill
UB2560 1066.029 116.496 963.876 tie-ish with UB2304, lower median

Artifact:

Short-Decode Guards

The patch is not a short-decode record. It must not replace the promoted 123.67689864739785 tok/s LocalMaxxing recipe.

Mixed short guard:

GGML_SYCL_FATTN_DV512_GQA_NCOLS2=8 \
STAMP=20260630Tfattn-gqa8-shortguardA \
LANE_SPECS='0:1024:1024:ub1024-gqa8-a 1:1024:1024:ub1024-gqa8-b 2:2048:2048:ub2048-gqa8 3:2304:2304:ub2304-gqa8' \
CANARY_REPEATS=32 MAX_TOKENS=512 BASE_PORT=18540 \
repro/gemma4-26b-a4b-q8-b70/run-vdr2-short-decode-guard.sh

Result:

Focused UB1024 A/B:

# Control lanes.
STAMP=20260630Tfattn-gqa8-short-controlB \
LANE_SPECS='0:1024:1024:ub1024-control-a 1:1024:1024:ub1024-control-b' \
CANARY_REPEATS=32 MAX_TOKENS=512 BASE_PORT=18540 \
repro/gemma4-26b-a4b-q8-b70/run-vdr2-short-decode-guard.sh

# Candidate lanes.
GGML_SYCL_FATTN_DV512_GQA_NCOLS2=8 \
STAMP=20260630Tfattn-gqa8-short-candidateB \
LANE_SPECS='2:1024:1024:ub1024-gqa8-a 3:1024:1024:ub1024-gqa8-b' \
CANARY_REPEATS=32 MAX_TOKENS=512 BASE_PORT=18540 \
repro/gemma4-26b-a4b-q8-b70/run-vdr2-short-decode-guard.sh

Result:

Readout:

Decision

Promote the source patch and GGML_SYCL_FATTN_DV512_GQA_NCOLS2=8 as a validated Gemma 4 Q8 service/prefill optimization.

Do not submit it as a short-decode LocalMaxxing record:

Next useful work: