The WebGPU execution provider implements version 1 ofcom.microsoft.SparseAttentionIndexer for the qsa and csa policies. It uses
the provider-neutral schema and state ABI described in the
operator documentation.
qsa and csa policy modes;float32 and float16;BF16, packed/variable-length inputs, and fixed-capacity caches usingpast_sequence_length are not supported by the WebGPU kernel. Unknown policies
and policy-incompatible inputs or attributes are rejected.
State concatenation, visible-token grouping, QSA pooling, CSA overlap
compression, query/key RMS normalization, rotary embedding, scoring, selection, and
output padding execute in WGSL. The implementation does not map GPU buffers,
read selected values back to the host, or retain state in the kernel object.
All reductions and softmax calculations accumulate in FP32, including for
FP16 inputs.
The rank-3 query projection is logically reshaped into heads inside the shader. Query and key
projections therefore both connect directly to the operator; their consecutive norm-weight inputs
are applied internally before rotary embedding.
The implementation uses one independently writable workgroup per query or
completed CSA window. For QSA, each workgroup caches visible token positions
and candidate scores, and reuses query/key RMS normalization within a score.
The caches cover up to 3,072 visible tokens and 768 candidate blocks within
WebGPU's guaranteed 16 KiB of workgroup storage. Beyond either bound, the
corresponding lookup falls back to visibility scans or score recomputation,
preserving exact TopK ordering without host readback.
DynamicSparseAttention and SparsePagedAttention;