Selection has explicit conditions

The final diff introduces a GCN eligibility function. It requires a mask of the expected shape and a positive n_kv_max value, while rejecting certain bias and additional-input combinations. The sparse path is not selected when the chosen positions exceed one quarter of the KV length. Further conditions depend on attention-head dimensions, context length and, for some shapes, the GQA ratio. Updating the binary therefore does not establish that a particular request actually used the new kernel.

How the implementation is organized

The tiled kernel gains a use_sparse parameter. Key and value loading and mask application use selected-row lists, with the effective list length read separately. New kernel variants are restricted to GCN, and dispatch retains the dense path for ineligible configurations. Added tests cover long contexts, several head dimensions and independent masks for multiple query tokens. The code does not announce automatic extension of this path to CUDA, WebGPU or every other HIP architecture.

Reading the contributor benchmarks

The author provides both kernel microbenchmarks and complete llama-bench runs. For micro-qwen4exp Q4_K_M, pp32768 prompt processing rose from 10,696.5 to 14,837.2 tokens per second, a 38.7% improvement, while tg1024 changed by only 0.8%. RalphSeek V4 Flash IQ4_NL showed 3.9% in pp65536 and 0.1% in tg512. These are contributor-reported results for particular workloads. Much larger percentages in isolated kernel tables should not be carried over to total inference or presented as independent newsroom measurements.

Implications for local evaluation

Our interpretation is that the new path matters when a long-context workload and its attention layout permit substantial KV work to be skipped. A useful reproduction should preserve the model, quantization, context length, backend and kernel-selection conditions together. The published change establishes neither a universal VRAM minimum nor a new ROCm release. It is also distinct from the HIP/VMM hang correction in b12849: that patch fixed variable shadowing in an error-checking macro, whereas this one changes attention execution and dispatch.