[GH-ISSUE #5215] [Engine] The CPU share limit stays at 1,536 on a K-quant gfx12 model that never runs the fused IQ kernels #3106

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

Originally created by @sdroege on GitHub (Nov 4, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5215

Area

[Engine] (speed, kernels, models, the server and API)

Desktop app, Terminal or source?

Source (START-HERE.bat, setup.sh or a build)

What happened

On gfx12 the CPU prefill share is on by default, but its limit is 1,536 tokens. That limit exists so a chunk from 1,536 up streams all experts and runs the fused IQ2_S/IQ4_XS gate/up kernels. A K-quant model never runs those kernels but still gets the lower limit.

Measured on UD-Q4_K_XL, 3 rounds, 2K prompt, same start otherwise:

share limit 2K prompt tok/s (3 rounds)
1,536 (default) 1,124 / 1,142 / 1,142
3,072 (STRATA_PREFILL_CPU_SHARE_MAX=3072) 1,258 / 1,246 / 1,250

That is +9.4% at 2K, consistent in all three rounds. 1K, 4K, 32K and 98K were unchanged, and the 4K and up prompts are above both limits by construction.

Cause (static analysis). src/prefill/prefill.cpp:2862 sets the limit from share_rules::gfx12_share_limit(fused::gfx12_iq2s_default()), and include/strata/prefill/share_rules.hpp:31 returns 1,536 when that flag is on and 3,072 otherwise. The flag is a build and architecture default, not a property of the model in use.

Expected: a model whose gate/up experts are not IQ2_S/IQ4_XS keeps the 3,072 limit.
Actual: 1,536, so 1.5K to 3K prompts get no share.

Related: #3923 (CPU share arming on a 32 GB PC; different cause).

Proposed fix: thread the model's gate/up expert type to the arm point, or make the limit depend on whether the model actually uses IQ2_S/IQ4_XS.

Smallest steps or command that reproduce it

  1. Start a K-quant gfx12 config with --prefill auto and no STRATA_PREFILL_CPU_SHARE_MAX.
  2. Read the engine line prefill: the CPU share is ON by default for prompt chunks up to 1536 tokens.
  3. Set STRATA_PREFILL_CPU_SHARE_MAX=3072 and compare a 2K prompt.

Reproduction status

Reproduced locally for the speed difference; the code cause above is unconfirmed static analysis.

Strata version

Strata 0.2.10, engine 0.1.56

Graphics card, memory and system

Radeon AI PRO R9700 32 GB, 121.5 GiB RAM, Fedora 44 (kernel 7.2.13-200.fc44.x86_64)

Originally created by @sdroege on GitHub (Nov 4, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/5215 ### Area [Engine] (speed, kernels, models, the server and API) ### Desktop app, Terminal or source? Source (START-HERE.bat, setup.sh or a build) ### What happened On gfx12 the CPU prefill share is on by default, but its limit is 1,536 tokens. That limit exists so a chunk from 1,536 up streams all experts and runs the fused IQ2_S/IQ4_XS gate/up kernels. A K-quant model never runs those kernels but still gets the lower limit. Measured on UD-Q4_K_XL, 3 rounds, 2K prompt, same start otherwise: | share limit | 2K prompt tok/s (3 rounds) | |---|---| | 1,536 (default) | 1,124 / 1,142 / 1,142 | | 3,072 (`STRATA_PREFILL_CPU_SHARE_MAX=3072`) | 1,258 / 1,246 / 1,250 | That is +9.4% at 2K, consistent in all three rounds. 1K, 4K, 32K and 98K were unchanged, and the 4K and up prompts are above both limits by construction. **Cause (static analysis).** `src/prefill/prefill.cpp:2862` sets the limit from `share_rules::gfx12_share_limit(fused::gfx12_iq2s_default())`, and `include/strata/prefill/share_rules.hpp:31` returns 1,536 when that flag is on and 3,072 otherwise. The flag is a build and architecture default, not a property of the model in use. Expected: a model whose gate/up experts are not IQ2_S/IQ4_XS keeps the 3,072 limit. Actual: 1,536, so 1.5K to 3K prompts get no share. Related: #3923 (CPU share arming on a 32 GB PC; different cause). **Proposed fix:** thread the model's gate/up expert type to the arm point, or make the limit depend on whether the model actually uses IQ2_S/IQ4_XS. ### Smallest steps or command that reproduce it 1. Start a K-quant gfx12 config with `--prefill auto` and no `STRATA_PREFILL_CPU_SHARE_MAX`. 2. Read the engine line `prefill: the CPU share is ON by default for prompt chunks up to 1536 tokens`. 3. Set `STRATA_PREFILL_CPU_SHARE_MAX=3072` and compare a 2K prompt. ### Reproduction status Reproduced locally for the speed difference; the code cause above is unconfirmed static analysis. ### Strata version Strata 0.2.10, engine 0.1.56 ### Graphics card, memory and system Radeon AI PRO R9700 32 GB, 121.5 GiB RAM, Fedora 44 (kernel 7.2.13-200.fc44.x86_64)
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#3106
No description provided.