mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2653] [CLOSED] calibrate: the CPU prefill share's range measured per PC (STRATA_PREFILL_CPU_SHARE_MAX 3072 against the default, into the config's env) #4193
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4193
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/2653
Author: @qiuzan2001
Created: 10/15/2026
Status: ❌ Closed
Base:
main← Head:qiuzan2001/calibrate-cpu-share-range📝 Commits (1)
7485bd9calibrate: the CPU prefill share's range is measured per PC (STRATA_PREFILL_CPU_SHARE_MAX 3072 against the default, into the config's env)📊 Changes
4 files changed (+298 additions, -29 deletions)
View changed files
📝
docs/DETAILS.md(+7 -3)📝
setup.py(+17 -4)📝
tools/calibrate.py(+151 -16)📝
tools/test_calibrate.py(+123 -6)📄 Description
For #2478's question ("Could setup measure the share once and record it when it helps?"), for the range rather than the arming.
What it changes
tools/calibrate.py: a sixth step, the CPU prefill share's range. The share is on by default for prompt chunks below 1,024 tokens;STRATA_PREFILL_CPU_SHARE_MAX=3072extends it, and that stays opt-in because it depends on the CPU: docs/DETAILS.md records -2% at 2,048 tokens on the Ryzen 5 7600 + RTX 5070, and on a Ryzen 7 5800X3D + RTX 5070 Ti it measured -24% / -14% / -3% at 1.5K / 2.2K / 2.9K (below). So it is measured per PC: one engine start with the variable absent and one with 3072, each reading a fresh ~2K-token prompt three times as a one-shot request (strata_checkpoint: false, so no checkpoint is kept and every read is from token 0; a read that reused one is not counted), the prompt tokens per second compared with the existingpickrule (more than 3% faster or nothing).env(apply_env, the counterpart ofapplyfor arguments: an older calibration's value goes when it is not chosen again), into the settings-file record, and is re-applied on a reinstall (setup.py).--batch) or already at 3,072 (a setSTRATA_PREFILL_CPU_SHARE).--calibrateparagraph; the 0.1.41 paragraph's "stays opt-in" sentence gains the 5070 Ti numbers and the pointer to the calibration.What it leaves alone
src/orinclude/changes; the default range stays 1,024 tokens. No backend to build.enventries (setup's own, Unsloth's, AMD's) are kept as they are.How it was checked
tools/test_calibrate.py: 25 of 25 (8 new: the range chosen at +15% and not at +2%, skipped without a prompt, measured with the chosen worker count, a failed start and a failed read drop that arm only,apply_env,engine_env,share_step_applies, the prompt builder, reads that reused a checkpoint).tools/test_setup_choices,_amd,_hybrid,_qwen36,_unslothpass.tools/test_setup_goldenhas 8 failures (the unsloth UD-Q4_K_XL cases); they are the same on upstream/main296b59d2without this change.reused=0:STRATA_PREFILL_CPU_SHARE_MAX=3072, start 1 / 2pickchooses 3072 (+12%).prompt_msfrom the server; same box and model):..._MAX=3072The decode after each turn had the same expert-cache hit rates in both arms. A second set of two rounds per arm (a build whose default range was 3,072, against the 0.1.44.1 build) gave the same figures: -24.1 / -13.9 / -2.7% at 1,537 / 2,142 / 2,848 tokens, and
=1024on that build equal to the 0.1.44.1 build.An independent review pass read the diff; its points (a failed read must drop only its arm, the baseline must not carry an earlier calibration's value, skip where the share is off) are in.
The standalone companion, Strata Profile Studio (Python standard library only), reads this tool's reports and compares runs against the noise floor of the PC, with a sign test over the agent turns.
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.