Repository navigation
Conversation
cobra91
force-pushed
the
feat/expert-gpu-p2p
branch
from
November 26, 2026 10:06
76bd03f to
2545ec5
Compare
This was referenced Nov 26, 2026
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
Previously,
--expert-gpuforcedEngine::card_moe()to returnfalse, disabling CUDA graph capture and card-side routing (moe_card()) and falling back to host-routedEngine::moe()with per-layer router synchronization (router wait).This PR enables the GPU-side doorbell (
ExpertBell) for--expert-gpuacross both single-token decode (n = 1) and DSpark verification windows (n = 1..8):passes_/step_passes_) and computes all local cached experts viad_zslots_.ExpertCard) are dispatched asynchronously throughbell_serve()/bell_job()while GPU 0 runs its own experts, with GPU 1 signalingh_bell_->ackdirectly from its stream viabell_ackwhen no CPU fallback experts are needed.Approach
engine/include/strata/poly/kernels.hppandengine/src/poly/kernels.cu:ExpertBell(kBellJobs = 128,rows,row[kBellJobs]) andbell_ring()(optionalrows = 1) to carry multi-row verification windows (n = 1..8).bell_ack()kernel so GPU 1 signalsbell->ack = seqwith__threadfence_system()directly after its D2HcudaMemcpyAsyncintoh_cpu_.engine/src/poly/expert_card.hppandengine/src/poly/expert_card.cpp:ExpertCard::start()with optionaldst_rows,bell, andseqparameters to copy directly toh_cpu_and signalbell_ack()without a hostcudaStreamSynchronize()or CPU addition loop.engine/src/poly/engine.hppandengine/src/poly/engine.cpp:card_moe()andbell_on()forecard_whenn <= kCpuRows(including whenpool_is active).bell_job(uint32_t seq)to dispatchecard_misses asynchronously viabell_ack()whenn_host == 0, or overlapecard_withpool_take()andcpu_experts()when CPU fallback experts are present.Validation
main+#357): clean single-commit rebase onmain(2545ec54e), builds cleanly (strata-poly.exe, Ninja Release, CUDA 13.4sm_89;120), zero merge conflicts against#356.#356on Windows 11 (RTX 5080 16 GB + RTX 4060 Ti 16 GB PCIe Gen4 x2, 302-token prompt, 256 generated tokens,--kv fp8 --max-context 32768):1.
Inkling-2-Mini-UD-Q4_K_XL.gguf(fits across both GPUs: 99.2–99.5% VRAM hits)#356alone#356alone (--expert-gpu 1 --no-draft, host-routed)#356+ #357 (--expert-gpu 1 --no-draft, doorbell +bell_ack)#356alone (--expert-gpu 1+ DSpark, host-routed)#356+ #357 (--expert-gpu 1+ DSpark, doorbell +bell_ack)2.
Inkling-2-Mini-UD-Q8_K_XL.gguf(21.30 GiB — exceeds single-GPU VRAM, mixed-quant layers)--layer-split auto --no-draft--layer-split 18+ DSpark (onmain)Inkling 2's --draft-model runs on one cardRTX 5080) + DSpark#356+ #357 (--expert-gpu 1 --no-draft)--layer-split auto#356+ #357 (--expert-gpu 1+ DSpark)nvidia-smireports0 MiBon both GPUs after exit.Limits
n_host > 0(an expert is on neither GPU 0 nor GPU 1),bell_job()still synchronizes GPU 1 on the host to accumulateecard_and CPU outputs intoh_cpu_.native_mmvq_ids_supported()(e.g.UD-Q8_K_XLlayers 20–23),Engine::open()currently disablesh_bell_globally across all layers.