Repository navigation
native hip: size RDNA3.5 MoE lane plans to window rows and pool rising row steps - #3774
Conversation
|
Thanks @gilby. The exact window sizing and cost pooling look ready, with useful regression tests and scoped equality and paired performance receipts. The only current-main apply issue is the already noted changelog context; the source files apply cleanly. Ready to land with that routine integration.
|
6315cdc to
dc2d5fd
Compare
|
Thanks @gilby. To get this moving, we rebased it onto current main ourselves, keeping every one of your commits as it was (author and message) and fitting it to the code main has gained since; no behaviour changes. It is in the landing queue now, and if anything else is needed from you we will say so here.
|
… pool tile-step window costs Size RDNA3.5 lane-round routed MoE plan buffers in hip.moe to the round's exact row count instead of rounding up to a 16-row minimum bucket, avoiding unnecessary zero-fill and empty item dispatch padding during decode and speculative verification. Pool rising added-row deltas across each 4-row tile regime in hip_serve/costs when timing lone decode windows so load-time window costs remain concave across per-tile step boundaries.
dc2d5fd to
249a96f
Compare
|
Thank you @gilby. 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
On RDNA3.5 (
gfx1151),moe.planRowssizes lane-round (o.window) routed MoE plan buffers (pick,wts,items,members,local) to the round's exactrowsinstead ofbucket(rows) = 16, andcosts.poolWindowRowsapplies Pool Adjacent Violators pooling to rising added-row forward deltas within each four-row tile regime so tile boundary steps (m = 2 -> 3,6 -> 7) never price an earlier draft step under a later one. No GPU kernel or token changes.main(3f1290ffe).atc overlap --json: incomplete (complete: false, API/PR limits) across 3 changed files; across all 100 open PRs on GitHub,0open PRs touchzig/src/hip/moe.zigorzig/src/hip_serve/costs.zig(35 open PRs touchCHANGELOG.mdonly).git merge-tree --write-tree origin/main HEAD(8cbef9777) conflicts inCHANGELOG.mdonly; code commita4f62edf5merges cleanly withorigin/main.Checks on this head
6315cdc37(a4f62edf5code plus6315cdc37changelog), onmain3f1290ffe.python3 tools/zig/lean_check.py, on the base and on this head:221and221,0new findings.python3 tools/pr_check.py --base 3f1290ffe --pr 3774:0 error(s), 0 warning(s). Upstream publish check across3f1290ffe..HEAD: clean.zig build test test-kernel-contract test-golden fuzz-cortheon --summary allon RDNA3.5 host:756/758steps succeeded (3265/3308tests passed,42skipped,1pre-existing failure instage_hip_test.test.every staged call on HIP memory equals the reference, whole and in parts, matchingmain).zig build test -Dhip=true --summary allon RDNA3.5 host:769/771steps succeeded (1119/1139tests passed,19skipped, same1pre-existingstage_hip_testfailure).zig build hip-kernel-test -Dhip=true -Dhip-arch=gfx1151 --summary all:22/22steps succeeded (220/227tests passed,7skipped,0failed).zig testonzig/src/hip/root.zigandzig/src/hip_serve/costs.zig):119/119passed onhip/root,4/4passed onhip_serve/costs;zig fmt --checkclean.moe.planRowstoif (exact) rows else bucket(rows)failsmoe.test.planRows keeps RDNA3.5 lane rounds exact while leaving non-RDNA3.5 and non-window launches bucketedwithexpected 3, found 16(TestExpectedEqual); removingpoolWindowRowsfromcosts.windowsfailscosts.test.windows pools a rising added-row step across tile boundaries while leaving concave rows alonewithactual 11, not within absolute tolerance 0.000000000001 of expected 12(TestExpectedApproxEqAbsatcosts.zig:178).strix/hip-moe-exact-window.gfx1030,gfx1100, andgfx1201hardware (no such cards; theplanRowsunit test verifies non-RDNA3.5 chips remain bucketed, andpoolWindowRowsis chip-independent host math).Qwen3.8-27Bwas not served because it is dense (.densewhennum_expertsis absent) and does not callmoe.run.Receipt
64served cells across all 4 routed MoE checkpoints (16cells each) under#2984(LOSSES_TOTAL=0:0two-series losses).Qwen3.6-35B-A3Bgains>=2%on both pairs in10cells (+2.48%to+14.47%). Full Group 1 tables (group1_pr3774_merged.md,group1_pr3774.md,group1_pr3774_rerun.md) and runners: https://gist.github.com/gilby/0afb93436834f38d94c67fb674ddb3dd.zig/src/hip/moe.zig) and HIP serve window cost table smoothing (zig/src/hip_serve/costs.zig).6315cdc37vsmain3f1290ffe(#3242be9fe6237merged onto both base and head arms forLightning oQ4e), Zig0.17.0, HIP7.1, one Strix Halo (Radeon 8060S,gfx1151, 128 GB unified, stock12.3 GiBreserve,performancepower mode). Checkpoints:Qwen3.8-Flash-Next oQ4e;Nemotron 3.5 Lightning 30B-A3B MLX 4-bit;Qwen3.6-35B-A3B MLX 4-bit with MTP;Nemotron 3.5 Lightning oQ4e(user3892 r4).flashnext,qwen3_5MoE, andnemotronongfx1151, plus host unit tests overgfx1030,gfx1100,gfx1151, andgfx1201; could not execute ongfx1030/gfx1100/gfx1201GPUs (verified bucketed fallback in host tests).tools/bench_concurrent.py --alone --serialortoken_shaagainst"draft": false:57/57token_sha256equality,alone[42, 0],serial[24, 0]in every arm (1-discard,2-main,3-exact,4-exact,5-main) and rerun across all 4 checkpoints.1-discardthenmain/this/this/mainon fresh servers (--context 131072 --parallel 4 --prompt-cache-gib 0, page cache dropped each arm);bench_openai --tokens 256 --reps 3,bench_concurrent --levels 1,2,4 --reps 3 --alone --serial --temperatures 1.0,0,bench_cache --require-coldat2K/8K/32K. Any single-seriesSLOWERcell got one rerun of the full series per#2984: onLightning stock 4-bit, 3 noisy first-series flags (openai gpu-chat-no-think T1 -3.48%/-1.08%,T0 -0.92%/-4.11%,conc T0 x4 -0.86%/-2.42%) all passed on rerun (+0.36%/+0.11%,+0.09%/-0.07%,-0.69%/+0.87%).tools/bench_openai.py(in tok/s;pair 1=3-exact / 2-main,pair 2=4-exact / 5-main, rerun shown where run):On
Qwen3.6-35B-A3B MLX 4-bit, concurrent and cold decode also gain>=2%on both pairs in 6 additional cells:conc T1 x2+6.47% / +6.89%(117.50->125.10),conc T0 x1+3.56% / +3.71%(137.50->142.40),conc T0 x2+3.53% / +3.04%(161.40->167.10),cold 2k decode+6.29% / +6.72%(105.57->112.21),cold 8k decode+5.18% / +4.94%(95.80->100.77), andcold 32k decode+3.07% / +3.29%(61.01->62.88).bench_cache --require-coldttft_s; positive pair % means lowerttft_son head): all12coldttft_scells across the 4 checkpoints are within#2984's noise rule (-2.04%to+0.59%):Flash-Next(2K2.993->2.999-0.22%/-0.16%,8K9.591->9.790-2.04%/+0.13%,32K40.009->39.868+0.35%/+0.59%),Lightning 4-bit(0.733->0.733-0.05%/+0.38%,2.686->2.687-0.04%/+0.22%,13.491->13.472+0.15%/-0.45%),Qwen3.6-35B-A3B(0.893->0.896-0.36%/-0.34%,3.450->3.452-0.07%/-0.19%,17.414->17.437-0.13%/-0.07%), andLightning oQ4e(0.734->0.736-0.20%/+0.37%,2.679->2.684-0.19%/+0.50%,13.280->13.312-0.24%/+0.36%).Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.--drafter, no slower than without it, greedy and sampled.