Repository navigation
Conversation
|
It hasn't been merged yet, but STRATA_PEER_DIRECT is on by default, so the flag handoff runs on the default peer path, not just with STRATA_P2P_DECODE_SCATTER=1. With it, the greedy answers on two cards will differ from main's and can change from run to run, while with STRATA_PEER_DIRECT_SIGNAL=0 they will match main so it looks like a race. STRATA_PEER_DIRECT_SIGNAL is also missing from the settings register so the register check will fail. Could you make it opt-in, find the race and register the variable? |
b56d415 to
aed5648
Compare
|
Thanks for catching all three — fixed and re-verified on
|
aed5648 to
cd0e7ea
Compare
…PU decode window - Rebase on PR simplexai-labs#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
…PU decode window - Rebase on PR simplexai-labs#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
cd0e7ea to
f80e2dd
Compare
|
Thanks a lot for merging #356, #357, and #315 in Totally understood on keeping the non-poly core files in sync with upstream. That said, we no longer submit PRs to Given how recurring this issue has been across several PRs, we also decided to close and wipe the contents of our PRs on No issue at all closing #274 (and #277) here given your sync policy, and we'll keep focusing our dual-GPU and What I compare on Strata fork actually:
And if your goal is to keep up with upstream developments, then I don’t understand... Why create a "fork" and launch your own project, rather than simply submitting all your "pull requests" (PRs) directly to the Strata project—as you ultimately encourage me to do? |

Problem and result
Builds on PR #272 (
pr-p2p-fused-scatter).Even with
STRATA_P2P_DECODE_SCATTER=1and user-space completion polling (h_done_seq_), the host pool thread still waits for the peer GPU to finish before raising*flag = wanton the primary GPU's verify stream:h_done_seq_*flag = wantWhen a layer has zero CPU experts (
!any_cpu && d.remote_count == 0) anddirectP2P scatter is active (STRATA_P2P_DECODE_SCATTER=1), there is no host work left to wait for. This PR lets the peer GPU's last scatter block write*flag = wantdirectly viacudaHostGetDevicePointer(d_target_flag_) after__threadfence_system(), allowingPeerExperts::finishto return immediately (zero CPU wait) andVerifier::run/serviceto skip raising*flagredundantly.Use-case impact & zero-regression guarantees
--peer-devicewith P2P direct scatter (STRATA_P2P_DECODE_SCATTER=1), eliminating the CPU round-trip between peer scatter completion and primary GPU wakeup on GPU-resident layers.PHB, staged D2H,--layer-split, HIP, Metal, SYCL, CPU):direct == true(STRATA_P2P_DECODE_SCATTER=1+p2p()+direct_mode()),!any_cpu,d.remote_count == 0,d_target_flag_ != nullptr, andSTRATA_PEER_DIRECT_SIGNALis not0.!direct(staged D2H or non-P2PPHB),flag_targetstaysnullptrsoPeerExperts::finishalways executes its hostmemcpyfromh_out_intooutnormally.STRATA_PEER_DIRECT_SIGNAL=0.Approach
engine/include/strata/core/verify.hpp&engine/src/program/generate.cpp: ExposedVerifier::h_flag()and bound it viapeer.set_target_flag(ver.h_flag()).engine/include/strata/core/expert_source.hpp&engine/src/core/expert_source.cpp: Addedwant_flag/peer_signals_flagonGpuPlanSink, checked!any_cpubeforepeer.launch, and skipped host*flag = wantinverify.cppwhensink_.peer_signals_flagis set.engine/include/strata/kernels/elementwise.hpp&engine/src/kernels/cuda/elementwise.cu: Extendedscatter_rows_and_signal_f32to optionally write*flag_ptr = flag_valafter__threadfence_system()on the final block.engine/include/strata/core/peer_experts.hpp&engine/src/core/peer_experts.cpp: Addedset_target_flagandsignaled_target_flag(), guarded strictly ondirect && direct_signal_env && want_flag > 0.Validation & Gains
Testbed: Windows 11, Ninja + CUDA 13.4 (
sm_89;120),RTX 5080 16 GB+RTX 4060 Ti 16 GB(PCIe Gen4 x2)Workload:
Swift-Qwen3.8-Flash-Next-GSQ-RCO-IQ2_XS(--peer-device 1 --kv q4_0 --spec 4 --resident-experts --resident-budget-gib 8, 511-token prompt, 64 generated tokens,STRATA_P2P_DECODE_SCATTER=1)upstream/main)20.65 tok/s3099.2 msSTRATA_P2P_DECODE_SCATTER=1, CPU wait)21.67 tok/s2952.9 ms+4.9%direct hardware flag handoff)22.87 tok/s2798.1 ms+10.8%+5.5%strata peer: direct hardware flag handoff enabled.