Repository navigation
h3: MiniMax-H3-Image's prompt path and image decoder on CUDA, with their selftests and timings - #3733
Conversation
|
Thanks @plotarmordev. The CUDA prompt and decoder tools are clearly scoped, and the GB10 selftest receipts are useful. I read the diff against current main. Here is what we need before it can land:
|
|
Thank you @plotarmordev. The CUDA prompt and decoder selftests and their GB10 receipts are useful, and the description now records the limits run and green CI at the code head. Three things remain. The diff still carries the Metal image stack and the h3_image test files that #3718 also adds, so please rebase to the CUDA-only commits and tell us which h3_image_prompt.zig version should land given the rope() call. Please also confirm whether the separate h3_core module is still needed now that main's root exports the same files. Last, post a main-against-branch run of one existing clip case showing identical velocities, or say why that is not possible.
|
|
I checked the separate In scratch, pointing The trial merge against Rechecked After #2766 landed at Igor Lessio - AIFLOW LABS |
…eir selftests and timings The net change of ashhart#3733 at 5855d56 over its merge base 6d0a128, as one commit: the branch's merge commits hold changes of their own.
5855d56 to
8c4435d
Compare
|
Thanks @plotarmordev. The CUDA prompt and image-decoder tools still add real functionality over main, and the updated limits output answers our earlier record question. Main has since gained H3's Metal side, so this branch now overlaps it and conflicts in ten paths. Before we can review it for landing:
|
8c4435d to
096c2f4
Compare
…eir selftests and timings The net change of ashhart#3733 at 5855d56 over its merge base 6d0a128, as one commit: the branch's merge commits hold changes of their own.
|
I checked the new zig build test-h3-image-prompt test-h3-image-prompt-host test-h3-image-decoder-host test-h3-geometry -Dcpu=apple_m1 -Doptimize=ReleaseSafe -j3 --summary all
zig build tf-h3-image-prompt-cuda tf-h3-image-decoder-cuda -Dtarget=aarch64-linux-gnu -Dcpu=baseline -Doptimize=ReleaseSafe -j3 --summary allThe merged diff still carries Igor Lessio - AIFLOW LABS |
|
Merged current main into the branch in 6e0c1f3 (a merge commit; I don't rebase or force-push this branch).
Checked at this head: macOS host checks pass ( Asks 3 to 5 are still to come. Those are planted controls for the 19 kernels, the clip-velocity comparison against main, and the GB10 selftests, contract and CI results. I'll post them when they've run. |
|
Follow-up on asks 3-5 (1 and 2 are in my previous comment). Head 3. Planted controls. Each control fails gate 3, for example 4. Clip velocities. I can't run this here. The only clip-velocity tool is 5. Same run on the GB10. The job script was committed on top of
CI at |
|
Thanks @plotarmordev. The code asks are met, and we'll handle the rebase. One small thing blocks our push check: line 26 of
|
…eir selftests and timings The net change of ashhart#3733 at 5855d56 over its merge base 6d0a128, as one commit: the branch's merge commits hold changes of their own.
2f5e1ca to
c433b79
Compare
…eir selftests and timings The net change of ashhart#3733 at 5855d56 over its merge base 6d0a128, as one commit: the branch's merge commits hold changes of their own.
… decoder on core/root.zig Main's Metal image tools, recipe, h3_image_prompt.zig and tests win every add/add conflict. The separate h3_core module is gone: every H3 tool takes core/root.zig, which owns picture, picture_writer's resample and qwen_vl.rope; checkpoint_fixture comes from core too. The decoder's weights/read/synthetic helpers live once in image_decoder.zig, shared by Metal, CPU and CUDA. Unused qwen_copy.zig, h3_image_metal.zig and Tensors.span dropped.
…prompt kernel (19)
…ean, stale limits are main's)
…tract's state on TOP
The full GB10 contract never finishes on TOP: moss's tf_md_conv3x3 float64 shapes reference runs past 75 min. kernel-contract -tf_md_conv3x3 runs every other kernel's gates and controls, the back and after suites and every limit record.
…opped at 45 min in window_rows)
c433b79 to
87fa691
Compare
|
Thank you @plotarmordev. 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
MiniMax-H3-Image's prompt path and VAE image decoder run on the H3 CUDA blocks, so a Spark with no Metal and no PyTorch can run both stages:
tf-h3-image-prompt-cudaruns Qwen3-VL to layer 50 and the token refiner, one layer's weights uploaded at a time.tf-h3-image-decoder-cudaruns the VAE in bf16 over batched tiles.tf-h3-image-prompt-host,tf-h3-image-decoder-host) are independent reference implementations.Same prompt, seed 42, six distilled steps, BF16 throughout, one GB10:
The GB10 run's lines, each of the 24 blocks and every prompt gate, are in
docs/receipts/h3-image-cuda-gb10-0bfee52e, built at0bfee52e.lead/h3-image-t2i), and builds on h3: MiniMax-H3-Image's prompt path on Metal: Qwen3-VL to layer 50 and the token refiner (tf-h3-image-prompt) #2779, h3: MiniMax-H3-Image's edit encoder on Metal in fp32 (tf-h3-image-encoder) #2778, h3: MiniMax-H3-Image's VAE rules on the host, and Pillow's Lanczos-3 in core/picture #2775 and h3: MiniMax-H3-Image's transformer on Metal from a picture case (tf-h3-image) #2766. This addsa943c1ff2,1c9fb6994,b9ebb4f42,bca49309e,d329fd2e,6740eb813,4b417437e,ed4bd2596,c521d8fb4,4cbdc547d,e18d79edb,3a96a0695,b33804c72,6b0187f65,d27c6e13b,ff2300f07,0bfee52e8,bb0ee4988andb4c6b8a15, merged onto h3: MiniMax-H3-Image's text to image end to end: the prompt tool writes the canvas and the seed's starting rows #2781's head (fa0e45c).atc overlap --json: no open pull request touches the new files; the scan was incomplete at its time limit. Other local worktrees share 51 files with this branch, none of them the files this branch adds.Checks on this head
5855d56a3; the code is5ef2a963bplus the limits receipt line.python3 tools/zig/lean_check.py: 221 problems on this head against 221 onmain, zero new; all 221 are inherited.zig build test test-golden: 902 of 905 steps, 7,182 of 7,247 tests passed, 64 skipped, 1 failed. The failure isstage net's unknown-host test, which expectsAddressUnresolvedand getsAddressInUsebecause this Mac's resolver answers.invalid; it fails identically onmainhere and is unchanged by this branch.test-goldenhas 55 of 55 equal to the server goldens.zig build compile-cuda-tests -Dtarget=x86_64-linux-gnu: pass.zig build test-contract-images-host: pass.zig fmt --checkon every changed Zig file andgit diff --check: clean.0bfee52eevery job passed butzig, whose lean step found the seven comments this head makes one line; every job passed at5ef2a963, the code head.0bfee52eplus the job script: both selftests pass.zig build kernel-contractpasses gates 1 to 4 for all 685 kernels but exits 1 (TestFailed) on 188 limit problems; see theSUMMARYbelow.kernel-contract-limitsexited 1 with 28 stale records, every kernel within its bounds: 10 wereh3p_normandh3p_heads, whose records this head replaces with that run's measurements; the other 18 (fn_row_topk,tf_exl3_prompt_gu,tf_exl3_prompt_down,tf_q35_gdn_slots_*) are inherited frommain.5ef2a963(that commit plus the job script), GB10:tf-cuda-test kernel-contract-limits zig-out/fatbinchecks every record against the fatbins and exits 1 only on the 18 stale records inherited frommain;h3p_normandh3p_headsare current on all five SMs, and noh3p_*orh3d_*entry is stale:kernel-contract's live gate 5 against the updated records needs another GB10 run.Receipt
0bfee52e, Zig 0.17.0, nvcc 13.0, an NVIDIA GB10 (sm_121, driver 580.173.02); synthetic weights, no checkpoint.Kernel contract
h3d_post_quant,h3d_embed,h3d_rms_norm,h3d_layer_norm,h3d_linear,h3d_finish,h3d_heads,h3d_attention,h3d_swiglu) and the prompt's ten (h3p_norm,h3p_heads,h3p_attention,h3p_glu,h3p_add,h3p_scatter_add,h3p_embed,h3p_splice,h3p_linear,h3p_round); none replaces an engine kernel.SUMMARYline and exit status, GB10 at0bfee52e, exit 1 on limits:mainkernels with no compiled usage recorded (qwen4_*,qwen35*,nvfp4_experts_tile,exl3_experts,flashnext_mtp) and 3 are live launches ofmainkernels recorded as 0 (fn_row_topk,tf_exl3_prompt_gu,tf_exl3_prompt_down). The other 2 areh3p_normandh3p_headson sm_121, measured at 27 and 40 registers against stale records of 25 and 38; this head sets both records to that run'sRECORDlines, and the limits-only run at5ef2a963checks them current on all five SMs (see Checks).Checklist
The inference checklist does not apply: these are tools beside the engine, and no token path changes.