Repository navigation
xpu: add Level Zero multi-GPU P2P AllReduce collectives and tf-xpu-tp-bench - #3585
Conversation
|
Thanks @supernovae. The shared Level Zero peer context and the rank-ordered FP32 reductions with contraction off look right, and 0 ULP across 2 and 4 B70s is the evidence we asked for. On your question: yes, please register the
|
|
Thanks for this stack — the shared-context design and the 0-ULP receipts look great. I tried to run TP=2 on a 2×B70 box and hit a hard topology wall that I think affects most consumer dual-card rigs, so I wanted to raise it before testing further. Setup: ASUS ProArt Z890-Creator WiFi (Arrow Lake-S, LGA1851), 2× Arc Pro B70 (0xE223), both cards in the two CPU-attached x16 slots (BIOS x8/x8 bifurcation on the CPU slot), Ubuntu 26.04.1, kernel 7.0.0-43, staged compute-runtime 26.40 + IGC 2.42.6 + L0 loader 1.21.9. Topology ( Result: Both cards work individually (26.40 driver exposes both; XMX bench hits full rate on each), so this is purely the cross-root-port P2P policy in Question: would you consider a fallback in |
|
@ashhart Registered all 9 Verification on amended commit
@munikor Thanks for testing and sharing that clean |
a56fcb1 to
aff61d1
Compare
|
Thank you @supernovae. All nine tp.cl collectives are registered with launch records and planted controls, and your bmg-g31 summary shows every kernel passing gates 1-4 with every control red as planted. The contract suite and pr_check are green. We agree with keeping this PR scoped to P2P collectives. The host-staged fallback for consumer cross-root-port boxes belongs in a separate change. This is ready to land.
|
aff61d1 to
d1025be
Compare
|
Thank you @supernovae. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes. |
What this changes
Before:
zig/src/xpu/ze.zigopened a single Level Zero device per context with no cross-GPU peer residency or collective primitives. After:ze.zigopensTP={1, 2, 4}peer devices in one shared Level Zero context (openPeers,closePeers,makeResident,sharedEvents), andtp.zig+tp.clprovide deterministic rank-ordered FP32 P2PAllReduce(1-shot direct P2P<= 512 KiBand 2-shot P2PReduceScatter+ DMAAllGather> 512 KiB) withtf-xpu-tp-bench.qwen3_5TP and xpu(flashnext): serve Qwen3.8 Flash Next (qwen4_exp) at TP={1, 2, 4} with host-RAM PLE and MTP #3587qwen4_expTP + MTP).main(6bc82acac41737e7159f2b597b562d12bf437291).atc overlap --json:0conflicts againstorigin/main(6bc82acac41737e7159f2b597b562d12bf437291) at2026-11-16T15:37:38Z(conflict: "clean",conflictFiles: 0).Checks on this head
2dcfc70802464f746342cbe2bc8bdc603e23dbf1python3 tools/zig/lean_check.py, on the base and on this head:221on base (6bc82ac) — inherited,221on head (2dcfc70),0new.zig fmt --check build.zig zig: passesgit diff --check: passespython3 tools/pr_check.py --base origin/main:0errorszig build xpu-tp-bench -Doptimize=ReleaseFast -Dngen-include=<ngen>+./zig-out/bin/tf-xpu-tp-bench: passes bit-exact rank-ordered FP32 check on 2× and 4× Arc Pro B70 (0diff on 1-shot 32 KiB and 2-shot 40 MiB paths)zig build -Dxpu-contract=true xpu-kernel-contract-limits xpu-contract-run:9/9pass gates 1–4,0fail,5/5controls red,0limit problemsumask 0022 && zig build -Dfixed-cpu test --test-timeout 20m:696/696steps succeeded (0failed)zig build -Dfixed-cpu test-kernel-contract test-golden test-gradient-serving test-qwen-serving-host test-server-security test-pull-security fuzz-cortheon:62/62steps succeeded;317/317tests passedM1–M5), CUDA (sm_*), HIP (gfx*), and Windows GPU checks (Linux 4× Intel Arc Pro B70 host only).Receipt
ze.zigsingle-deviceopenis unchanged;openPeersandTpCommare only called bytf-xpu-tp-benchin slice 1 and wired intoqwen27/flashnextin slices 2 and 3). Microbenchmark receipt on 4× Intel Arc Pro B70 (0xe223, PCIe Gen5 P2P):TP=2:3.81 µs/op(1-row20 KiBFP32),9.22 µs/op(16-row320 KiBFP32),34.89 GB/s(4,096-row40 MiBFP32); bit-exact (0diff) vs rank-ordered FP32 host reference.TP=4:8.50 µs/op(1-row20 KiBFP32,1.09 msper 128-op token),23.07 µs/op(16-row320 KiBFP32),26.89 GB/sbusbw (17.92 GB/salgbw,40 MiBFP32); bit-exact (0diff) vs rank-ordered FP32 host reference.tf-xpu-tp-benchonly in slice 1 (zig/src/xpu/ze.zig,zig/src/xpu/tp.zig,zig/kernels/xpu/tp.cl).6bc82acac41737e7159f2b597b562d12bf437291, head2dcfc70802464f746342cbe2bc8bdc603e23dbf1, Zig0.17.0,ocloc 26.27.039122(-device bmg), Linux7.3.0-10-genericx86_64, AMD EPYC Turin (DDR5 RAM), 4× Intel Arc Pro B70 (0xe223, 32 GB GDDR6 each, 230 W). Checkpoint: n/a in slice 1.x86_64host suite and Intel Xe2 (bmg-g31,0xe223) 1/2/4-GPU Level Zero tests; could not run macOS Metal, CUDA, ROCm HIP, or Windows GPU.tools/bench_concurrent.py --alone --serialortoken_shaagainst"draft": false:tf-xpu-tp-benchverifies bit-for-bit equality (0ULP difference) against strict rank-ordered (0 -> 1 -> ... -> tp-1) FP32 host reduction (#pragma OPENCL FP_CONTRACT OFF); end-to-end served--alone --serialreceipts are in slices 2 and 3.Qwen3.8-27BTP=1matchesmaintoken-for-token at34.1vs34.1 tok/splain decode and2,051vs2,044 tok/sprefill).tools/bench_openai.py: n/a in slice 1 (see slices 2 and 3).Kernel contract, only when a GPU kernel is new or changed
zig/kernels/xpu/tp.cl(tp2_allreduce_f16,tp4_allreduce_f16,tp2_rs_f16,tp4_rs_f16,tp2_allreduce_bf16,tp4_allreduce_bf16,tp2_allreduce_f32,tp4_allreduce_f32,tp4_rs_f32; replaces none; WG=256, subgroup=16, 0 SLM, 0 spills). Note:zig/src/core/contract/xpu_records.zigcurrently covers single-devicegluekernels only; multi-device P2P collectives requireopenPeersacross>= 2GPUs and are verified intf-xpu-tp-bench(agreed XPU contract scope requested in XPU (Arc Pro B70): Level Zero P2P tensor parallelism (TP=2, 4) for Qwen3.8-27B and Qwen3.8 Flash Next (qwen4_exp) #3583).5/5gates 1–4 controls +6/6limit controls) run and fail red as planted;tf-xpu-tp-benchchecks bit-exact FP32 rank-order sums across all elements.SUMMARYline and exit status:xpu-contract-run(exit0):SUMMARY bmg-g31 0xe223 9 kernels: 9 pass gates 1-4, 0 fail, 0 known findings; 5 controls: 5 red as planted, 0 missed; 0 limit problems; gates 5558 ms, limits 1 msM1–M5, NVIDIAsm_80/86/89/120/121, AMDgfx1030/1100/1151/1201.Checklist