Skip to content

Conversation

@ikawrakow
Copy link
Owner

The bug was in the calculation of number of work items to use when computing FA on the CPU. In my case (maximum of 32 threads) it triggered with the GLM-4 model that has an unusually small number of KV heads (just 2). But I guess it can also trigger with a larger number of threads for more common numbers of KV heads.

Fixed by just using max(1, nk). This will result in a far from optimal number of compute chunks, but at least it works.

I'm working on a better strategy for dividing the work between the threads on this branch, but not quite ready for a PR yet.

@ikawrakow ikawrakow merged commit 9e846f0 into main Apr 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants