Repository navigation
[WS1][CUDA][MiniMax-H3] runtime modes, ablation overlay, Diffusers adapter, training provider, LoRA gate (RFC #420 stack 6/7) - #574
Open
fusheng-ji wants to merge 30 commits into
Conversation
fusheng-ji
requested review from
EthanZero2Hero,
Flink-ddd,
KJLdefeated,
bitborne,
inaniloquentee and
ryankert01
as code owners
October 22, 2026 16:58
|
Important Review skippedToo many files! This PR contains 160 files, which is 60 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.
|
…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)
…g provider, LoRA gate and CPS transition RFC RL-Align#420 rows h3_runtime_modes, h3_ablation_overlay, diffusers_runtime_adapter_h3, h3_training_provider and h3_lora_gradient_gate, plus the layout-invariant CPS transition the training provider uses. full_model_execution gains native_boundaries so a run can keep selected boundary modules on provider arithmetic (ablation). Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com> (cherry picked from commit 65d7fff)
… 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)
JSON and figure: runtime modes, LoRA gradients against FP64, CPS transition against the scheduler formula and verl-omni, and the 33B model under off / strict / audit / ablations. Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com> (cherry picked from commit 3f0bbe6)
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 81515ae)
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)
Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com> (cherry picked from commit 58b724b)
…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)
….path Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com>
fusheng-ji
force-pushed
the
feat/h3-runtime-integration
branch
from
October 22, 2026 21:04
58b724b to
af3dcae
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>
fusheng-ji
added a commit
to fusheng-ji/RL-Kernel
that referenced
this pull request
Oct 23, 2026
…jectory diag summary - h3-fingerprint-trace-trajectory-h100/tests.json (77 passed, eab901b) - environment.json for RL-Align#574/RL-Align#575 H100 adapter reproducibility pins - dual_trajectory_diag_summary.json (H100/B200 diag strict 0/16 on seeds 11/22/33) Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com>
fusheng-ji
added a commit
to fusheng-ji/RL-Kernel
that referenced
this pull request
Oct 23, 2026
…with the H100-pinned vllm-omni and verl-omni Same heads (af3dcae, 4f7c5d1), with vllm-omni 12e92800 and verl-omni efb9dc7f as recorded in the H100 environment files, replacing the first B200 run that used newer checkouts. Test summaries record the dependency revisions. 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>
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
h3_runtime_modes:RL_KERNEL_MODEstrict / audit / auto / off decides whether the RL-Kernel graph is bound; strict raises instead of falling back, audit reports the fallback; the case id isR/R(strict, audit) orP/P(auto, off).h3_ablation_overlay:AblationOverlay.parse("node:attention,boundary:token_refiner")keeps selected block nodes or boundary modules on provider arithmetic inside a strict run; the run is labelledablation(...), neverR/R; unknown names are rejected.full_model_executiongainsnative_boundariesfor this.diffusers_runtime_adapter_h3:H3DiffusersAdapterbindsMiniMaxH3Transformer3DModelfor the duration of awith adapter.active():block, forward and backward (so checkpoint recomputation sees the same operators), and reports what was bound.h3_training_provider:H3TrainingProvidergives the actor side astep()scope plus a per-sample transition.h3_lora_gradient_gate: a LoRA over a strict projection trains bitwise repeatably, forward rows do not depend on batching, the base stays frozen, and the gradients are FP64-close.transition.py(used by the training provider, not a separate RFC row): thecps,noise_level=0.8step with layout-invariant per-sample noise.Prior art & reuse decision
rl_engine/runtime/policy.py(RL_KERNEL_MODE, #361 pattern)AblationOverlaypattern of #230FlowMatchSDEDiscreteSchedulersample_previous_step(sde_type="cps")Results (H100 / Hopper)
Measured on NVIDIA H100 (93 GiB, sm90), CUDA 13.0, torch 2.13.0+cu130, pinned
MiniMax-H3@42ed227weights, at headaf3dcaef. Runner:tools/validation/models/h3_runtime_report.py. Data and figure on the fork'spr_assetsbranch (report.json, figure.png, environment.json).LoRA gradient gate (3 shapes, N x K x T up to 5120 x 5120 x 33): bitwise repeatable, forward rows independent of batching, base frozen in all three. Relative error to FP64 autograd: dA 4.3e-7 .. 1.3e-6, dB 3.9e-7 .. 1.3e-6, dX 1.7e-3 (BF16 input rounding), forward 1.7e-3.
CPS transition (B x tokens x channels: 3x257x96, 4x4096x96, 2x8192x32):
prev_sampleandprev_sample_meanare bitwise equal to the scheduler formula and, with the verl-omniFlowMatchSDEDiscreteScheduler(cps,noise_level=0.8), bitwise equal in the mean. Log-prob max relative difference to the scheduler'storch.mean: 5.8e-6 / 1.5e-4 / 7.5e-5 (fixed-order GEMM reduction vs torch reduction, FP32 rounding). Each sample is independent of the batch (bitwise) and scoring a stored rollout reproduces the sampling log-prob (bitwise) in all three.Runtime modes on the 33B model (forward + backward through
H3TrainingProvider, request sizes 12, 925, 4253 and 8349 tokens; relative difference to a firstoff(provider) run):node:attentionnativeboundary:token_refinernative8349 tokens (video / audio / input grad; second provider run: 0 / 0 / 1.5e-2): strict 5.29e-3 / 1.95e-2 / 0.154 with
h3_full_attention(#553) on #575 (4f7c5d11);node:attentionnative 5.31e-3 / 1.94e-2 / 0.158 (still on interim attention on this branch).auditgives the same bits asstrict.CUDA out of memoryin the interimDeterministicAttentionOpbackward (FP32 attention matrix). The 8349-token strict numbers in the table were taken withh3_full_attention([WS1][CUDA][MiniMax-H3] Add batch-invariant full attention #553) on the stacked branch [WS1][CUDA][MiniMax-H3] checkpoint mapper and the vLLM-Omni rollout adapter (RFC #420 stack 7/7) #575 at head4f7c5d11(video 5.29e-3 / audio 1.95e-2 / input grad 0.154; bitwise repeatable).boundary_bindings), includingproj_in,proj_out,time_embedderandnorm_outasprovider.No timing is claimed here; the speed of the underlying rows is in their own PRs.
Results (B200 / Blackwell)
Measured on NVIDIA B200 (179 GiB, sm100), driver 580.126, CUDA 13.0, torch 2.13.0+cu130, pinned
MiniMax-H3@42ed227weights, clean tree ataf3dcaef. Optional dependencies for the two comparison tests are pinned to the revisions recorded for the H100 run (environment.json): vLLM-Omni12e92800and verl-omniefb9dc7f.Tests: 19 passed (19 collected), none skipped, including the scheduler comparison against verl-omni (
VERL_OMNI_PATHset);tests.json. Report:report.json.strict,audit,auto,offbind and report as intended (R/R for strict and audit, P/P for auto and off).prev_sampleand mean bitwise equal, batch invariant, scoring reproduces the sampled log-prob in all 3 shapes; the mean is bitwise equal to verl-omni's and the largest log-prob relative difference to it is 5.8e-06, 1.5e-04, 7.5e-05 (shapes B3 x 257x96, B4 x 4096x96, B2 x 8192x32).The input-gradient columns moved by up to about 8% between two B200 runs of this PR (strict at 925 tokens: 0.1339 in the first run, 0.1345 here; the P/P column, which compares the provider with itself, 0.0127 and 0.0136), so part of that column is run-to-run variation of the provider's backward; this was not investigated further. The log-prob difference to the provider is 0 in every row. Ablations that put attention or the token refiner back on the native path give differences of the same size as strict (in the report).
Not run on B200: the 8349-token strict / audit rows, which need the
h3-flash-attention-v1binding that is not in this PR (see the H100 section).Tests
tests/models/minimax_h3/test_h3_runtime_integration.py(19 tests; the measurements above are fromtools/validation/models/h3_runtime_report.py): runtime modes and the environment variable, overlay parsing and validation, adapter off / strict / audit, transition (scheduler comparison needsVERL_OMNI_PATH; skipped without it), LoRA gate and FP64 check. All 19 pass on H100 with a verl-omni checkout (18 pass and 1 skips without it). The #571 chain regression (refiner, projection rows, one block, full model) still passes.B200: 19 passed, with
VERL_OMNI_PATHset.Scope & Known limitations
cpslaw (noise_level=0.8); if the recipe changes it, onlytransition.pyand its test change. Maintainer: is this the law to pin?