You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR #367 review fixes (no bias-math behavior change):
MAJOR (doc accuracy + test): the cross-repo invariant is
nonpad == write_indices + valid_token_count (UNPADDED query-token count),
which equals write + S_q only when the chunk is unpadded (S_q is the
PADDED chunk width). With intra-prompt padding + a sliding window,
pad-token query rows can become fully masked.
- create_static_cache_attention_bias docstring + the _apply_attention
comment now state the CONDITIONAL invariant.
- The 'CPU MEA returns a finite mean-of-V row, not NaN' claim is anchored
to the empirically verified ORT 1.27 behavior (S_q=8, nonpad=3,
window=4: rows 6-7 fully masked, stayed finite) rather than asserted as
a permanent op-spec invariant.
- Add test_fully_masked_row_stays_finite, which proves (via an
independent numpy mask) that rows 6-7 are fully masked and asserts the
CPU MEA output stays finite — the prior parity tests assert idx.size>0
and never reach this boundary.
MINOR: _maybe_static_cache_bias no longer returns None when input_ids is
None. It derives S_q from an always-present tensor (hidden_states), so
inputs_embeds-driven forwards still receive the bias.
NITS:
- StaticCacheState docstring uses max_seq_len (was max_seq); the is_causal
Note in _apply_attention is scoped to the DYNAMIC path (static mode
ignores the incoming is_causal).
- Guard the max_seq_len cast in _maybe_static_cache_bias: a symbolic
key_cache KV dim now raises a descriptive TypeError naming the symbolic
dim instead of an opaque int() failure.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: titaiwang <titaiwang@microsoft.com>
0 commit comments