mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
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#1746
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?
Originally created by @cjmckenna on GitHub (Oct 25, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4041
A re-test of #2418 on 0.2.2, as the tracker reset asked. The auto split still lands off the best placement on an x16 + x4 pair. Pinning
"layer_split": "28"makes decode about 10.5% faster with prompt reads unchanged.Hardware. 2x RTX 3090 24 GB (sm_86). CUDA0 on the CPU's PCIe 4.0 x16 slot (startup probe 25.6 GB/s); CUDA1 on the CPU's M.2 slot through an OCuLink adapter, PCIe 4.0 x4 (probe 6.3 GB/s). i7-11700KF (8 cores, 7 pool workers), 121 GiB DDR4-3200, Ubuntu 26.04, CUDA 13.3.
Software and config. Strata 0.2.2 (engine 0.1.47) plus PR #3382. Qwen3.8-Flash-Next IQ3_S native pack,
--kv int8 --kv-resident 32768, max context 262144,--spec 4 --spec-min-p 0.5with the MTP layer,parallel2 with--batch-mtp --batch-groups 1, conversation cache 16 GiB / 10 slots,--short-read 256.layer_split: "auto"picks K=32: CUDA1 runs layers 32-47, and the start line reportslink 6.3 GB/s -> miss cost x4.08.What we saw first. On real traffic, averaged over 168,065 batch decode windows (two requests at once), a window took 21.0 ms. The CUDA0 stage was 9.88 ms of GPU work plus 2.62 ms waiting on CPU-computed expert misses (layers 0-31, 9,108 cache slots, about 285 per layer). The CUDA1 stage was 5.91 ms plus 0.12 ms (layers 32-47, 7,832 slots, about 490 per layer). Nearly all the CPU stall was on CUDA0's side.
Test. Idle server. One restart per arm with
"layer_split"pinned, everything else the same. Per arm: solo decode of up to 2,000 tokens after 16K, 98K and 160K-token code prompts, cold and then warm; two concurrent ~90K decodes; cold reads of 30K, 97K and 170K tokens; warm multi-turn follow-ups of +300, +600 and +1,000 tokens. Requests carry no sampling fields (the server's shared defaults, temperature 0.6). Decode is compared at equal draft acceptance and context with a least-squares fit (tok/s ~ arm + acceptance + context), because acceptance moved decode by about 1.1-1.4 tok/s per 0.01 in these runs. Two sweeps on the same evening; the K=32 anchor reproduced (127.7 vs 128.3 tok/s, cold reads within 1%).Past K=28 decode keeps improving, but more slowly, while cold reads get 12-32% slower (and warm follow-ups about 5-10%). Weighted by where our real traffic spends engine time (decode 67%, warm reads 27%, cold reads 6%), K=28 comes out best at about -7.5%. We run K=28 in production now.
What the code suggests (unconfirmed static reading, not measured). The split model sums the stages' costs and prices CUDA1's misses with the link-scaling rule from #2007, which switches on at a 4x bandwidth gap (
split_rules.hpp); our gap is 25.6/6.3 = 4.06x. But in decode most misses on either card are computed by the CPU pool, not streamed over the link: per window here the routed experts were 96.5% VRAM, 0.7% PCIe and 2.8% CPU. So pricing CUDA1's decode misses by its link would over-price them, and push layers (and cache pressure) onto CUDA0. A small change in the startup probe can also flip the choice, since we sit just above the threshold.STRATA_SPLIT_UNIFORM=1is the existing opt-out; we have not measured what auto picks with it.What we did not test. Equal cards or three or more GPUs; a single GPU; other models or packs;
STRATA_SPLIT_UNIFORM=1with auto;--trim-stage-weights; quality beyond draft acceptance (a different split changes which experts are resident, so outputs can differ in rounding). One run per arm per sweep.Question. Would a change that prices decode misses by where they are actually computed (the CPU pool's measured time per expert, as the single-GPU PCIe-share rule already does) rather than by the link be welcome as an opt-in PR? Or would you rather adjust the 4x rule? We can measure a candidate on this box.
Developed with an AI coding assistant; every number above was measured on the machine described here.
@coryjett commented on GitHub (Oct 28, 2026):
A counter-datapoint from a symmetric pair, in case it helps pin down what auto should key on: 2x RTX 3090 both on PCIe 3.0 x16 (start-up probes 7.8-9.4 GB/s each, one card per socket of a 2x Xeon E5-2620 v3), Flash-Next IQ3_S, 0.2.7 / engine 0.1.52,
--trim-stage-weights,--expert-cache auto, MTP--spec 4. Auto picks K=25 here. One change per arm against the same base (3 runs each):layer_split(with trim)(Percentages against the untrimmed base.) So with equal links auto's point was the best trade: the lower splits buy a little decode at a large cost on prompt reading. Your x16 + x4 pair moving the optimum to K=28 fits a link-aware rule rather than a count-based one. Raw data in #4468 (
bench/results/2026-10-28-community-t630-2x3090-pcie3/), section 19 of the log quoted there.@cjmckenna commented on GitHub (Oct 28, 2026):
Thanks, this is useful, and I think it narrows the question rather than counters it.
Auto is already link-aware: since #2007 it scales a stage's miss cost by its link, but only when one link is at least 4x slower than the fastest (
kLinkScaleMin = 4.0ininclude/strata/program/split_rules.hpp; a symmetric rig keeps the fitted formula). On your pair (7.8-9.4 GB/s) that rule never fires, so your sweep tests the base formula, and it looks right: auto's K=25 was the best trade. On ours (25.6 vs 6.3 GB/s, a 4.06x gap) the rule fires, multiplies CUDA1's miss cost by 4.08, and moves auto from wherever the base formula would land to K=32, past the best point at K=28.So the open question is not count-based vs link-aware, but how much the link should weigh in decode, where (on our box) 96.5% of routed experts were in VRAM, 0.7% came over PCIe and 2.8% ran on the CPU. That last part is from our engine log; the reading of how the rule prices it is unconfirmed static analysis.
One difference to keep in mind when comparing the tables: our sweep was 0.2.2 without
--trim-stage-weights, yours is 0.2.7 with it. We have since moved production to 0.2.7 with trim and K=28, but have not re-swept the split under trim.Next on our side, if useful: what auto picks on this box with
STRATA_SPLIT_UNIFORM=1, and a short K=26/28/30/32 re-sweep on 0.2.7 with trim, so both data points are on the same release.Developed with an AI coding assistant; every number above was measured on the machine described in the issue.
@cjmckenna commented on GitHub (Oct 28, 2026):
Follow-up with both data points on the same release, as offered. Same box as the issue (2x RTX 3090, CUDA0 link 25.6 GB/s, CUDA1 6.3 GB/s), now Strata 0.2.7 with
--trim-stage-weights,--batch 2 --batch-mtp, Qwen3.8-Flash-Next IQ3_S.What auto picks on 0.2.7:
STRATA_SPLIT_UNIFORM=1: K=26Pinned sweep, idle box, one restart per arm, order 28 26 30 32 28. Cold = six cold reads 17K-182K, mean vs K=28. Solo decode is a least-squares fit over six seeded runs per arm with draft acceptance as a covariate, since acceptance moved 0.65-0.85 between runs.
So on 0.2.7 with trim, auto lands at K=29, between our two best arms, and the link rule no longer costs us anything. The uniform pick decodes about 2% faster solo but reads prompts 12% slower, which is the trade the link rule exists to avoid on an asymmetric pair. Your symmetric result and ours fit the same picture: the base formula looks right, and the 4x rule now seems right-sized for our gap.
Developed with an AI coding assistant; every number above was measured on the machine described in the issue.
@Niko1221 commented on GitHub (Nov 5, 2026):
Thanks for taking the time to report this.
Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected.
To reopen it takes about two minutes:
/reopen. A check runs and either reopens the issue or lists what is still missing.The rules are in CONTRIBUTING.md.