OpenFlowLM-Next icon indicating copy to clipboard operation
OpenFlowLM-Next copied to clipboard

The batched route's attention dispatch hangs on Gemma 3 and Phi-4-mini

Open Cyronius opened this issue 2 months ago • 0 comments

Found while putting Gemma 3 on the batched prefill route: the very first dxB dispatch times out (ERT state 8), every time, on the first token of the first layer. It is not Gemma 3's sliding-window plumbing — it hangs the same way with the plain global-attention kernel — and it is not transient.

The cause is in open_kernels/designs/dense/dx_attn.py, the attention half of the route. It was copied from dx.py before dx.py's output handling changed, and it still emits NHL // HPO output elements per attention core, where NHL is the heads a core owns and HPO the heads an output element carries. dx.py now emits min(NHL, HPO) heads per element and gives every core its own output fifo. When a core owns fewer heads than an element carries, the old formula is zero: core 0 never releases an output element, the DMA drain waits for it forever, and the dispatch never completes.

That is exactly Gemma 3's geometry (2 heads per core, 4 per element) and Phi-4-mini's (4 and 8). The six families the route had run on so far all own at least as many heads per core as an element carries, which is why it never showed. Phi-4-mini's route has never actually run on hardware before this — it emits the route (#97) but would hang the same way the moment it was used.

Fix is to bring dx_attn.py back in line with dx.py; PR to follow. Every dense family's dx_attn build changes, so each kernel set needs re-exporting.

Cyronius avatar Sep 19 '26 00:09 Cyronius