transformers
a69c5cba - feat(inkling2): give attention the bias of each distance on request

Commit
15 hours ago
feat(inkling2): give attention the bias of each distance on request Without `relative_distance`, the relative position bias module returns the bias of each backward distance, `[batch, heads, q_len, rel_extent]`, and the attention function applies it itself. A runtime with its own KV layout (e.g. a paged cache) can then skip the element-wise gather over `[batch, heads, q_len, kv_len]`, which takes most of a prefill step on TPU. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
References
Author
Parents
Loading