Reconstructing a recurrent state

A recurrent layer updates an internal state as tokens pass through it. Speculative generation must keep that state consistent with the continuation accepted by verification. Replay retains the necessary inputs and repeats the relevant updates instead of keeping numerous complete snapshots. The SYCL kernel processes pending inputs before new tokens and can retain the state produced by the replay stage. This changes execution of an existing model: it does not train weights, introduce new knowledge or replace verification of speculative candidates. The feature therefore concerns local inference efficiency rather than model personalization.

Transfers are part of the implementation

The final changes cover more than arithmetic. Under guarded graph and layout conditions, the kernel can incorporate copies of the k, v, gate and beta inputs into pending storage. Overlapping buffers prevent unsafe fusion. A separate download path uses pinned host staging memory for device-to-host tensor reads of at least 64 KiB. Up to four workers receive 1 MiB staging slots, while ordinary copying remains available when staging cannot be used. The patch also carries separate strides for q and k rather than requiring identical layouts. These details matter because moving recurrent-state data can erase savings in the kernel itself.

What the reported numbers describe

The contributor tested Qwen3.8-27B UD-Q4_K_XL on one Intel Arc Pro B60 with an 8192-token context and draft-MTP capped at seven draft tokens. The F16 comparison lists 1197.0 MiB for recurrent state in the snapshot baseline and 176.8 MiB in the replay branch. That is roughly an 85 percent reduction in this state component, not in total model VRAM. In the same comparison, prefill remains approximately level and decode improves by around two percent. These are the contributor’s measurements; we did not reproduce them independently or run the model.

Compatibility still defines the result

The merged support check permits replay operations with a single state slot. Fusion has additional shape, layout and memory-overlap conditions. Those boundaries prevent extending the reported result to every model, graphics card or concurrency setting. The contributor also shows a naive replay port without pinned downloads losing prefill performance, illustrating why the complete execution path matters. An evaluation should distinguish recurrent-state allocation, total VRAM, prefill and decode. This release provides a specific SYCL implementation and a documented regression fix; its measurements do not establish a universal speed multiplier for local LLM inference.