Repository navigation
Conversation
…PU decode window - Rebase on PR Niko1221#274 (direct hardware flag handoff opt-in via STRATA_PEER_DIRECT_SIGNAL=1) - Add system fences (__threadfence_system) on PCIe doorbells and scatter completion signals to prevent mutual wait_flag_ge deadlocks - Add all_gpu_resident check in Verifier::init and refresh_ar to gracefully disable autonomous mode when host expert fallback is required - Ensure safe pre-launch gather for PLE and propagate return status from peer_->launch_window
|
Thanks for the pull request. To keep the tracker readable, every item needs an area prefix in the title and the parts of the pull request template filled in. This one is missing:
Edit the pull request (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment Details: CONTRIBUTING.md |
|
Thanks, this follows the format now. |
|
@dailybarid Following your
|
# Conflicts: # docs/SETTINGS.md
|
Rebased/merged onto Re-verified on Windows 11 (
Context sweep (
|
--max-context |
Decode (500 tok) |
Speculation | Experts in VRAM (GPU 0 + GPU 1) |
Pinned KV RAM |
|---|---|---|---|---|
| 65,536 (64K) | 269.19 tok/s | 65 rounds, 439/439 (7.75 tok/r) |
17,750 / 24,576 (6,997 + 10,753) |
0.42 GiB |
| 131,072 (128K) | 270.72 tok/s | 65 rounds, 438/438 (7.74 tok/r) |
17,667 / 24,576 (6,913 + 10,754) |
0.84 GiB |
| 196,608 (192K) | 273.48 tok/s | 65 rounds, 438/438 (7.74 tok/r) |
17,589 / 24,576 (6,830 + 10,759) |
1.27 GiB |
| 262,144 (256K) | 225.95 tok/s | 101 rounds, 399/427 (4.95 tok/r) |
17,510 / 24,576 (6,747 + 10,763) |
1.69 GiB |
(Note: when also locking 5.70 GiB resident RAM via VirtualLock on this 32 GB Windows host under tight commit, runs at 131072/196608 hit [pinned-memory-exhausted] during verify staging allocation.)
Real filled-context checks past --kv-resident 32768 (500 generated tokens)
| Prompt filled | --max-context |
Prefill | Decode (500 tok) |
Speculation |
|---|---|---|---|---|
| 2,047 tok (2K) | 65,536 | 373.41 tok/s (412.7 engine) |
201.30 tok/s | DFlash2 --spec 8 (256 gen) |
| 40,959 tok (40K) | 65,536 (--kv q4_0) |
495.74 tok/s (82.6 s) |
237.01 tok/s | 64 rounds, 441/441 (7.89 tok/r) |
| 131,071 tok (128K) | 196,608 (--kv q4_0) |
835.97 tok/s (156.8 s) |
222.02 tok/s | 64 rounds, 441/441 (7.89 tok/r) |
| 131,071 tok (128K) | 196,608 (--kv int8) |
851.76 tok/s (153.9 s) |
231.40 tok/s | 64 rounds, 441/441 (7.89 tok/r, 2.32 GiB pinned KV) |
All runs exited 0 cleanly.
Problem and result:
On asymmetric dual-GPU setups without CUDA P2P (
p2p=0, e.g. RTX 5080 PCIe Gen5 x16 + RTX 4060 Ti PCIe Gen4 x2 on Windows 11 WDDM),--peer-device 1currently incurs per-layer host synchronization overhead (cudaStreamQuery/ CPU polling) during verify windows. OnQwen 3.8 Flash-Next(Swift-IQ2_XS), decode speed stays around 20.15–22.11 tok/s even with--resident-expertsand tuned routing.With this consolidated PR (
STRATA_PEER_DIRECT_SIGNAL=1+STRATA_PEER_AUTONOMOUS=1), dual-GPU decode jumps from 22.11 to 54.48 tok/s (2.46x) with default--mmap-experts, from 21.04 to 192.00 tok/s (9.13x) at--spec 4 --resident-experts, and reaches 232.63 tok/s (6.33 tokens/round) at--spec 8 --resident-experts --ram-keep-gib 8withSTRATA_DF_PDL=1.Related discussion:
Consolidates the
peer_experts/ autonomous dual-GPU decode work from#6419and#6815onto currentmain(c23477403). (Unrelated to#6811, which targetsinkling2.)Approach:
STRATA_PEER_DIRECT_SIGNAL=1, opt-in):PeerExperts::launch(),scatter_rows_and_signal_f32(), andsignal_stream_done()fuse row scatter with__threadfence_system()and a mapped host completion flag so the primary GPU polls in hardware without per-layer host spin-wait.STRATA_PEER_AUTONOMOUS=1, opt-in):Verifier,PeerExperts,generate.cpp), preserving autonomous mode even when experts spill beyond both GPUs.--ram-keep-gibmatter (54.48 -> 192.00 -> 232.63 tok/s):--mmap-experts,STRATA_PEER_HOT=0.45), hot experts are routed to the slower Gen4 x2 peer and uncached experts hit mmap, capping autonomous decode at 54.48 tok/s.STRATA_PEER_DIRECT_SIGNAL=1andSTRATA_PEER_AUTONOMOUS=1with--resident-experts+STRATA_PEER_HOT=0.0+STRATA_ROUTE_TAIL_SKIP=7+STRATA_ADAPT_OVERLAP=1+STRATA_ADAPT_SIGNAL=copykeeps hot experts on the primary GPU and resident in RAM, pushing--spec 4to 192.00 tok/s and--spec 8(STRATA_DF_PDL=1,--ram-keep-gib 8,5.70 GiBpage-locked) to 232.63 tok/s.--ram-keep-gib: on this 32 GB Windows 11 host, values< 8(3–6) exceedcuMemHostAllocand fall back toVirtualLock(pinned 0.00 GiB), whereas8–10achieve full page-locking (3.47–5.79 GiBpinned,17.7–20.2 ms/round). Because changing--ram-keep-gibshifts how many experts stay in RAM vs file/CPU, borderlineIQ2_XSprompts can switch between high-acceptance counting (3.88–6.33 tok/round,188–232 tok/s) and low-acceptance prose (1.07 tok/round,60.5 tok/s), while two identical runs at a fixed--ram-keep-gibremain deterministic (372/383at6,33/1385at8).--peer-deviceprofile (terminal/setup.py):asymmetric_dual_gpu_info()compares compute capability, VRAM, andpcie_link()bandwidth across a 2-GPU CUDA pair, ensures the stronger GPU is placed as primary (main), surfaces the detected asymmetry and recommended knobs, and lets users opt in via--peer-asymmetric-tune(or interactive prompt) to writeSTRATA_PEER_DIRECT_SIGNAL=1,STRATA_PEER_AUTONOMOUS=1,STRATA_PEER_HOT=0.0,STRATA_ADAPT_OVERLAP=1,STRATA_ADAPT_SIGNAL=copyintocfg["env"].Validation:
cmake -B build -S engine -G Ninja -DCMAKE_BUILD_TYPE=Release -DSTRATA_ENABLE_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES="89;120" && cmake --build build --target strata -j 8on Windows 11 (MSVC 19.51, CUDA 13.4.92), commitca426b6d9on top ofc23477403.py -m unittest tools.test_setup_peer_asymmetric tools.test_setup_pcie -v(8 tests passed: asymmetric RTX 5080 + RTX 4060 Ti detection, reversed-order stronger-primary selection, PCIe-only asymmetry tie-breaker, symmetric pair no-op, and PCIe parsing checks).sm_120+ RTX 4060 Ti 16 GBsm_89,p2p=0,Qwen 3.8 Flash-NextSwift-IQ2_XS,--peer-device 1 --kv int8 --prefill 2048,STRATA_SM120_PERF=1):0 / 0)#7310(1 / 1)--mmap-experts, default peer knobs (--spec 4,24-tok,--max-new 256)11577.8 ms)4698.8 ms)--mmap-experts,PEER_HOT=0.0,TAIL_SKIP=7,ADAPT_OVERLAP=1,ADAPT_SIGNAL=copy(--spec 4,24-tok,--max-new 500)24810.9 ms)6508.5 ms)--resident-experts, tuned knobs,--ram-keep-gib 8(--spec 4,41-tok,--max-new 500)23768.8 ms)8262.3 ms)467rounds,1.07 tok/r,17.7 ms/r,5.79 GiBpinned)--resident-experts, tuned knobs,--ram-keep-gib 10(--spec 4,41-tok,--max-new 500)23768.8 ms)2604.2 ms)129rounds,3.88 tok/r,20.2 ms/r,3.47 GiBpinned)--resident-experts, tuned knobs,--ram-keep-gib 8,STRATA_DF_PDL=1(--spec 8,41-tok,--max-new 500)2149.3 ms)80rounds,6.33 tok/r,426/453accepted,5.70 GiBpinned0 MiB / 0 MiBresidual VRAM onnvidia-smi.peer_experts/elementwise.cu).p2p=1/ NVLink) pairs were not tested on this rig.Limits:
STRATA_PEER_DIRECT_SIGNAL=1andSTRATA_PEER_AUTONOMOUS=1(as well as--peer-asymmetric-tuneinterminal/setup.py) are opt-in and preserve existing default behavior when unset.sm_120+sm_89,p2p=0); HIP/SYCL and NVLink behavior remains unverified by hardware runs here.