b70-optimization-lab

Gemma 4 26B Q8: KQ Register/Broadcast Pre-Softmax Barrier Skip

Date: 2026-07-02

Summary

This experiment tested whether the promoted global FlashAttention KQ register/broadcast path still paid an avoidable local-memory barrier before softmax. The candidate added a second default-off flag:

GGML_SYCL_FATTN_DV512_GQA8_KQ_REG_BCAST=1
GGML_SYCL_FATTN_DV512_GQA8_KQ_REG_BCAST_SKIP_PRESOFTMAX_BARRIER=1

The hypothesis was that, in the KQ register/broadcast specialization, the np == 1 pre-softmax item_ct1.barrier(local_space) may no longer be needed because KQ values are retained in lane-local registers and later read via subgroup selection instead of the old shared KQ scratch handoff.

Result: no win / noise. The patch built and passed validation, but the balanced four-wave A/B + crossover measured only +0.031% mean prefill delta and +0.169% median prefill delta, with wave signs alternating negative and positive. The active source was reverted to the promoted KQ register/broadcast path without the barrier-skip variant.

Source Artifacts

Patch snapshots:

Build result:

Validation

Smoke:

Full A/B + crossover:

Aggregates:

By GPU prefill deltas:

By wave prefill deltas:

The wave alternation shows the apparent aggregate gain is normal run variance, not a structural improvement.

Decision

Decision: closed negative / no-win noise.

Do not promote GGML_SYCL_FATTN_DV512_GQA8_KQ_REG_BCAST_SKIP_PRESOFTMAX_BARRIER. The source was reverted to keep only the promoted GGML_SYCL_FATTN_DV512_GQA8_KQ_REG_BCAST path and rebuilt successfully. Reopen only if a future KQ register/broadcast design removes more shared-memory state or a profiler shows this exact barrier as a measurable stall.

This is a service/prefill diagnostic result only. It is not a LocalMaxxing headline decode result.