Skip to content

inkling2 : indexed bias prototype - #35

Draft
sanmai wants to merge 5 commits into
masterfrom
feat/fa-indexed-bias
Draft

sanmai wants to merge 5 commits into
masterfrom
feat/fa-indexed-bias

Conversation

@sanmai

@sanmai sanmai commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Overview

LLAMA_FA_REL_BIAS_DISABLE=1 switches back to the dense-mask path for comparison

Additional information

CUDA0 compute MiB / warm pp t/s / warm tg t/s

ctx ub chunks fa-indexed-bias
10240 512 21050 / 453.4 / 52.52 22000 / 488.5 / 56.23
10240 1024 19675 / 720.5 / 49.79 21625 / 861.9 / 55.04
10240 2048 19825 / 946.2 / 49.82 21150 / 1265.4 / 54.48
10240 4096 15825 / 953.3 / 44.13 20000 / 1657.1 / 52.39
10240 8192 3200 / 765.0 / 20.91 17650 / 1853.4 / 49.94
32768 512 21400 / 433.7 / 51.04 21475 / 507.7 / 58.36

Cache-size-normalized:

ctx ub MoE cache MiB master fa-indexed-bias
10240 512 21050 (master 20950) 7770 / 454.0 / 54.48 6810 / 489.4 / 55.26
10240 1024 19675 8993 / 730.2 / 52.41 6976 / 858.6 / 53.71
10240 2048 17075 11359 / 939.3 / 47.47 7327 / 1278.1 / 49.44
10240 4096 11950 16134 / 947.5 / 39.95 8086 / 1623.4 / 40.31
10240 8192 1625 25793 / 762.6 / 18.75 9664 / 1733.2 / 19.19
32768 512 18550 9948 / 452.5 / 51.14 7010 / 487.8 / 52.52

Requirements

…nels

The bias is gathered from global memory at the point where the mask is added, and
scaled with the mask. The tile kernel, the sparse MMA path and non-NVIDIA devices
reject the op when the bias is set.
The reference implementation is in place, but the device rejected the op, so
test-backend-ops skipped all the indexed-bias cases. The spacemit FA path
leaves the op to the generic CPU path.
…e indexed bias

The model passes the bias table, flash attention gathers it, the dense KQ mask per
head is gone. A fused-op probe checks the device support, LLAMA_FA_REL_BIAS_DISABLE=1
selects the dense mask.
build_attn_mha expands the flash attention node before the indexed bias is set,
so the table and the indices were never computed or uploaded.
@sanmai sanmai changed the title inkling2 : indexed bias inkling2 : indexed bias prototype Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant