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
Address review findings on the PosEncoding redesign
Follow-up to b192865, from an adversarial review of that commit.
- attend_most_recent_matching(exclude_self=True): drop the stale
len(value)/len(key_vector) <= d_pos asserts. The pre-shift uses
attend_to_offset, whose V/O auto-splits across heads, so the only real
bound (d_head >= W+1 for the head's Q/K) is already enforced by the
compiler. The old asserts rejected valid wide inputs.
- get_prev_value: rewrite the numerical-limit docstring. The max_pos
bound is exact logit ordering — a recent false key outscores an early
true once the runtime position exceeds ~2*max_pos ({0,1} cond) or
~4*max_pos ({-1,+1}) — NOT TF32 precision; the prior "needs fp32" note
was wrong. Also document the cond conventions and the all-false window.
- attend_argmin/argmax/argmin_where: drop stale "len(value) <= d_pos"
docstrings (wide V/O auto-splits).
- PosEncoding: reject d_pos < 3 (trig_width 0 divides by zero on use).
Tests:
- compiled round-trips for attend_argmin/argmax/_where (previously only
oracle-tested), incl. a wide-value (40 > d_head) auto-split case.
- get_prev_value latch-within-budget and adjacent-true recency.
- _current_pos_attn_matrices zeroes the counter column across d_head.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments