mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #306] Layer split: prompt-borrow sizing vs prompt-buffer reservation disagree, and the 8 GiB arena pin cap (a WDDM workaround) applies on Linux too #148
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#148
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 @zipenghao on GitHub (Sep 30, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/306
Summary: two separate problems that only show up when a layer split is combined
with prompt borrowing on a non-Windows platform. The second one is why prefill roughly
halves on two cards.
Environment: 2x Tesla V100-SXM2-16GB (sm_70, PCIe Gen3 x16, no NVLink, same host
bridge), Xeon E5-2680 v4, 62 GiB RAM, driver 580.178.04, CUDA 12.8, v0.1.24 built from
source. Context 131072. All numbers from the same prompt and the same command.
Problem 1: prompt-borrow sizing disagrees with prompt-buffer reservation
Under a layer split, upstream sets
no_prefill_borrow = true, so the prompt path ownsits own buffers and both sizing paths happen to agree. If you enable borrowing, they
stop agreeing:
src/program/generate.cpp:2021does not reserve the promptbuffer when it borrows
split_pf_mibatsrc/program/generate.cpp:1887reserveschunk*680per cardMeasured effect of enabling borrowing as-is: CUDA1 dropped from 3461 expert-cache slots
to 1290, decode 33 -> 27.7 tok/s.
Enabling borrowing also needs a second change:
:1153hardcodesno_prefill_borrow = truewhen splitting, which pulls chunk down from 8192 to 2048 at:1174-1178. With borrowing on and chunk left at 8192 the engine cannot start at all:My fix: borrow on the first pass (no reservation), and let every later pass pay for its
own prompt buffer; keep the chunk cap at 2048.
Problem 2: the 8 GiB pin cap is a WDDM workaround applied on every platform
src/program/generate.cpp:1827caps pinned host memory at 8 GiB, and the comment sayswhy:
That is a Windows/WDDM problem, but the cap is applied unconditionally. On Linux the
second CUDA context then pins only 7 GiB of the 45.29 GiB expert arena, and expert
reads that miss the cache go through pageable memory, page by page, instead of DMA.
That is the direct cause of the prefill regression:
Prerequisite if you make the cap Windows-only
On Linux, raising the cap only helps once
RLIMIT_MEMLOCKallows it. Without it thearena cannot be pinned at all and you regress to pageable copies - slower, and on a
62 GiB machine it can fail outright. So this needs to ship together with:
Defaults are 7.84 GiB here (soft == hard, needs root).
Escape hatches
Both behaviours are still reachable without recompiling, which is how I A/B'd them:
STRATA_SPLIT_NO_BORROW=1- restore upstream's "no borrowing under a split"STRATA_ARENA_PIN_CAP=8- restore the 8 GiB cap on all platformsQuestions
but it moves a memory requirement onto the user, so it probably wants documentation
and a warning rather than a silent change.
semantics? If so, the two sizing sites just need to agree on it.
Patches and the full investigation: https://github.com/zipenghao/strata-v100-sm70
Related: #303 (garbled output, same setup) and #305 (sm_70 support).
Note: this report and the linked patches were drafted with AI assistance; all numbers
above were measured manually on the hardware listed.
@Niko1221 commented on GitHub (Oct 1, 2026):
Both parts are fixed: the per-stage prompt loans (0.1.30, #216) and the 8 GiB pin cap now only under WDDM (0.1.31, #253; STRATA_ARENA_PIN_GIB sets a cap). Please retest on 0.1.31 and reopen if the sizing still disagrees.
@zipenghao commented on GitHub (Oct 10, 2026):
Retested on 0.1.34 with both patches removed - both parts behave as you described, on 2x V100-SXM2-16GB (sm_70, PCIe Gen3 x16, no NVLink), Xeon E5-2680 v4, 62 GiB,
memlock unlimited, IQ3_XXS pack,--kv int8,--spec 2 --spec-min-p 0.5, context 131072.The pin cap. The arena registers in full, with no 8 GiB limit and no page-by-page fallback:
The prompt loans. The split proceeds without the sizing disagreement; the layer split is chosen and both stages come up with their own caches:
Same machine, same prompts, 0.1.24 + local patches vs 0.1.34 stock:
Caveats worth recording for anyone else reading this: the artifact is Unsloth's
UD-IQ3_XXS, so I had to pack by hand with--compat-bf16, and--nativehas to point at the second shard (see my comment on #305). Neither is a V100-specific issue - both are about that artifact's layout, not the card.Closing our side. If the sizing ever disagrees again on your hardware, I have the log lines to compare.