freenode
AI & ML

Ollama ROCm on Strix Halo returns prior answers after context overflow

On gfx1151 hardware, truncated over-window prompts can replay another request's completion instead of generating a new one.

Ollama's ROCm backend on AMD Strix Halo integrated graphics can leak key-value cache state across sequential API calls, so a new chat completion may literally reprint the previous request's answer.

Yauhen Bichel reproduced the fault on Ollama 0.34.0 with a Ryzen AI MAX+ 395 and Radeon 8060S (gfx1151). With a single loaded model, flash attention, and a 65,536-token context, a short OpenAI-compatible chat request was followed by an unrelated prompt large enough to exceed the window. The oversized prompt was truncated (reported as roughly half the window). The model's reply was the first request's JSON answer verbatim, including the same completion length. A later over-window call returned an even earlier test answer. A full-attention model under the same overflow path produced an empty response instead of stale text. Runs that stayed under the context limit answered correctly.

The practical effect is silent cross-request contamination whenever the backend truncates. On a shared local endpoint that can expose prior users' outputs and corrupt results without an obvious error. Bichel's mitigation is a proxy that counts tokens and rejects over-window prompts with context_length_exceeded rather than allowing truncation.