Repository navigation
[Engine] Maximize dual-GPU peer utilization with P2P shared expert, in-graph peer routing, DFlash2 peer offload, and HC Q8 DP4A v2 - #7079
Open
midhatn wants to merge 3 commits into
Conversation
…d sm_70 DP4A HC up-proj - Add opt-in Verifier dense offloads for --peer-device multi-GPU decode: STRATA_PEER_GDN_Z=1 (offloads 36 GDN attn_gate projections, ~443 MiB) and STRATA_PEER_QSA_Q=1 (offloads 12 QSA attn_q projections, ~295 MiB) onto the P2P peer GPU alongside peer experts, using mapped P2P copy kernels so multi-GPU CUDA graphs avoid in-graph cudaMemcpyAsync deadlocks. - Account for offloaded peer dense buffer headroom in PeerExperts reserve sizing when STRATA_PEER_GDN_Z / STRATA_PEER_QSA_Q are enabled. - Add opt-in STRATA_HC_Q8_DP4A=1 sm_61+/sm_70 coalesced uint4 __dp4a hyper-connection up-projection kernel (gr_up_q8_dp4a_kernel, 0 register spill, plain shared-memory loads), eliminating gr_mid_q8_kernel.
…-graph peer routing, DFlash2 peer offload, and HC Q8 DP4A v2
Contributor
Author
|
Added commit
|
…-split Under --layer-split (multi_gpu == true, !df2_first), df2.bind(...) receives &last_st->head, which already resides on the same GPU as df2.device(). Omitting !multi_gpu caused df2_head_dev to evaluate to 0 (CUDA0) instead of -1, launching gather_rows on CUDA0 reading a CUDA1 device pointer (MMU Xid 31 fault).
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
On dual
sm_70(2× Tesla V100-SXM2-16GB over NVLinkNV6) runningQwen3.8-Flash-Next-UD-IQ2_XS-v31-Q8in--peer-device 1, stockv0.2.21left peer GPU 1 at only ~17.9–19.9% decode utilization while GPU 0 spent >33 ms per speculative verification window waiting on host/device work and P2P stalls.Stacks on #7040 (
85751bae1/ cherry-picked here as the first commit) and supersedes #6210, maximizing dual-GPU decode overlap with no change to single-GPU behavior and controlled mirroredA-B-B-A(200 W / 1020 MHz / 877 MHz) verification:STRATA_PEER_SHARED=1, opt-in): copies shared-expert weights to peer GPU 1, runsshared_expert_multiconcurrently onpeer_sh_cs_during GDN/QSA residual prep, and scatters results back via NVLink.STRATA_VERIFY_DEVICE_HITS=1, opt-in): builds hit/miss slot plans directly via device kernels (verify_kernels.cu) instead of synchronous H2D/D2H bookkeeping.STRATA_PEER_IN_GRAPH=1, opt-in): fuses peer transfers and shared-expert synchronization inside CUDA Graph capture.STRATA_DF2_PEER=1, opt-in) & tune V100 peer reservation (STRATA_PEER_HOT_AT/--vram-reserve-later-mib): overlaps draft speculation cleanly while keeping primary expert slots high.STRATA_HC_Q8_DP4A=2infused_gr.cu) & P2P word copy helpers (copy_i32_from_mapped/p2p_copy_words).Measured mirrored
A-B-B-A(2 × V100-SXM2-16GB,200 W / 1020 MHz / 877 MHzclock-locked,STRATA_ROUTE_TAIL_SKIP=0):95.00 -> 105.45 tok/s(+11.0%;code_cpp28.91 vs 33.38 ms/w,prose107.5 vs 95.0 tok/s,needle64k3/3needles passing)99.75 -> 106.20 tok/s(+6.5%,html_ok=True)89.3 -> 102.1 tok/s(+14.3%)17.9% -> 44.9%median onseeded3(peak64%),19.9% -> 46.7%mean on Pagoda, with0ECC errors and0Xids.Related discussion
Stacks on #7040 (
feat/sm70-peer-dense-hc-dp4a); supersedes #6210 (closed).Approach
STRATA_PEER_SHARED=1,STRATA_VERIFY_DEVICE_HITS=1,STRATA_PEER_IN_GRAPH=1,STRATA_DF2_PEER=1,STRATA_HC_Q8_DP4A=2, plus [Engine] Offload GDN gate/QSA Q to P2P peer and add opt-in sm_70 DP4A HC up-proj #7040'sSTRATA_PEER_GDN_Z=1andSTRATA_PEER_QSA_Q=1) scoped cleanly toVerifier/DFlash2/fused_gr.cu/generate.cpp.--peer-devicepaths so default single-GPU and existing paths remain untouched.Validation
Passed:
gr_parity --selfteston2 × Tesla V100-SXM2-16GB(sm_70, CUDA 12.9, GCC 14.3.0) withSTRATA_TSUM=1 STRATA_GR_Q8_DOWN_MODE=2 STRATA_HC_Q8_DP4A=2:gr_read/gr_write: 0 failures,gr_parity OK.git diff --check origin/main..HEADon2af30ccaa: passed cleanly.A-B-B-A(n=2rounds each onseeded3+pagoda,200.00 W / 1020 MHz / 877 MHz,ECC=0,0Xids):stock v0.2.21:needle64k93.4/93.8,code_cpp107.0/108.0,prose95.0/95.0,voxel_pagoda100.7/98.8(mean99.75, GPU119.9%).6163759fa):needle64k94.8/95.0(needles_ok=True),code_cpp105.4/105.5(28.89-28.91 ms/w),prose107.2/107.8,voxel_pagoda106.3/106.1(mean106.20,html_ok=True, GPU146.7%).logs/v0221_community_abba):p4_baseneedle64k95.3/94.9,code_cpp106.0/105.9(28.74-28.79 ms/w),prose107.8/107.8,voxel_pagoda105.0/105.2.Failed:
Not run:
STRATA_DF2_PEER=1).Limits
Measured on one dual-V100-SXM2-16GB NVLink system with
Qwen3.8-Flash-Next-UD-IQ2_XS-v31-Q8. All new switches are opt-in and requireSTRATA_Q8_INPLACE=1/ P2P peer support where indicated. If #7040 merges first, this PR can be rebased cleanly ontomainto drop the stacked#7040commit.