Repository navigation
xpu(qwen27): serve Qwen3.8-27B across TP={1, 2, 4} with DFlash2 - #3586
supernovae wants to merge 3 commits into
Conversation
|
/atc depends 3585 |
|
Thanks @supernovae. Sharding the 27B across TP 1, 2 and 4, splitting out One thing only you can do: the new
|
|
@ashhart Updated
Left the |
480167c to
28ac401
Compare
|
@supernovae, thanks for this stack. We ran #3586 at At depth, decode attention dominates a round, and #3586 keeps main's Dev runner
Served (
In the depth run (code and prose at the four depths, 8 prompts a side), drafted, One limit up front: the kernel sums in a different order and keeps attention weights in bf16, so its tokens differ from main's. #2543 rules that out upstream, even as an opt-in. So this is not a pull request. It is a branch you can use or measure if it helps:
Not run: int8 K/V on two cards, |
|
@SergiioB Thanks a lot for testing #3586 on a second hardware topology (2× Arc Pro B70 on AMD X570 PCIe 4.0 x8/x8) and confirming peer-to-peer scaling across every context depth ( Agreed on keeping For a follow-up after #3586 and #2595/#2799 land: your bandwidth finding is super clear (every tree row re-streaming the full KV prefix dominates at 32K–131K). We got |
28ac401 to
e2642be
Compare
Keep actual XPU startup calls behind the Windows compile-time guard: they instantiate Linux Level Zero loading, mmap and signal code. Preserve the existing environment assertions on every host and every Linux assertion unchanged.
|
Thanks @supernovae. To get this moving, we fixed the one thing left ourselves, keeping your two commits as they were: the zig-windows failure came from the new refusal test, which called Linux-only XPU startup code (Level Zero, DynLib, POSIX files and signals) in the Windows build. One commit in that test file keeps those calls off Windows and leaves its portable environment checks in place; production code and every Linux assertion are unchanged. The Windows test build now compiles, and the branch is rebased onto current main. #3587 and #3603 follow on top of it. Nothing is needed from you.
|
Keep actual XPU startup calls behind the Windows compile-time guard: they instantiate Linux Level Zero loading, mmap and signal code. Preserve the existing environment assertions on every host and every Linux assertion unchanged.
Keep actual XPU startup calls behind the Windows compile-time guard: they instantiate Linux Level Zero loading, mmap and signal code. Preserve the existing environment assertions on every host and every Linux assertion unchanged.
|
@supernovae, a small follow-up for after this lands, offered as a branch, not a request to change #3586.
Dev runner
The hang on 26.05 is in the runtime, and this change does not fix it. A standalone Level Zero program Our 26.40 rows load runtime 26.40 and IGC 2.42.6 side by side through |
|
Thanks @supernovae. Your side stays closed: we hold the Windows test fix and the rebase, and the follow-on stack builds on this head as planned. The separate per-rank profiling branch another contributor offered is noted for after this lands and needs nothing from you. Main has moved across the XPU files since our rebase, so we refresh it with the queue, including the usual line room in the qwen27 XPU host. Nothing is needed from you.
|
Keep actual XPU startup calls behind the Windows compile-time guard: they instantiate Linux Level Zero loading, mmap and signal code. Preserve the existing environment assertions on every host and every Linux assertion unchanged.
Keep actual XPU startup calls behind the Windows compile-time guard: they instantiate Linux Level Zero loading, mmap and signal code. Preserve the existing environment assertions on every host and every Linux assertion unchanged.
e2642be to
6801ed5
Compare
Keep actual XPU startup calls behind the Windows compile-time guard: they instantiate Linux Level Zero loading, mmap and signal code. Preserve the existing environment assertions on every host and every Linux assertion unchanged.
Keep actual XPU startup calls behind the Windows compile-time guard: they instantiate Linux Level Zero loading, mmap and signal code. Preserve the existing environment assertions on every host and every Linux assertion unchanged.
What this changes
Before: the XPU
Qwen3.8-27B(qwen3_5) runner andtensorfold-nativeservedTP=1only, andnative/xpu.zigdid not refuse--visionup front. After:xpu-qwen27andtensorfold-native serve --tp {1,2,4}shard all 64 GDN/attention layers,lm_head, and DFlash2 drafting across 1, 2 or 4 Intel Xe2 GPUs over Level Zero P2P collectives while keeping--tp 1token-identical tomain, andnative/xpu.zigrefuses--visionand unsupported--tpvalues before device access.qwen4_expTP + MTP).xpu-tp-collectives,2dcfc70802464f746342cbe2bc8bdc603e23dbf1; own commit2dcfc70..cb4ec76).atc overlap --json:0conflicts againstorigin/main(6bc82acac41737e7159f2b597b562d12bf437291) at2026-11-16T15:37:38Z(conflict: "clean",conflictFiles: 0).Checks on this head
cb4ec7660d570b71283d3301f83d7f342aa83ba2python3 tools/zig/lean_check.py, on the base and on this head:221on base (6bc82ac) — inherited,221on head (cb4ec76),0new.zig fmt --check build.zig zig&git diff --check: passpython3 tools/pr_check.py --base origin/main:0errorszig build xpu-qwen27 xpu-native test-draft-xpu-host test-xpu-refusal-host test-slide-xpu-host test-fp64-gdn-xpu-host test-qwen27-config-xpu-host test-qwen27-prompt-tail-xpu-host -Doptimize=ReleaseFast -Dngen-include=<ngen>: all steps pass (0failed)zig build -Dxpu-contract=true xpu-kernel-contract-limits xpu-contract-run:9/9pass,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 passedtf-xpu-qwen27-means-teston all 4 B70 cards (ZE_AFFINITY_MASK=0..3): prompt4.19e-7, decode2.80e-7(bound2e-6) —okM1–M5), CUDA (sm_*), HIP (gfx*), and Windows GPU checks (Linux 4× Intel Arc Pro B70 host only).Receipt
ZE_AFFINITY_MASK=0,SergiioB/Qwen3.8-27B-GPTQ-Int4-sym-G128-MTP-BF16@9d189a60e4c0ad7f9f47cd94bfa393ca10b3924e,XPU_CTX=8192 --bench=1024 32:origin/main(6bc82ac): prefill2,044 tok/s, plain decode34.1 tok/s, tokens97166 220 17 15 16 23 12 15 21 12 15 16 51 15 15 25 15 15 25 15 15 57 220 17 15 16 23 12 15 21 12 15TP=1: prefill2,051 tok/s, plain decode34.1 tok/s, tokens identical (32/32)TP=4: plain decode76.5 tok/s(2.24x), tokens identical (32/32)tensorfold-native serve --tp {1,2,4}) andxpu-qwen27forQwen3.8-27B(qwen3_5), plus XPU--visionstartup refusal.--tpCLI flag forqwen3_5on XPU (1default, accepts1,2,4;XPU_TPin standalonexpu-qwen27).6bc82acac41737e7159f2b597b562d12bf437291, headcb4ec7660d570b71283d3301f83d7f342aa83ba2, Zig0.17.0,ocloc 26.27.039122+ oneDNNngen, Linux7.3.0-10-genericx86_64, AMD EPYC Turin (DDR5 RAM), 4× Intel Arc Pro B70 (0xe223, 32 GB GDDR6 each, 230 W). Target:SergiioB/Qwen3.8-27B-GPTQ-Int4-sym-G128-MTP-BF16@9d189a60e4c0ad7f9f47cd94bfa393ca10b3924e; drafter:z-lab/Qwen3.8-27B-DFlash2@50307d4c4cde6860d4eee73e2547cd786fe8e8a4.TP=1,TP=2,2×TP=2,TP=4, and4×TP=1on 4× Arc Pro B70 (plain + DFlash2 lone tree + shared rounds); could not run Metal, CUDA, HIP, or Windows GPU.tools/bench_concurrent.py --alone --serialortoken_shaagainst"draft": false:bench_concurrent.py --levels 1,2,4,8 --tokens 64 --reps 3 --alone --serial(TP=1andTP=2) and--levels 1,2,4,8,16 --alone --serial(TP=4):failed=0, alone.unequal=0, serial.unequal=0across every cell (code&chat,T=1.0&T=0.0).TP=1matchesmaintoken-for-token and speed).tools/bench_openai.py(--tokens 64 --reps 5, DFlash2 on):fibonacci-raw(T=1.0 / 0.0):115.6 / 106.1 tok/s(81 msTTFT) atTP=1->161.2 / 153.2 tok/s(58 msTTFT) atTP=2->170.7 / 155.2 tok/s(48 msTTFT) atTP=4.gpu-chat-no-think(T=1.0 / 0.0):97.0 / 99.4 tok/s(74 msTTFT) atTP=1->138.8 / 141.9 tok/s(53 msTTFT) atTP=2->151.0 / 155.5 tok/s(45 msTTFT) atTP=4.bench_concurrent.py,codeT=1.0):1×TP=4179.5 tok/s(S=1),417.4 agg / 584.7 steady(S=8);2×TP=2721.3 agg / 1,035.8 steady(2×8=16);4×TP=11,006.9 agg / 1,422.7 steady(4×8=32).--prompt-cache-gib 0(xpu-qwen27W4A8 at512 / 2048 / 8192tokens):TP=11,636 / 2,331 / 2,427 tok/s->TP=22,438 / 3,015 / 3,088 tok/s->TP=42,690 / 3,210 / 3,203 tok/s; served TTFT drops81 ms -> 58 ms -> 48 ms.Kernel contract, only when a GPU kernel is new or changed
zig/kernels/xpu/qwen27/{glue,glue_attn,glue_quant,decode,gemm}.clparameterized by-DQ27_TP={1,2,4}and 64-byte LSC 2D block pitch alignmentQ27_GSTRIDE(Q27_TP=1preserves identical shapes and tokens tomain). All 6 registeredgluekernels (add_rmsnorm,add_rmsnorm_dec,gated_norm,swiglu,argmax,embed) pass gates 1–5 live on B70.5/5gate controls +6/6limit controls fail red as planted.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
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.--drafter, no slower than without it, greedy and sampled