Skip to content

ggml: indexed bias F16 table + offset; inkling2: no padded bias table - #136

Merged
rafasmour merged 1 commit into
masterfrom
inkling/upstream-opt
Nov 22, 2026
Merged

rafasmour merged 1 commit into
masterfrom
inkling/upstream-opt

Conversation

@rafasmour

Copy link
Copy Markdown
Owner

Follow-up to #135.

  • ggml (backward compatible extension of ggml: compact bias on the existing FLASH_ATTN_EXT ggml-org/llama.cpp#32740): the indexed bias table may be F16; ggml_flash_attn_ext_add_indexed_bias_offset(a, offset, scale) adds scale*offset[head, query] to the bias of every key, and with an offset the index n_bins selects no table entry. CPU reference and CUDA/HIP vec + tile kernels; other backends keep rejecting the indexed bias
  • inkling2: the per-query sink logits are passed as the offset (scale -1), so the bias table is no longer padded with a zero bucket and the sink is no longer subtracted from it (24 pad + 48 sub kernels per token); prompt batches use an F16 table. The dense fallback rebuilds the padded table itself
  • test-backend-ops: indexed bias cases with an F16 table, an offset, kv_rows and q8_0 K/V

RX 7900 XT, Inkling-2-Mini UD-Q3_K_XL: tg128 47.0 -> 47.9 t/s, decode kernels per token 3173 -> 3111 (no pad kernels). KL vs the build before #132: 0.0023 (noise floor 0.0023), -nkvo fallback 0.0025. FLASH_ATTN_EXT 4586/4586 on ROCm0 vs CPU. Peak VRAM at long context is unchanged: it is set by the mask and index inputs, not by the table.

Assisted-by: Claude Opus 5.5

…: sink logits as the offset, no padded table

Assisted-by: Claude Opus 5.5
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