Repository navigation
Conversation
Contributor
Author
|
Verified and benchmarked in isolation on Strata v0.2.17 ( In
Clean, fully mergeable on v0.2.17. |
cobra91
force-pushed
the
pr/peer-layer-major
branch
from
November 26, 2026 14:01
455706d to
c234774
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and result
When a secondary GPU is configured as an adaptive expert cache tier (
--peer-device N),Prefill::lm_preparecheckedcore::peer_portable()and unconditionally declined the layer-major prompt path with:strata prefill: layer-major off for this prompt: a peer GPUBecause
core::peer_portable()is globally enabled as soon as--peer-device >= 1is supplied (to flag portable host allocations across CUDA contexts), layer-major super-chunks were completely blocked, even when prefill was handled on the primary GPU (e.g.--peer-prefill-rows 0) or explicitly requested viaSTRATA_PREFILL_LAYER_MAJOR=1. Large prompts fell back to chunk-major prefill, repeatedly streaming non-resident experts across all 48 layers for each individual chunk, dropping prefill throughput down to ~60-80 tok/s on long prompts.After this change,
Prefill::lm_preparechecks whether an active peer prefill helper (m.pp) is actually attached rather than checkingcore::peer_portable(). When prefill executes on the primary card, or when layer-major is explicitly requested viaSTRATA_PREFILL_LM_FORCE=1, the layer-major super-chunk path runs layer-by-layer across all 48 layers in VRAM workspace, achieving over 1,100 tok/s prefill on long contexts without regressions or token divergence.Related discussion
none
Approach
engine/src/prefill/prefill.cpp:if (m.pp || helper_ != nullptr || core::peer_portable())with:if (helper_ != nullptr) { why = "a stage helper"; return 0; }if (m.pp && !lm_force_env()) { why = "a peer GPU prefill share"; return 0; }m.ppis not sharing prompt rows (e.g.--peer-prefill-rows 0), or when forced bySTRATA_PREFILL_LM_FORCE=1/STRATA_PREFILL_LAYER_MAJOR=1.m.ppis actively computing prefill rows andSTRATA_PREFILL_LM_FORCEis unset.--layer-split), or CPU-only prompt walks.Validation
Passed:
cmake -S engine -B build -G Ninja). Clean build ofstrata_prefill,strata_engine, andstrata.exe.--peer-device 1).--resident-experts,--vram-reserve-mib 1400.strata prefill: layer-major off for this prompt: a peer GPU11K prompt (3,123 tokens): chunk-major fallback, TTFT 5.3s (~600-700 tok/s).
strata prefill: layer-major (layers 0..48): 3118 tokens in 1 super-chunk(s) of up to 3328 (R in VRAM, 1131 MiB VRAM free before), 16497 expert blobs streamed (23821.3 MB), 4779 resident, 1352 expert groups (84 on the FP16 path, 1268 fused); 2756 ms11K prompt (3,123 tokens): 2,756 ms (~1,131 tok/s).
Failed:
Not run:
Limits
m.pp(peer-card prefill row execution) with layer-major; prompt super-chunks execute on the primary card while the peer card serves decode.