Repository navigation
[WS1][CUDA][MiniMax-H3] ws1_full_h3_transformer and ws1_dual_trajectory: 33B forward/backward and rollout-vs-train control (RFC #420 stack 5/7) - #571
Conversation
|
Warning Review limit reachedThis review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry. Next included review available in 59 minutes. View limit details
|
c3cd035 to
e452447
Compare
… dual trajectory (RL-Align#571) on H100 at current branch heads
…fixed-order Triton GEMM Signed-off-by: Wenbo Ji <[email protected]> (cherry picked from commit 650e2148c6f0e5dcdef136537e0e62f745020273) Signed-off-by: Wenbo Ji <[email protected]> (cherry picked from commit d099c0b)
Signed-off-by: Wenbo Ji <[email protected]> (cherry picked from commit b41f868)
…il-closed test instead of a skip Signed-off-by: Wenbo Ji <[email protected]> (cherry picked from commit 74e5b83)
…l keys Review finding (RL-Align#568): jointly permuting x and g changed dW/dbias because the token axis was reduced in call order. All projection ops (audio in/out, text context, Q/K/V) now take an optional logical_keys [T,2|3] (negative first column = padding); rows are reduced in ascending key order with padding dropped, active keys must be unique. Key format follows RL-Align#562. Adds the reviewer's repro plus permutation/padding tests for every row and Q/K/V. Co-authored-by: Yitao Wang <[email protected]> Signed-off-by: Wenbo Ji <[email protected]> (cherry picked from commit d2941f0)
…ready ordered rows Follows the canonical-row design of RL-Align#562: the Q/K/V node of the block graph supplies (batch row, position) keys so its dW is reduced in logical order, and rows that already arrive in canonical order are reduced in place (same bytes, no gather of x and g). Co-authored-by: Yitao Wang <[email protected]> Signed-off-by: Wenbo Ji <[email protected]> (cherry picked from commit 0da0583)
…pull request Signed-off-by: Wenbo Ji <[email protected]>
Signed-off-by: Wenbo Ji <[email protected]> (cherry picked from commit eaba5efe3df971ea9d1a969f53e48f09e09ed176) Signed-off-by: Wenbo Ji <[email protected]> (cherry picked from commit 7da0574)
Signed-off-by: Wenbo Ji <[email protected]> (cherry picked from commit b45190d08fc033c7e63ad821d3918eb32dd454f6) Signed-off-by: Wenbo Ji <[email protected]> (cherry picked from commit b5536d6)
Signed-off-by: Wenbo Ji <[email protected]> (cherry picked from commit ad1925045b522772bf56f8468b23cca47f04156b) Signed-off-by: Wenbo Ji <[email protected]> (cherry picked from commit f9041e8)
Signed-off-by: Wenbo Ji <[email protected]> (cherry picked from commit b44540e)
…ody) Signed-off-by: Wenbo Ji <[email protected]> (cherry picked from commit eab901b)
… weight loader, tests, doc Signed-off-by: Wenbo Ji <[email protected]> (cherry picked from commit d12a6bb26566fae58a309e76916af9aae767d487) Signed-off-by: Wenbo Ji <[email protected]> (cherry picked from commit b316869)
…ith H100 evidence Signed-off-by: Wenbo Ji <[email protected]> (cherry picked from commit 0734a32ee0c427790a244c7f83e826ba9fe66393) Signed-off-by: Wenbo Ji <[email protected]> (cherry picked from commit c2c2270)
Signed-off-by: Wenbo Ji <[email protected]> (cherry picked from commit 1e3a2ea)
… and lint Signed-off-by: Wenbo Ji <[email protected]> (cherry picked from commit d9b0c91)
Signed-off-by: Wenbo Ji <[email protected]> (cherry picked from commit 67af796)
Signed-off-by: Wenbo Ji <[email protected]> (cherry picked from commit 2c08c25)
…age import Signed-off-by: Wenbo Ji <[email protected]>
Signed-off-by: Wenbo Ji <[email protected]>
Signed-off-by: Wenbo Ji <[email protected]>
Signed-off-by: Wenbo Ji <[email protected]>
Signed-off-by: Wenbo Ji <[email protected]>
|
🔍 OpenCodeReview found 7 issue(s) in this PR.
📄
|
|
@fusheng-ji The automated OCR review has completed. Please review and address all automated review bot findings, then push your updates. Maintainers will begin manual review after the bot findings have been addressed. |
…ness strict_boundaries now routes proj_in and proj_out through video_input_projection_fp32 and video_output_projection_fp32 (RL-Align#562, RL-Align#646) instead of leaving them on the provider's cuBLAS FP32 path, whose result depends on the row count and caused the residual single-vs-batched drift. time_embedder and norm_out stay on the provider and are reported as such. The --diag-video-projections diagnostic bound the h3_projection GEMM and is removed: with strict boundaries it would be overridden and mislabelled. The H100 numbers in the doc predate this binding and are marked as such; a rerun is still needed. Signed-off-by: Wenbo Ji <[email protected]>
…o feat/h3-projection-rows Signed-off-by: Wenbo Ji <[email protected]>
Signed-off-by: Wenbo Ji <[email protected]>
RL-Align#588) into feat/h3-token-refiner operator_trace.py and h3-operator-trace.md: take the merged RL-Align#567 version and reapply this branch's refiner stage on top. Signed-off-by: Wenbo Ji <[email protected]>
…L-Align#588) into feat/h3-full-transformer h3_full_model.py: keep both the strict boundary bindings of this branch and the diagnostic provider nodes and provider variants of RL-Align#587/RL-Align#588. Signed-off-by: Wenbo Ji <[email protected]>
|
please resolve conflicts first, thx! @fusheng-ji |
record_node filled the accumulator in from the row contract, and trace_call_from_resolution and the default split policy did the same, so a trace from block_observer always passed those checks: a run that accumulated in BF16 or used split-K would still verify as strict. They are now recorded only when the caller supplies them; an unset value is "not observed" and violations reports it. block_observer only learns the node name, so it also records the fallback state as not observed (None). violations(require_observed=False) and verify --allow-unobserved check the bindings alone, by explicit request; such a trace is not strict evidence. Reported by OpenCodeReview on RL-Align#567 after it merged. Signed-off-by: Wenbo Ji <[email protected]>
…-transformer Signed-off-by: Wenbo Ji <[email protected]>
…Align#574) into feat/h3-ws2-parallel Signed-off-by: Wenbo Ji <[email protected]>
What
audio_proj_in,audio_proj_out,context_embedder,token_refiner) bound to RL-Kernel and the provider boundaries(
proj_in,proj_out,time_embedder,norm_out) kept explicit;full_model_execution(..., strict_boundaries=True)records which boundary used which binding.h3_full_transformer.pyruns the provider twice (and the SDPA-efficient / cuBLASLt variants) and the candidate twice, with GPU-side checksum fingerprints.h3_dual_trajectory.py): the same Euler sampler runsingle(rollout-style, one sample) andbatched(train-style) and recorded as sealed trajectories;--strict-onlyand--diag-video-projectionsselect the arms. This is the rollout-vs-train control.Prior art & reuse decision
diffusers is the provider and the only reference for the full model; vLLM-Omni's rollout path and the training path are what the dual trajectory stands in for. Nothing offers a
per-step rollout-vs-train drift report, so the harness is new.
Results (H100 / Hopper)
Full 33B step time (forward + backward, gradient checkpointing, one H100) — strict graph binds
h3_full_attention(#553) inCandidateOpswhen_H3_Cis built; provider is diffusers/cuBLAS. Median of 3 repeats; torch 2.13.0+cu130,MiniMax-H3@42ed227, runnertools/validation/models/h3_full_speed.py, measured at head4f7c5d11(#575 stack, includes #571).Strict uses the bounded-workspace #553 attention kernel (not the interim quadratic
DeterministicAttentionOp); 8349 tokens fit in ~65 GiB. This is still far above provider time (launch-bound strict path plus interim projection/GEMM rows in the stack); it does not meet the “R/R step time not worse than P/P” acceptance bar.Measured on NVIDIA H100 (93 GiB, sm90), driver 580, CUDA 13.0, torch 2.13.0+cu130, pinned
MiniMax-H3@42ed227weights, at head5ae9f5eb. Strict vs provider on the 33B forward/backward (tiny request): candidate bitwise repeatableTrue, provider repeatableTrue;video output relative difference 2.07e-03, audio 1.77e-02, input-gradient relative differences 0.23, 0.23, 0.33 (BF16 provider vs FP32-accumulated candidate; gradients of a 33B network amplify rounding differences).
Rollout (single) vs train (batched) path, 4 Euler steps x 4 comparisons, three seeds:
Numbers:
reports/experiments/h3-full-transformer-h100/.Hopper pytest summary:
tests.json(142 collected, 142 passed @eb7840bb, H100 sm90).Dual trajectory on Hopper (strict, no diagnostic binding): 8/16 comparisons differ on every seed; per-step max abs on video velocity stays ~1e-5–1e-6 through step 3 (e.g. seed 33 step 3 ≈ 5.7e-06, not the B200 spike). Provider single-vs-batched drift is large from step 0 and grows each step (seed 33 step 3 provider video-velocity max 2.578 (
dual_trajectory_step_max.json)). With--diag-video-projections, strict is 0/16 bitwise equal on seeds 11/22/33 (*_diag.json). Summary:dual_trajectory_diag_summary.json.RFC H-C2 (Hopper): full strict single-vs-batched bitwise match is not claimed until walker-ai video
proj_in/proj_outrows are bound in production strict mode; the diagnostic arm shows layout drift is attributable to those rows.The provider's two paths differ at every step (H100: max abs grows from ~0.545 (step 0) to ~2.578 (step 3) on seed 33 on seed 33; the table's "first" column is step-0 only). Strict first differs by 4e-6 to 5e-6, which comes from the video
proj_in/proj_outrows (another contributor's, not bound here);with them bound only as a diagnostic the two paths are bitwise equal at every step on all three seeds. The wall-time panel includes warm-up; steady-state step time is not claimed here.
Results (B200 / Blackwell) — supplementary, not Hopper acceptance
Measured on NVIDIA B200 (179 GiB, sm100), driver 580.126, CUDA 13.0, torch 2.13.0+cu130, pinned
MiniMax-H3@42ed227weights, clean tree ateb7840bb.Tests: 141 passed, 1 failed (142 collected); the one failure is the token-refiner accuracy case inherited from #570 (
test_nodes_accuracy_repeat_batch_and_isolated[1-257],swiglunode, 0.01211 against a bound of 0.01116; see #570). The bound was not changed.tests.json.Strict vs provider on the 33B forward/backward (tiny request; the result does not depend on the seed, the three runs are identical): candidate bitwise repeatable
True, provider repeatableTrue; video output relative difference 2.29e-03, audio 2.13e-02, input-gradient relative differences 0.20 (video hidden states), 0.19 (audio), 0.33 (encoder); 638 parameter gradients, relative difference median 0.20, maximum 0.55. Peak allocated 68.2 GiB. (full_transformer_seed11.json, seeds 22 and 33 alongside.)Rollout (single) vs train (batched) path, 4 Euler steps x 4 comparisons. Cells are differing comparisons out of 16, with the largest absolute difference at steps 0 / 1 / 2 / 3 in brackets (0 = bitwise equal):
Reading the table:
proj_in/proj_outrows, which are not bound here.Root cause (B200-focused) — observed vs step-3 probe
Observed (artifact-backed):
proj_in/proj_out: strict layout drift ~1e-6 from step 0;--diag-video-projections→ 0/16 on H100 and B200.dual_trajectory_step_max.json).Euler step-3 probe (seed 33, handoff script on
pr_assets; not a #571 code commit):H100
seed33_report.json: arms A/B/C step-3 video velocity max all ~5.7e-06; delta-scale K=1000 on step-2 latent fork → ~0.53 (mechanism reference on sm90 only).B200
seed33_report.json@eb7840bb, driver 580.126, torch 2.13.0+cu130; reused strict single/batched safetensors from the B200 [WS1][CUDA][MiniMax-H3] ws1_full_h3_transformer and ws1_dual_trajectory: 33B forward/backward and rollout-vs-train control (RFC #420 stack 5/7) #571 dual-trajectory run:H100 step-3 probe retest (2026-10-23):
seed33_report.json,layerwise_report.json; pytest 142/142 @eb7840bb(tests.json).Summary JSON:
dual_trajectory_diag_summary.json.Interpretation (not Euler accumulation, and not a device sensitivity difference):
proj_in. At the step-3 input of seed 33 on B200 the two layouts' video latents differ by 1.9e-06 in FP32, and after the cast 1 of 384 elements differs (index[0,1,8], 0.40625 against 0.408203125, one bf16 step, 1.95e-03); the audio latent and every other entry latent that was checked are identical after the cast (README.md, Correction).layerwise_report.json): the relative difference of the block output is 7.1e-04 after block 0 and 0.22 after block 49 (about 300 times), growing by 1.1 to 1.3 times in most blocks; there is no single sensitive layer. The largest velocity gap, 0.62, is about 4% of the reference maximum (14.6).step_entry_bf16_audit_full.json,seed33_step3_entry_bf16_audit.json). H100 layerwise retest (2026-10-23, H100 cluster): arm A/B 5.7e-06 (layout-only); arms E/P 0 on every block because there is no bf16 cell to perturb (layerwise_report.json). The two devices are therefore not shown to differ in sensitivity; B200 seed 33 straddles a bf16 rounding boundary. H100 K=1000 (~2.6e-03 latent delta, 0.53 velocity) remains the same order as one bf16 step (1.95e-03, 0.62).conclusion_b200_style=supports_latent_accumulationis a B≪A threshold only, not a mechanism label. Dividing the velocity gap by the FP32 latent difference is not a gain of the forward (the cast removes that difference on H100 and turns it into one bf16 step on B200); the effective one on B200 is about 0.62 / 1.95e-03 ≈ 320.Status
acf52db7. The branch merges the reworked [WS1][CUDA][MiniMax-H3] ws1_one_h3_block: block 0 node-by-node replay and diagnostics (RFC #420 stack 10a/10) #586 → [WS1][CUDA][MiniMax-H3] full-model qualification: thresholds, ensemble rule and reference manifest (RFC #420 stack 10b/10) #587 → [WS1][CUDA][MiniMax-H3] generation gate: 50-block generation compare and resume check (RFC #420 stack 10c/10) #588 base (carrying the review fixes of [WS1][CUDA][MiniMax-H3] timestep_sinusoid_h3: FP32 timestep features + shared H3 harness (RFC #420 stack 1/10) #483–[WS2][CUDA][MiniMax-H3] sp_norm_adaln: sequence-parallel norm/AdaLN/gated residual, byte-equal to WS1 (RFC #420 stack 9/10) #494 attest-h328894da1); this PR's own diff against [WS1][CUDA][MiniMax-H3] token_refiner_block: two refiner blocks over the strict operator rows (RFC #420 stack 4/7) #570 is unchanged.pr_assets@ce1c63e2. Blackwell (B200) below is supplementary (includes inherited [WS1][CUDA][MiniMax-H3] token_refiner_block: two refiner blocks over the strict operator rows (RFC #420 stack 4/7) #570 B200 pytest gap and B200-only dual-trajectory amplification).Hopper (merge gate): full 33B strict/provider harness, repeatability, and dual-trajectory evidence on H100 at
pr_assets@ce1c63e2; strict layout drift ~1e-6 on unbound video projections; diagnostic binding yields 0/16 on H100.B200 (supplementary): inherits #570's single pytest fail; strict dual trajectory seed 33 step 3 ~0.62, caused by one bf16 step in one input element of the step-3 forward (1 of 384 video elements differs after the bf16 cast; with identical inputs the layouts agree to ~5e-06), then spread over the 50 blocks; H100 seed 33 has no differing element after the cast — see Interpretation and
dual_trajectory_diag_summary.json. Not a Hopper merge blocker unless maintainers require sm100 parity.History
feat/h3-token-refiner), which is synced to [WS2][CUDA][MiniMax-H3] sp_norm_adaln: sequence-parallel norm/AdaLN/gated residual, byte-equal to WS1 (RFC #420 stack 9/10) #494's head and totest-h3after [WS1][CUDA][MiniMax-H3] timestep_sinusoid_h3: FP32 timestep features + shared H3 harness (RFC #420 stack 1/10) #483–[WS1][CUDA][MiniMax-H3] h3_rmsnorm: RMSNorm with fused AdaLN modulation (RFC #420 stack 5/10) #487 merged. Merge commits only, no force-push; every commit is signed off. The set of lines this PR adds over its parent is identical to the previous head (checked line by line).end-of-file-fixerandblack(24.4.2, the pinned version) failed on two files inherited fromtest-h3(reports/experiments/h3-sigma-schedule/benchmark-4090d.json,rl_engine/_C.pyi); both are fixed once at the bottom of the stack and merged up.pr_assetscommits pinned in earlier versions of this body no longer exist (that branch's history was rewritten); the links now point at the current commit that holds the same files. Only the commit id changed; numbers and the commits they were measured at are unchanged.Tests
python -m pytest tests/models/minimax_h3/test_h3_full_model.py tests/models/minimax_h3/test_h3_token_refiner.py tests/models/minimax_h3/test_h3_operator_trace.py \ tests/models/minimax_h3/test_h3_arch_fingerprint.py tests/models/minimax_h3/test_h3_projection_rows.py tests/models/minimax_h3/test_h3_one_block.py -q # 136 passed python tools/validation/models/h3_dual_trajectory.py --checkpoint <hf_full> --seed 11 --output <dir>B200: same files, 141 passed, 1 failed (the failure is the #570
swiglucase).Measured on the synced branches (2 × NVIDIA RTX PRO 6000 Blackwell, sm120, pinned
MiniMax-H3@42ed227weights incl. block 0, each build compiled in place from the checked-out commit):672c1b36(#575, the top of this chain, contains this PR)pytest tests/models/minimax_h3672c1b36pytest tests/models/minimax_h3 tests/build tests/runtime/test_dispatch.py tests/validationSkips are environment only: no
matplotlib,diffusersorsglang; tests that need 4 or 8 GPUs (2 were visible); no full-transformer shard index; noVERL_OMNI_PATH. TheKERNEL_ALIGN_USE_FAST_MATH=1build was not run on these heads. The per-device results under Results were measured at the heads named there, before this sync.H100 (sm90) on the synced head
acf52db7(evidence:tests.json, environment header and the raw pytest logs). H100-94GB, driver 580.173.02, CUDA 13.0, torch 2.13.0+cu130, triton 3.7.1, Python 3.12, pinnedMiniMax-H3@42ed227weights incl. block 0, 4 GPUs visible, extension built in place from this commit:pytest tests/models/minimax_h3 tests/build tests/runtime/test_dispatch.py tests/validationKERNEL_ALIGN_USE_FAST_MATH=1The one default-build failure is
tests/validation/operators/test_ws1_candidate_evidence.py::test_ws1_cuda_and_triton_candidate_runtime_provenance: it asks for the strict SM90 GEMM and this build was made withoutKERNEL_ALIGN_DET_GEMM_SM90=1("refusing naive fallback"). It fails the same way on the other test machine and is not an H3 test. The fast-math build has the same failure plusTestCuda::test_unsupported_device_is_refused_at_constructionintests/models/minimax_h3/test_h3_final_adaln_out.py(#489): with the H3 kernels excluded, the op constructor raises "rl_engine._Clacks the h3_det_linear_* / h3_rmsnorm_* ops" before the SM80 check the test expects. Default-build skips (6): the 8-GPU cases (4 GPUs here),sglangnot installed, ROCm-only, CI-only extension enforcement, and the SM90 log-prob backend not compiled; fast-math skips (611) are the H3 kernel tests the build leaves out.Scope / Known limitations
Evidence priority: RFC #420 CUDA review should treat H100 / Hopper results as acceptance; B200 is additional sm100 signal only.
Strict mode is fail-closed: no TF32, no fast-math, no split-K; FP32 accumulation with one final rounding; unsupported shapes, dtypes and devices raise instead of falling back. Not part of this PR: video projections (#562), O / gate_up / down GEMMs (#554, #535), full attention (#553), ROCm, SGLang adapter, pipeline parallel. The full-model strict path still binds interim attention and O / gate_up / down stand-ins, so its step time is several times the provider's; speed is not claimed.