fix(attention): report when sparse attention cannot act

A sequence below the minimum length left the feature enabled and idle
with nothing in the log. The stage now records why it declined and says
so once per length, so an enabled setting that cannot act is visible
rather than quiet.
This commit is contained in:
CalamitousFelicitousness
2026-08-22 23:47:12 +01:00
parent d75abce642
commit 1b66adcff2
2 changed files with 21 additions and 8 deletions
+1
View File
@@ -373,6 +373,7 @@ def test_stage_gates():
assert stage(q, k, v, None, True) is None, 'a causal call is not eligible yet'
assert stage(q, cross_k, cross_v, None, False) is None, 'cross attention is not eligible'
assert stage(short_q, short_k, short_v, None, False) is None, 'below the gate attention stays dense'
assert stage.last_skip == 'below the minimum sequence', stage.last_skip
ctx.set_role('vae')
assert stage(q, k, v, None, False) is None, 'only the denoiser is sparsified'
ctx.set_role('transformer')