[GH-ISSUE #5335] [Engine] Zen2 kernels suffer from microcode pdep #3184

Open
opened 2026-11-07 14:38:42 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @Licenser on GitHub (Nov 5, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5335

In older Zen generations (2 and before) AMD's CPUs implement the pdep instruction as microcode rather than in silicone.

Those instructions used under the __BMI2__ flag, in the IQ1_S and IQ1_M kernels for the dot product.

__BMI2__ is defined for the AMD Zen2 and before products when compiling natively.

in short pdep make Zen2 go slooooowwww :(

Proposal as implemented in #3472 (happy to change on feedback):

  • a new flag STRATA_GGML_PDEP AUTO (default)/ON/OFF
  • in AUTO disables the __BMI2__ for cpu family 17h or 18h (the naughty ones from AMD), leaves it untouched for the rest

Won't fix it on windows or pre-compiled sources but it will make zen2 (and earlier) compilations go brrrr.

engine decode on a 2080ti over (4 requests) 58-76 tok/s to 71-99 tok/s

--

Strata version: measured on v0.1.45 (477ac13c).

On v0.2.10 only the DeepSeek release build has BMI2 off (6953d896); native builds and the other engines' release builds still use pdep.

6953d896 measured the same on an EPYC 7452 (IQ1_M 1.8 -> 32 GB/s). #3472 covers native builds for every engine.

Originally created by @Licenser on GitHub (Nov 5, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/5335 In older Zen generations (2 and before) AMD's CPUs implement the pdep instruction as microcode rather than in silicone. Those instructions used under the `__BMI2__` flag, in the IQ1_S and IQ1_M kernels for the dot product. `__BMI2__` is defined for the AMD Zen2 and before products when compiling natively. in short pdep make Zen2 go slooooowwww :( Proposal as implemented in #3472 (happy to change on feedback): - a new flag `STRATA_GGML_PDEP` `AUTO` (default)/`ON`/`OFF` - in `AUTO` disables the `__BMI2__` for cpu family 17h or 18h (the naughty ones from AMD), leaves it untouched for the rest Won't fix it on windows or pre-compiled sources but it will make zen2 (and earlier) compilations go brrrr. > engine decode on a 2080ti over (4 requests) 58-76 tok/s to 71-99 tok/s -- Strata version: measured on v0.1.45 (477ac13c). On v0.2.10 only the DeepSeek release build has BMI2 off (6953d896); native builds and the other engines' release builds still use pdep. 6953d896 measured the same on an EPYC 7452 (IQ1_M 1.8 -> 32 GB/s). #3472 covers native builds for every engine.
Author
Owner

@github-actions[bot] commented on GitHub (Nov 5, 2026):

Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:

  • Add the Strata version (Settings > About, or strata --version).

Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment /reopen.

Details: CONTRIBUTING.md

<!-- gh-comment-id:6664249770 --> @github-actions[bot] commented on GitHub (Nov 5, 2026): Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing: - [ ] Add the Strata version (Settings > About, or `strata --version`). Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment `/reopen`. Details: [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md)
Author
Owner

@github-actions[bot] commented on GitHub (Nov 5, 2026):

Thanks, this follows the format now.

<!-- gh-comment-id:6664338067 --> @github-actions[bot] commented on GitHub (Nov 5, 2026): Thanks, this follows the format now.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3184
No description provided.