Repository navigation
[WS1][CUDA][MiniMax-H3] runtime modes, ablation overlay, Diffusers adapter, training provider, LoRA gate (RFC #420 stack 6/7) - #574
Conversation
…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 <[email protected]> (cherry picked from commit 65d7fff)
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 <[email protected]> (cherry picked from commit 3f0bbe6)
Signed-off-by: Wenbo Ji <[email protected]> (cherry picked from commit 81515ae)
Signed-off-by: Wenbo Ji <[email protected]> (cherry picked from commit 58b724b)
….path Signed-off-by: Wenbo Ji <[email protected]>
58b724b to
af3dcae
Compare
…#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 <[email protected]>
…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 <[email protected]>
…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 <[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]>
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. |
|
please resolve conflicts first, thx! @fusheng-ji |
…, RL-Align#588) into feat/h3-runtime-integration Signed-off-by: Wenbo Ji <[email protected]>
proj_in and proj_out are strict boundary rows since the full-transformer harness binds the video projections, so an overlay may name them; norm_out stays on the provider and is still rejected. Signed-off-by: Wenbo Ji <[email protected]>
…untime-integration Signed-off-by: Wenbo Ji <[email protected]>
…Align#574) into feat/h3-ws2-parallel Signed-off-by: Wenbo Ji <[email protected]>
…mapper-vllm Signed-off-by: Wenbo Ji <[email protected]>
LoRA on the six recipe targets of every H3 block, on the h3-parallel-v1 projections, with every cross-rank sum on the 8 canonical units, so TP 1/2/4/8, SP and CP give the canonical Grid(1, 1) bytes: - column-parallel (Q/K/V; FFN-in, whose hidden and gate halves share one A): A whole on every TP rank, B cut by output rows like the base; z = x A^T and the forward need no collective; dz = s * sum_N dy B is the base dX's unit tree, all-reduced in the same tree; - row-parallel (O, FFN-down): A cut by input columns like the base, B whole; z = sum_K x A^T is the base's unit tree, all-reduced (also under SP); dz, dB and the A shard's gradient need no collective; - CP: dA and dB from the rows of every CP rank, gathered exactly. A and B may be BF16 (the recipe's adapters); they are read as FP32 and their gradients are rounded once. A column-parallel forward is bitwise #574's strict_lora_linear; elsewhere the canonical run sums the 8 units and is as close to FP64 as strict_lora_linear. Harness: h3_lora draws a seeded LoRA per block (A ~ N(0, 1/r), B random or zero) and cuts each rank's shards; run_tp_block_rows(lora=) runs the LoRA projections and records the shards as gradient leaves; parallel_model_execution reads them from the block (_rlk_tp_lora); the full-model runner gains --lora-rank/--lora-alpha/--lora-seed/ --lora-b-zero and compares every LoRA shard's gradient. Also lora_counted (each tensor counted once in a norm) and to_rollout_layout (upstream map_lora_tensors' vLLM-Omni names and fc1 order). Signed-off-by: Wenbo Ji <[email protected]>
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?