fix(qwen35): warn when a prompt outgrows --fa-window

Merged
DA
2mo ago
+18-0

The bug

A finite --fa-window caps the full-attention layers to a sliding window, so content earlier than the window is invisible to them. Nothing reports this. The model still answers, it just cannot see the head of a long prompt, so it reads as a model quality problem rather than a configuration one.

Found while benchmarking long context on a Radeon AI PRO R9700 with Qwen3.8-27B. A label was planted at the very top of the prompt and the model asked to repeat it:

prompt tokens--fa-window 2048full attention
1,556recalledrecalled
6,208missedrecalled
13,148missedrecalled
26,728missedrecalled

No warning was emitted in any of the failing cases.

Worth noting: on this hardware the flag was not even buying speed. At a 27K prompt it measured 44.4 tok/s with the window against 45.7 without, and full attention recalled the label at every length tested up to 81K.

The fix

Warn once, the first time a prompt actually outgrows the window, naming both numbers so the cause is unambiguous. No behaviour change otherwise.

Validation

On the same box with --fa-window 2048: the warning fires exactly once, on the 6,208-token request that does lose the label, and does not fire for the 1,556-token request that retrieves it.

[qwen35] WARNING: prompt is 6208 tokens but --fa-window is 2048: full-attention
layers see only the last 2048 tokens, so content before that cannot be
retrieved. Drop --fa-window for long-context work.