vllm.models.inkling2.nvidia.ops.attn_res
¶
Block attention residual: softmax-weighted mix of residual stream blocks.
For each token, sources x_n (stored blocks, then the partial block plus an
optional addend, all in fp32) are scored as (q . x_n) * rsqrt(mean(x_n^2) +
eps) per pseudo-query q; the output is sum_n softmax_n * x_n, with
x_n RMS-normalized when normalize_values is set. The fp32 mix then
goes through the following sublayer's RMSNorm in the same kernel, or is
returned as is (fp32) without a norm weight.
Functions:
-
attn_res–Mix
[*stack, last (+ addend)]with each pseudo-query.
attn_res(stack, last, addend, queries, norm_weight, norm_eps, normalize_values, eps=1e-06)
¶
Mix [*stack, last (+ addend)] with each pseudo-query.
queries are fp32 (Q, D), already scaled by D**-0.5; each fp32
mix is RMS-normalized with its row of norm_weight (Q, D). Returns
(Q, T, D) in last.dtype, or the fp32 mixes without norm_weight.