[GH-ISSUE #1595] 0.1.41 CPU share default: no gain, and ~5% slower at 1,000 tokens, on a V100 with all experts in VRAM #639

Closed
opened 2026-11-04 01:44:42 +07:00 by bsakaguchi · 4 comments
Owner

Originally created by @christopherrobertbrooks-tech on GitHub (Oct 8, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1595

Measured the new default (CPU share on for chunks below 1,024 tokens) against STRATA_PREFILL_CPU_SHARE=0 on one Tesla
V100-PCIe-32GB with an i7-13700KF (16 GB RAM, low-RAM mode), Coder IQ1_M with all experts resident in VRAM
(--resident-experts), v0.1.41 built for sm_70 (CUDA 12.9), same binary, arms alternating, 3 rounds x 3 runs,
temperature 0. Prompt time (ms), mean of 3 runs per round:

prompt share off (r1 / r2 / r3) share on (r1 / r2 / r3)
256 793 / 789 / 795 793 / 796 / 792 0%
512 1,021 / 1,018 / 1,020 1,027 / 1,023 / 1,020 +0.3%
1,000 1,468 / 1,464 / 1,469 1,538 / 1,538 / 1,535 +4.8%
4,096 3,292 3,293 0% (share not used)

The engine printed the "CPU share is ON by default" line in the on arm, and the env check confirmed =0 in the off
arm.

This fits the explanation in the notes: when every expert is already on the GPU, there's nothing for the CPU to save, so
the share can only cost. The 1,000-token case is consistently slower in all 3 rounds, despite auto's timing check.
Maybe the default could skip the share when the expert cache holds everything (as with --resident-experts)? For now we
run with STRATA_PREFILL_CPU_SHARE=0.

Originally created by @christopherrobertbrooks-tech on GitHub (Oct 8, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/1595 Measured the new default (CPU share on for chunks below 1,024 tokens) against `STRATA_PREFILL_CPU_SHARE=0` on one Tesla V100-PCIe-32GB with an i7-13700KF (16 GB RAM, low-RAM mode), Coder IQ1_M with **all experts resident in VRAM** (`--resident-experts`), `v0.1.41` built for sm_70 (CUDA 12.9), same binary, arms alternating, 3 rounds x 3 runs, temperature 0. Prompt time (ms), mean of 3 runs per round: | prompt | share off (r1 / r2 / r3) | share on (r1 / r2 / r3) | | | ---: | --- | --- | ---: | | 256 | 793 / 789 / 795 | 793 / 796 / 792 | 0% | | 512 | 1,021 / 1,018 / 1,020 | 1,027 / 1,023 / 1,020 | +0.3% | | 1,000 | 1,468 / 1,464 / 1,469 | 1,538 / 1,538 / 1,535 | **+4.8%** | | 4,096 | 3,292 | 3,293 | 0% (share not used) | The engine printed the "CPU share is ON by default" line in the `on` arm, and the env check confirmed `=0` in the `off` arm. This fits the explanation in the notes: when every expert is already on the GPU, there's nothing for the CPU to save, so the share can only cost. The 1,000-token case is consistently slower in all 3 rounds, despite `auto`'s timing check. Maybe the default could skip the share when the expert cache holds everything (as with `--resident-experts`)? For now we run with `STRATA_PREFILL_CPU_SHARE=0`.
Author
Owner

@phoenixclyde commented on GitHub (Oct 9, 2026):

Matches what we see on AMD. There the default is on for a structural reason: the gfx906 compat build compiles as HIP without STRATA_USE_HIP, so the guard at src/prefill/prefill.cpp:1839 (#if !defined(STRATA_USE_HIP)) does not exclude it - src/core/expert_cache.cpp:5-6 states that build has no STRATA_USE_HIP, and guards the same question with #if defined(STRATA_USE_HIP) || defined(STRATA_HIP_GFX906).

One MI50 32 GB (gfx906), strata generate CLI, 4-token prompt, one binary with one set of weights and one config, only the environment differing:

default   on the CPU 197 (share 0.90)    prefill 928.3 ms
=0        on the CPU 0   (share 0.00)    prefill 929.5 ms

Output token ids are identical, so the difference is 0.13%, inside our run-to-run spread - the same shape as your 1,000-token case: the share engages and buys nothing.

There is a fix for the AMD side: one line at prefill.cpp:1839 (#1732).

<!-- gh-comment-id:6083992630 --> @phoenixclyde commented on GitHub (Oct 9, 2026): Matches what we see on AMD. There the default is on for a structural reason: the gfx906 compat build compiles as HIP *without* `STRATA_USE_HIP`, so the guard at `src/prefill/prefill.cpp:1839` (`#if !defined(STRATA_USE_HIP)`) does not exclude it - `src/core/expert_cache.cpp:5-6` states that build has no `STRATA_USE_HIP`, and guards the same question with `#if defined(STRATA_USE_HIP) || defined(STRATA_HIP_GFX906)`. One MI50 32 GB (gfx906), `strata generate` CLI, 4-token prompt, one binary with one set of weights and one config, only the environment differing: ``` default on the CPU 197 (share 0.90) prefill 928.3 ms =0 on the CPU 0 (share 0.00) prefill 929.5 ms ``` Output token ids are identical, so the difference is 0.13%, inside our run-to-run spread - the same shape as your 1,000-token case: the share engages and buys nothing. There is a fix for the AMD side: one line at `prefill.cpp:1839` (#1732).
Author
Owner

@Niko1221 commented on GitHub (Oct 10, 2026):

Thank you for the clean interleaved table. You were right: the 0.1.41 CPU prefill share default has nothing to take when every expert is already in the GPU cache, and arming it only moves the staged-chunk limit. In v0.1.42 the default share is not armed when the expert cache holds every expert (the serve log says so). An explicit STRATA_PREFILL_CPU_SHARE is still honoured, and where experts are not all resident the default is unchanged. We checked that path on a 12 GB card with Q2_0 (share on, coherent output).

<!-- gh-comment-id:6099623306 --> @Niko1221 commented on GitHub (Oct 10, 2026): Thank you for the clean interleaved table. You were right: the 0.1.41 CPU prefill share default has nothing to take when every expert is already in the GPU cache, and arming it only moves the staged-chunk limit. In v0.1.42 the default share is not armed when the expert cache holds every expert (the serve log says so). An explicit STRATA_PREFILL_CPU_SHARE is still honoured, and where experts are not all resident the default is unchanged. We checked that path on a 12 GB card with Q2_0 (share on, coherent output).
Author
Owner

@christopherrobertbrooks-tech commented on GitHub (Oct 10, 2026):

Thanks for the quick fix! One small addition for anyone with the same card: those numbers were with vision off (expert cache 12288 slots, 23.42 GiB of VRAM). With --vision on, the vision encoder takes ~1.4 GB of the V100 and the cache drops to 11,644 slots (the rest pinned in RAM), so the new "every expert cached" check probably won't apply there. We keep STRATA_PREFILL_CPU_SHARE=0 set explicitly, which you mention is still honoured, so nothing needed on your side.

<!-- gh-comment-id:6099979814 --> @christopherrobertbrooks-tech commented on GitHub (Oct 10, 2026): Thanks for the quick fix! One small addition for anyone with the same card: those numbers were with vision off (`expert cache 12288 slots, 23.42 GiB of VRAM`). With `--vision` on, the vision encoder takes ~1.4 GB of the V100 and the cache drops to 11,644 slots (the rest pinned in RAM), so the new "every expert cached" check probably won't apply there. We keep `STRATA_PREFILL_CPU_SHARE=0` set explicitly, which you mention is still honoured, so nothing needed on your side.
Author
Owner

@Niko1221 commented on GitHub (Oct 13, 2026):

Thanks for the report. To keep the tracker current we are closing issues older than three days: 0.1.44 is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1.

If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.

<!-- gh-comment-id:6156148883 --> @Niko1221 commented on GitHub (Oct 13, 2026): Thanks for the report. To keep the tracker current we are closing issues older than three days: [0.1.44](https://github.com/Niko1221/Strata/releases/tag/v0.1.44) is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1. If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.
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#639
No description provided.