Repository navigation
nemotron/hip: opt-in --mtp-drafts up to 15 on a lone stream - #3613
Conversation
ea1f92e to
8bfb495
Compare
|
Thanks @gilby for the deep-draft work, and for keeping the default path out of it. What's good:
Must fix:
Optional:
Device cells: Strix Halo gfx1151 (HIP): the default four-arm parity and the
|
8bfb495 to
e225a31
Compare
|
Updated #3613 on linear head
Updated sanitized receipts on |
e225a31 to
2f4eb22
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.
|
|
Thanks @gilby, and an update on our note from this morning: main has moved again, and this time our rebase stopped where it needs your call. Main has since added BF16 embeddings to Nemotron on HIP, and your second commit changes the same four files with rules that assume a quantized (affine) embedding:
Please rebase onto main, keeping main's BF16 embedding path in all four files, with your head metadata added beside it. A BF16-embedding model should still load and size as it does on main, with your MTP admission applying on top. If your head-metadata rule should replace main's 4-bit group-64 refusal for MTP sidecars, please say why here, since main's test at
|
|
Rebased onto
Receipt added to the gist ( |
2f4eb22 to
3d78afd
Compare
|
@gilby @ashhart Independent check at The rebased receipt in the thread names this head. Putting the same head and host command in the PR description beside the earlier device receipt would make it easier to choose the right revision. A local test merge against Igor Lessio - AIFLOW LABS |
|
I reran the host command on the exact #4272 train tip zig build -Dhip=true -Dcpu=apple_m1 hip-host-test check-native-hip-host test-native-hip-host test-cost-rule test-draft-hip-host --summary all -j3Exit 0, 153 tests passed and one skipped. The Linux ARM64 HIP native runner also compiled. The host flag test covers fifteen drafts for Nemotron at TP=1, three at higher TP, seven for Flash Next at TP=1, and named refusal above the supported limit. The train currently shows ten skipped hosted checks. The gfx1151 run in your receipt remains the device evidence. After #3251 landed, I trial-merged the same train into Igor Lessio - AIFLOW LABS |
Wraps eight existing public tools/*.py files from this repository so concurrent copy-heavy drafting can be measured with tools/bench_concurrent.py.
Keep the four-row window and three drafts by default (and in shared rounds and at --tp > 1), while widening a lone stream's window up to 16 rows under --mtp-drafts 4..15 with shared rounds capped at three head drafts a stream and plan rows kept at max(4 * streams, min(streams * window, 32)).
3d78afd to
808cb79
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. |
Stacked linearly on:
origin/main(8cbef9777) via #3053 (8f8b10eaa) and #3163 + #3242 + #3251 (bffae8ccf,n2-stack-base-1118)Refs #3394
Reworks #3394 on top of
origin/main(8cbef9777) and the #3053 / #3163 / #3242 / #3251 stack: keeps the default four-row verify window and three MTP drafts (--mtp-draftsunset or<= 3) untouched for latency, GTT memory and shared-round throughput, while letting--tp 1callers pass--mtp-drafts Nup to15(N + 1verify window rows, up to16) for a lone decoding stream, keeping shared multi-stream rounds capped at3head drafts a stream andplanRows(streams, window) = max(streams * default_window, min(streams * window, shared_cap_rows))(32up to 8 streams,streams * 4above 8 streams so shared batch width never drops below default). Also adds eight copy-heavy file-edit prompts (tools/bench_edit_prompts.json) forbench_concurrent.Summary of code changes
tools/bench_edit_prompts.json: eight copy-heavy file-edit prompts over existingtools/*.pyfiles.zig/src/families/nemotron/hip/{head,engine,lanes,round,native,costs,worker}.zig,zig/src/families/nemotron/hip/deep_drafts_test.zig,zig/src/native/{draft_sources_hip_test,mtp_drafts_hip_test}.zig,zig/src/hip/kernel_tests/nemotron/window.zig,zig/tests/nemotron_hip/gen.zig:head.max_depthto15andround.max_windowto16on--tp 1(mtpMostremains3when--tp > 1,--mtp-drafts 16and--mtp-drafts 4 --tp 2are refused by name before load).default_window = 4/default_drafts = 3when--mtp-draftsis unset or<= 3; widensround_windowtomin(max(drafts) + 1, 16)only when--mtp-drafts > 3on a single rank, withshared_chain_drafts = 3andplanRowsreturningmax(streams * 4, min(streams * window, 32))whenwindow > 4.costs.zig), sizes round graphs / snapshots cleanly for up to16window rows and active plan rows, documentsnative.laneBytesForaspubfordeep_drafts_test.zig, and updates unit + kernel + GPU integration tests (round.zig,deep_drafts_test.zig,window.zig,tests/nemotron_hip/gen.zigrounds).gfx1151) receipts indocs/recipes/nemotron-3.5.mdandCHANGELOG.md(no merge commits anywhere in8cbef9777..e225a31e8,git merge-tree --write-tree 8cbef9777 e225a31e8clean).Verification & default path parity on
e225a31e8(Strix Halogfx1151)e225a31e8(binary sha256163245ce783f...) atopn2-stack-base-1118(bffae8ccf, binary sha256351bea28e892...) andorigin/main(8cbef9777, binary sha25679c1988300c2...).e225a31e8:zig fmt --check zig/clean;lean_check.py221 vs 221 (0 new findings);tools/pr_check.py --base n2-stack-base-1118 --pr 36130 error(s), 0 warning(s);publish_check.py --git . 8cbef9777..HEADclean; Linuxzig build -Dfixed-cpu -Dhip=true test-host-ci-linux-hip test-cost-rule --summary all(103/103 steps succeeded; 330/333 tests passed (3 skipped)); Linuxzig build -Dhip=true hip-host-test --summary all(8/8 steps succeeded; 80/80 tests passed); macOSzig build -Dhip=true hip-host-test check-native-hip-host test-native-hip-host test-cost-rule test-draft-hip-host --summary all(24/24 steps succeeded).gfx1151(e225a31e8):zig build hip-kernel-test:22/22 steps succeeded; 219/226 tests passed (7 skipped).tf-nemotron-hip-test window --steps 16on bothLightning-30B-A3B-MLX-4bitandNVIDIA-Nemotron-3.5-Lightning-30B-A3B-oQ4e-HIP:16 rows at once and one at a time: the same bits; first differing row null, largest difference 0e0and exact snapshots/rollback.tf-nemotron-hip-test rounds --steps 16 --streams 4(32rows) androunds --steps 8 --streams 16(64rows) on both checkpoints:the same bits (0 rows differ).--mtp-drafts 16exited1(--mtp-drafts 16: the HIP engine drafts at most 15);--mtp-drafts 4 --tp 2exited1(--mtp-drafts 4: the HIP engine drafts at most 3 with --tp above 1).--mtp-draftsunset,1,2,3): zero differences vsorigin/main8cbef9777onLightning-30B-A3B-MLX-4bitafter normalizing#3242'smlx-q4g64label, load time and free GiB room; zero differences vsn2-stack-base-1118bffae8ccfon bothMLX-4bitandoQ4e-HIP.e225a31e8(TENSORFOLD_MEMORY_RESERVE_GIB=4 --host 127.0.0.1 --port 28192 --context 131072 --parallel 4 --prompt-cache-gib 0, page cache dropped before every server,performancepower mode,--reps 2,0#2984losses across all cells):Lightning-30B-A3B-MLX-4bit(origin/main8cbef9777M1/M2vse225a31e8B1/B2, idle GTT26,223,607,808B across all 4 arms,28/28bench_concurrent+28/28alone +24/24serial +8/8OpenAI +3/3cache equal):bench_cachecold TTFT (2K / 8K / 32K)0.741/0.741/0.740/0.738,2.675/2.694/2.691/2.690,13.168/13.299/13.283/13.272s;bench_concurrentT=1.0L=1,2,4124.3/124.3/124.9/124.4,133.8/131.2/133.4/132.8,166.1/165.4/165.9/166.7;T=0.0132.3/132.3/131.8/132.4,143.4/142.6/144.2/144.7,174.4/174.7/174.6/173.8;bench_openaifibonacci-raw122.84/123.00/121.64/123.23(T=1.0),123.35/124.42/122.83/123.17(T=0.0);gpu-chat94.14/93.55/91.30/93.65(T=1.0),93.51/94.79/98.37/94.91(T=0.0).NVIDIA-Nemotron-3.5-Lightning-30B-A3B-oQ4e-HIP(n2-stack-base-1118bffae8ccfS1/S2vse225a31e8B1/B2, idle GTT26,989,105,152B across all 4 arms,28/28bench_concurrent+28/28alone +24/24serial +8/8OpenAI +3/3cache equal):bench_cachecold TTFT0.746/0.741/0.745/0.739,2.704/2.693/2.710/2.692,13.332/13.280/13.385/13.290s;bench_concurrentT=1.0L=1,2,4105.0/105.0/104.9/104.8,112.8/112.9/112.4/107.2,143.8/144.5/143.9/143.7;T=0.0124.3/124.3/124.3/124.1,132.7/132.3/132.7/132.4,167.4/166.9/168.0/167.1;bench_openaifibonacci-raw100.19/100.23/100.23/101.77(T=1.0),123.09/123.12/123.06/122.84(T=0.0);gpu-chat81.06/81.11/81.11/83.12(T=1.0),92.02/91.94/91.80/91.56(T=0.0).--parallel 16 --mtp-drafts 7cell &--mtp-drafts 15identity one225a31e8(gfx1151)--parallel 16 --mtp-drafts 7vsd=3(TENSORFOLD_MEMORY_RESERVE_GIB=4 --context 16384 --parallel 16 --prompt-cache-gib 0,128reply tokens):16 streams at once(windows of 8 rows,0.57 GiB/stream ford=7vswindows of 4 rows,0.38 GiB/stream ford=3;planRows(16, 8) = 64).Lightning-30B-A3B-MLX-4bit:100/100bench_prompts(100/100alone,96/96serial) and50/50bench_edit_prompts(50/50alone,72/72serial) hashes matchd=3.bench_promptsL=1,8,16:T=0141.6/172.9/198.8(d=3) vs136.2/172.9/198.5(d=7),T=1.0119.3/172.4/194.4vs117.9/168.6/191.3;bench_edit_promptsL=1,8,16:T=0152.1/136.3/138.5vs187.5/143.1/141.8(+23.3%/+5.0%/+2.4%),T=1.0150.6/132.6/136.8vs186.1/140.4/140.1(+23.6%/+5.9%/+2.4%).NVIDIA-Nemotron-3.5-Lightning-30B-A3B-oQ4e-HIP:100/100bench_prompts(100/100alone,96/96serial) and50/50bench_edit_prompts(50/50alone,72/72serial) hashes matchd=3.bench_promptsL=1,8,16:T=0122.0/170.7/188.5(d=3) vs117.9/170.2/188.5(d=7),T=1.0117.9/160.7/184.4vs119.3/158.6/186.3;bench_edit_promptsL=1,8,16:T=0136.6/133.7/136.3vs176.6/141.8/141.1(+29.3%/+6.1%/+3.5%),T=1.0131.5/131.0/136.6vs170.4/139.0/139.7(+29.6%/+6.1%/+2.3%).--mtp-drafts 3vs15one225a31e8(--context 131072 --parallel 4 --prompt-cache-gib 0,256reply tokens):Lightning-30B-A3B-MLX-4bitandNVIDIA-Nemotron-3.5-Lightning-30B-A3B-oQ4e-HIP,28/28bench_edit_prompts(28/28alone,24/24serial),4/4bench_promptsL=1(4/4alone,2/2serial), and8/8bench_openaihashes matchd=3identically (L=1edit:149.1 -> 229.1T=1.0and149.6 -> 214.1T=0.0onMLX-4bit;133.0 -> 194.0T=1.0and134.6 -> 204.6T=0.0onoQ4e-HIP).Full opt-in deep-draft sweep (
d = 3, 4, 5, 6, 7, 11, 15,8bfb495aat--parallel 4,256reply tokens)Above eight streams only
planRowschanged after8bfb495a;--parallel 4behavior is identical, andd=3, 15were re-verified directly one225a31e8above. On8bfb495a(gfx1151,--context 131072 --parallel 4):Lightning-30B-A3B-MLX-4bit(bench_edit_promptsL=1T=1.0:149.0 / 155.2 / 165.5 / 175.6 / 184.3 / 212.6 / 229.1;T=0.0:149.6 / 155.2 / 164.8 / 175.5 / 179.4 / 207.8 / 214.0;gpu-chatT=0:98.8->94.5; idle GTT+2,243.3 MiBatd=15).NVIDIA-Nemotron-3.5-Lightning-30B-A3B-oQ4e-HIP(bench_edit_promptsL=1T=1.0:132.9 / 138.1 / 151.9 / 159.9 / 165.1 / 186.3 / 194.0;T=0.0:134.3 / 144.0 / 153.3 / 163.5 / 167.9 / 198.0 / 204.7;bench_promptsL=1T=0:124.1->120.9).8bfb495achecks also covered ROCm 10.1zig build hip-kernel-contract(SUMMARY gfx1151 164 kernels: 164 pass gates 1-4, 0 fail, 2 known findings; 45 controls: 45 red as planted, 0 missed; 26 limit problems, matching base; unchanged kernels one225a31e8) and--prompt-cache-gib 8cache reuse at--mtp-drafts 7, 11, 15x--streams 1, 2(12/12qualified,42/42reused rows equal).Checklist
zig fmt --check zig/clean and strictly linear commit history atoporigin/main8cbef9777(zero merge commits,git merge-treeclean)hip-host-test,test-host-ci-linux-hip,test-cost-rule,hip-kernel-test,tf-nemotron-hip-test window/rounds(16-row lone,32-row 4-stream,64-row 16-stream), and CLI refusals verified ongfx1151(e225a31e8)mainvse225a31e8onMLX-4bit,n2-stack-base-1118vse225a31e8onoQ4e-HIP),--mtp-drafts 15, and--parallel 16 --mtp-drafts 7verified on both checkpoints with 100% token identitydocs/recipes/nemotron-3.5.mdandCHANGELOG.mdupdated cleanly;tools/pr_check.pyandpublish_check.pyclean