You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Verified -fa off with llama-cli, llama-bench, and llama-perplexity on CPU.
Two cases are still failing:
-fa off with STATEFUL
NPU
STATEFUL and NPU support will be addressed in separate PRs.
When -fa off, v_trans=true. In this case, the layout of cache V differs from cache K. Although the tensor shape of cache V is the same as cache K, i.e. [n_embd, kv_size, n_seq, 1], the data is actually stored and accessed in a transposed manner. The effective layout is [kv_size, n_embd, n_seq, 1].
This causes two issues:
The SET_ROWS op that updates cache V first flattens the cache and writes the current V using a scattered, element-wise update pattern, instead of row-wise updates as in cache K. Code snippets:
Activity
wine99 commentedon Apr 2, 2026
Paste comments from #118:
Verified
-fa offwithllama-cli,llama-bench, andllama-perplexityon CPU.Two cases are still failing:
-fa offwith STATEFULSTATEFUL and NPU support will be addressed in separate PRs.
When
-fa off,v_trans=true. In this case, the layout of cache V differs from cache K. Although the tensor shape of cache V is the same as cache K, i.e.[n_embd, kv_size, n_seq, 1], the data is actually stored and accessed in a transposed manner. The effective layout is[kv_size, n_embd, n_seq, 1].This causes two issues:
SET_ROWSop that updates cache V first flattens the cache and writes the current V using a scattered, element-wise update pattern, instead of row-wise updates as in cache K. Code snippets:STATEFUL is currently not working due to shape and layout mismatches.
NPU is not working because it pads both the current K/V tensors and the
SET_ROWSindex input. This approach only works with row-wise updates.ravi9 commentedon Jun 17, 2026
ggml-org#24503