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/5) - #571
Open
fusheng-ji wants to merge 24 commits into
Conversation
fusheng-ji
requested review from
EthanZero2Hero,
Flink-ddd,
KJLdefeated,
bitborne,
inaniloquentee and
ryankert01
as code owners
October 22, 2026 12:19
|
Important Review skippedToo many files! This PR contains 155 files, which is 55 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.
|
fusheng-ji
force-pushed
the
feat/h3-full-transformer
branch
from
October 22, 2026 14:37
c3cd035 to
e452447
Compare
fusheng-ji
added a commit
to fusheng-ji/RL-Kernel
that referenced
this pull request
Oct 22, 2026
… dual trajectory (RL-Align#571) on H100 at current branch heads
…fixed-order Triton GEMM Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com> (cherry picked from commit 650e2148c6f0e5dcdef136537e0e62f745020273) Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com> (cherry picked from commit d099c0b)
Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com> (cherry picked from commit b41f868)
…il-closed test instead of a skip Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com> (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 <75578057+walker-ai@users.noreply.github.com> Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com> (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 <75578057+walker-ai@users.noreply.github.com> Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com> (cherry picked from commit 0da0583)
…block 0 node-by-node and 50-block/generation gates Squashes the one-block branch (its row-by-row history: timestep sinusoid, RMSNorm, AdaLN rows, sequence/tensor parallel norm rows, final AdaLN, one block, 50-block qualification) onto the current test-h3 so the pull request carries a reviewable, signed history. RFC RL-Align#420. Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com>
…pull request Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com>
Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com> (cherry picked from commit eaba5efe3df971ea9d1a969f53e48f09e09ed176) Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com> (cherry picked from commit 7da0574)
Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com> (cherry picked from commit b45190d08fc033c7e63ad821d3918eb32dd454f6) Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com> (cherry picked from commit b5536d6)
Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com> (cherry picked from commit ad1925045b522772bf56f8468b23cca47f04156b) Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com> (cherry picked from commit f9041e8)
Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com> (cherry picked from commit b44540e)
…ody) Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com> (cherry picked from commit eab901b)
… weight loader, tests, doc Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com> (cherry picked from commit d12a6bb26566fae58a309e76916af9aae767d487) Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com> (cherry picked from commit b316869)
…ith H100 evidence Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com> (cherry picked from commit 0734a32ee0c427790a244c7f83e826ba9fe66393) Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com> (cherry picked from commit c2c2270)
Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com> (cherry picked from commit 1e3a2ea)
… and lint Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com> (cherry picked from commit d9b0c91)
Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com> (cherry picked from commit 67af796)
Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com> (cherry picked from commit 2c08c25)
…age import Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com>
Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com> (cherry picked from commit e452447)
fusheng-ji
force-pushed
the
feat/h3-full-transformer
branch
from
October 22, 2026 21:04
e452447 to
eb7840b
Compare
fusheng-ji
added a commit
to fusheng-ji/RL-Kernel
that referenced
this pull request
Oct 23, 2026
…#567 RL-Align#568 RL-Align#570 RL-Align#571 RL-Align#574 RL-Align#575 Test summaries (tests.json), runner outputs and figures measured on NVIDIA B200 (sm100), driver 580, CUDA 13.0, torch 2.13.0+cu130, MiniMax-H3@42ed227, clean trees at the PR heads eab901b, 3cf51bf, 6de320d, eb7840b, af3dcae and 4f7c5d1. Figures use B200 axis labels. No host names, paths or scheduler identifiers. Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com>
Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com>
Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com>
Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com>
Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/5) #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, mcml): 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
Hopper (merge gate): full 33B strict/provider harness, repeatability, and dual-trajectory evidence on H100 at
pr_assets@d38c2a87; 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.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).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.