Skip to content

[WS2][CUDA][MiniMax-H3] ws2 tensor / sequence / context parallel and the hierarchical cross-node collective (RFC #420 stack 3/7) - #569

Open
fusheng-ji wants to merge 70 commits into
RL-Align:test-h3from
fusheng-ji:feat/h3-ws2-parallel
Open

fusheng-ji wants to merge 70 commits into
RL-Align:test-h3from
fusheng-ji:feat/h3-ws2-parallel

Conversation

@fusheng-ji

@fusheng-ji fusheng-ji commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

RFC #420 stack 3/7 (base test-h3, merge bottom-up): #483 → #484 → #485 → #486 → #487 → #488 → #489 → #493 → #494 → #586 → #587 → #588 → {#567, #568} → {#569, #570 (on #568)} → #571 (on #570) → #574 → #575. This PR sits on #568; until the lower PRs merge, GitHub also shows their commits. This PR's own diff.

Evidence location: the measurement outputs of this PR (JSON, figures) are not part of its diff. They are on the fork's pr_assets branch under pending/h3-ws2-parallel/ (links in this description are fixed to that commit). Paths such as reports/experiments/... below name where a runner writes its output.

What

Contract h3-parallel-v1: eight canonical reduction units, so tensor parallel 1 / 2 / 4 / 8 add the same partials in the same tree.

  • Row-parallel O (K = 7168, unit 896) and down (K = 14336, unit 1792): FP32 per-unit GEMM, local tree, collective tree, one BF16 rounding.
  • Column-parallel backward dX: unit j is block j of every fused weight, in q,k,v / hidden,gate order.
  • Ulysses context parallel: exact all-to-all over a ragged SeqShard; sequence parallel: all-gather / reduce-scatter; coshard slices metadata with the rows.
  • HierarchicalCollective (hierarchical_ipc_nccl_tree): node-local deterministic tree, NCCL all-gather of the group partials, fixed balanced add. The input dtype is the accumulation dtype, so the result matches the single-node tree bit for bit.
  • Runner h3_parallel_run.py launches a layout on N processes and compares every rank with the single-GPU canonical block.

Prior art & reuse decision

Existing implementation Why not bound
NCCL all-reduce (ring / tree) reduction order follows topology and rank count; not invariant across TP sizes
Megatron-LM / vLLM tensor parallel same all-reduce; no bitwise statement across TP sizes
DeepSpeed-Ulysses all-to-all layout reused as the idea; ours is exact and ragged
this repo's DeterministicCollective reused node-locally; extended with the hierarchical layer

Decision: canonical-unit partial sums plus a fixed tree; NCCL only moves bytes between nodes.

Results (H100 / Hopper, 2 nodes x 4 GPUs)

Measured on NVIDIA H100 (93 GiB, sm90), driver 580, CUDA 13.0, torch 2.13.0+cu130, pinned MiniMax-H3@42ed227 weights, at head 5ae9f5eb. Block 0 of the pinned checkpoint, 264 packed rows; forward and input gradient compared bitwise with the single-GPU canonical block for every layout, and in addition every weight-gradient shard (to_q/k/v, to_out, ff hidden/gate/down) for the layouts without CP (TP2, TP4, TP8).

Layout GPUs Nodes Collective Bitwise equal to single GPU Mean forward per rank
TP2 x CP1 2 1 cuda_ipc_fixed_tree yes 0.033 s
TP4 x CP1 4 1 cuda_ipc_fixed_tree yes 0.033 s
TP4 x CP2 8 2 cuda_ipc_fixed_tree yes 0.032 s
TP4 x CP2 + SP 8 2 cuda_ipc_fixed_tree yes 0.033 s
TP8 x CP1 8 2 hierarchical_ipc_nccl_tree yes 0.032 s

WS2 layouts

Numbers: reports/experiments/h3-ws2-parallel-h100/ (one report per layout; host names are replaced by node-a, node-b).

Results (B200 / Blackwell, 1 node x 8 GPUs)

Measured on NVIDIA B200 (179 GiB, sm100), driver 580.126, CUDA 13.0, torch 2.13.0+cu130, pinned MiniMax-H3@42ed227 weights, clean tree at 5ae9f5eb. One node with 8 GPUs, one process per GPU; same block, 264 packed rows and comparisons as the H100 table above (forward and input gradient against the single-GPU canonical block for every layout, plus every weight-gradient shard for the layouts without CP).

Layout GPUs Nodes Collective Bitwise equal to single GPU Mean forward per rank
TP2 x CP1 2 1 cuda_ipc_fixed_tree yes 9.3 ms
TP4 x CP1 4 1 cuda_ipc_fixed_tree yes 9.0 ms
TP4 x CP2 8 1 cuda_ipc_fixed_tree yes 9.5 ms
TP4 x CP2 + SP 8 1 cuda_ipc_fixed_tree yes 9.2 ms
TP8 x CP1 (node-local tree) 8 1 cuda_ipc_fixed_tree yes 13.2 ms
TP8 x CP1 (2 x 4 hierarchical tree, one node) 8 1 hierarchical_ipc_nccl_tree yes 14.0 ms

WS2 layouts on B200

Numbers: h3-ws2-parallel-b200/ (one report per layout, tests.json; host names replaced by node-a).

  • All six layouts are bitwise equal to the single-GPU reference, including the 8-rank TP8, TP4 x CP2 and TP4 x CP2 + SP cases, on a single 8-GPU node.
  • The hierarchical row runs the same TP8 group with --local-size 4, which selects the hierarchical IPC + NCCL tree and treats the 8 GPUs as two groups of four inside one physical node. It exercises that code path; it is not a measurement of the cross-node network, which was only measured on H100 (two nodes).
  • Forward times are those of a 264-row block and are not a scaling claim.
  • The first attempt of the job was preempted inside the third layout and requeued; every report above is from the second, complete attempt.
  • This is Blackwell, not Hopper: the single-node 8-GPU Hopper request at the top of this description is still open, and test_h3_tp_adaln.py / test_h3_sp_norm_adaln.py were not run on the B200 either.

Status

All five layouts are bitwise equal to the single-GPU reference on real nodes; ranks are packed node-major with 1 / 2 / 4 / 8 nodes supported.

B200 status: all six layouts, including the 8-rank cases on one 8-GPU node, are bitwise equal to the single-GPU block (128 of 128 tests pass); the cross-node collective is not measured on B200.

History

Tests

python -m pytest tests/models/minimax_h3/test_h3_parallel.py tests/models/minimax_h3/test_h3_projection_rows.py -q    # 122 passed (4 x H100)

The 8-GPU NCCL cases need eight GPUs in one node or two nodes: we only have 4-GPU Hopper nodes, so they are covered by the two-node runner above and not run on a single 8-GPU Hopper node (open for anyone with that resource, see the note at the top).

B200: the same two files on 8 x B200, 128 passed, 0 failed, 0 skipped (the 8-GPU NCCL cases ran on one node).

Measured on the synced branches (2 × NVIDIA RTX PRO 6000 Blackwell, sm120, pinned MiniMax-H3@42ed227 weights incl. block 0, each build compiled in place from the checked-out commit):

Commit Command Default build, passed / skipped / failed
672c1b36 (#575, the top of this chain, contains this PR) pytest tests/models/minimax_h3 1046 / 38 / 0
672c1b36 pytest tests/models/minimax_h3 tests/build tests/runtime/test_dispatch.py tests/validation 1611 / 45 / 7 (4 failures needed the block-0 weights file, which was not installed in that run and is now; the other 3 are the known baseline failures)

Skips are environment only: no matplotlib, diffusers or sglang; tests that need 4 or 8 GPUs (2 were visible); no full-transformer shard index; no VERL_OMNI_PATH. The KERNEL_ALIGN_USE_FAST_MATH=1 build 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 aea92811 (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, pinned MiniMax-H3@42ed227 weights incl. block 0, 4 GPUs visible, extension built in place from this commit:

Build Command passed / skipped / failed
default pytest tests/models/minimax_h3 tests/build tests/runtime/test_dispatch.py tests/validation 1544 / 6 / 1 (of 1551)
KERNEL_ALIGN_USE_FAST_MATH=1 same 938 / 611 / 2 (of 1551)
default the per-PR test files listed above 128 passed

The 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 without KERNEL_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 plus TestCuda::test_unsupported_device_is_refused_at_construction in tests/models/minimax_h3/test_h3_final_adaln_out.py (#489): with the H3 kernels excluded, the op constructor raises "rl_engine._C lacks 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), sglang not 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

  • No single-node 8-GPU Hopper run. 8-way layouts were measured on 2 nodes x 4 H100 only; test_h3_tp_adaln.py:: and test_h3_sp_norm_adaln.py:: 8-GPU cases are skipped here. Help from anyone with a single-node 8 x Hopper machine is welcome.

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. ws2_pipeline_parallel is not included. Not part of this PR: video projections (#562), O / gate_up / down GEMMs (#554, #535), full attention (#553), ROCm, SGLang adapter, pipeline parallel.

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

This 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 48 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between ba5f0a9 and 718b0ca.

Files selected for processing: 76
  • .github/workflows/ci.yml
  • csrc/cuda/h3/gate_residual.cu
  • csrc/cuda/h3/rmsnorm_modulate.cu
  • docs/operators/README.md
  • docs/operators/h3-one-block.md
  • docs/operators/h3-parallel.md
  • docs/operators/h3-projection-rows.md
  • examples/models/minimax_h3/README.md
  • examples/models/minimax_h3/candidate.sbatch
  • examples/models/minimax_h3/diagnose-block.sbatch
  • examples/models/minimax_h3/full-model-ensemble-rule.json
  • examples/models/minimax_h3/full-model-thresholds.json
  • examples/models/minimax_h3/generation-compare.sbatch
  • examples/models/minimax_h3/generation-contract.json
  • examples/models/minimax_h3/generation-inputs.json
  • examples/models/minimax_h3/generation-prompt.txt
  • examples/models/minimax_h3/generation-resume-check.sbatch
  • examples/models/minimax_h3/generation.sbatch
  • examples/models/minimax_h3/reference-manifest.json
  • examples/models/minimax_h3/reference.sbatch
  • reports/experiments/h3-sigma-schedule/benchmark-4090d.json
  • rl_engine/_C.pyi
  • rl_engine/backends/cuda/model_specific/minimax_h3/parallel.py
  • rl_engine/backends/cuda/model_specific/minimax_h3/projection.py
  • rl_engine/backends/cuda/model_specific/minimax_h3/sp_norm_adaln.py
  • rl_engine/backends/cuda/model_specific/minimax_h3/ws2_comm.py
  • rl_engine/backends/shared/triton/gemm/h3_projection.py
  • rl_engine/distributed/algorithms/hierarchical.py
  • rl_engine/reference/minimax_h3/block.py
  • rl_engine/reference/minimax_h3/projection.py
  • rl_engine/runtime/registry.py
  • rl_engine/validation/distributed/h3_ws2.py
  • rl_engine/validation/models/h3_block.py
  • rl_engine/validation/models/h3_cases.py
  • rl_engine/validation/models/h3_chain.py
  • rl_engine/validation/models/h3_full_manifest.json
  • rl_engine/validation/models/h3_full_model.py
  • rl_engine/validation/models/h3_generation_resume.py
  • rl_engine/validation/models/h3_manifest.json
  • rl_engine/validation/models/h3_provider.py
  • rl_engine/validation/models/h3_report.py
  • rl_engine/validation/models/h3_tp.py
  • rl_engine/validation/models/h3_weights.py
  • tests/distributed/test_h3_ws2_comm.py
  • tests/distributed/tp/test_h3_tp_adaln.py
  • tests/models/minimax_h3/conftest.py
  • tests/models/minimax_h3/test_h3_adaln_row_gather.py
  • tests/models/minimax_h3/test_h3_bitwise_reuse_plot.py
  • tests/models/minimax_h3/test_h3_full_model.py
  • tests/models/minimax_h3/test_h3_generation_resume.py
  • tests/models/minimax_h3/test_h3_native_validation.py
  • tests/models/minimax_h3/test_h3_one_block.py
  • tests/models/minimax_h3/test_h3_parallel.py
  • tests/models/minimax_h3/test_h3_projection_rows.py
  • tests/models/minimax_h3/test_h3_review_fixes.py
  • tools/migration/layout.json
  • tools/validation/models/h3_block_diagnostic.py
  • tools/validation/models/h3_block_replay.py
  • tools/validation/models/h3_block_ulp_sweep.py
  • tools/validation/models/h3_candidate_prepare.py
  • tools/validation/models/h3_evidence_integrity.py
  • tools/validation/models/h3_first_step_diagnostic.py
  • tools/validation/models/h3_full_compare.py
  • tools/validation/models/h3_full_ensemble_rule.py
  • tools/validation/models/h3_full_generation.py
  • tools/validation/models/h3_full_model.py
  • tools/validation/models/h3_full_provider_spread.py
  • tools/validation/models/h3_generation_adopt.py
  • tools/validation/models/h3_generation_compare.py
  • tools/validation/models/h3_parallel_run.py
  • tools/validation/models/h3_projection_bench.py
  • tools/validation/models/h3_projection_charts.py
  • tools/validation/models/h3_ws2_charts.py
  • tools/validation/models/plot_h3_block.py
  • tools/validation/models/plot_h3_evidence.py
  • tools/weights/prepare_h3_weights.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

fusheng-ji and others added 12 commits October 22, 2026 22:54
…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)
…de collective, 2-node H100 evidence

Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com>
(cherry picked from commit 7f1296a970efb0cfcebd9300ff92551de08cf311)
Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com>
(cherry picked from commit d56c391)
…il-closed test instead of a skip

Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com>
(cherry picked from commit 74e5b83)
Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com>
(cherry picked from commit 33cbcd6)
…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)
Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com>
(cherry picked from commit 5f4e34c)
…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)
Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com>
(cherry picked from commit d086b5c)
…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>
…hard leaves

Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com>
@fusheng-ji
fusheng-ji force-pushed the feat/h3-ws2-parallel branch from d086b5c to 5ae9f5e Compare October 22, 2026 21:04
fusheng-ji added a commit to fusheng-ji/RL-Kernel that referenced this pull request Oct 23, 2026
… on one 8-GPU node

128 tests pass (8-GPU NCCL cases included) and all six layouts (TP2, TP4, TP4xCP2, TP4xCP2+SP, TP8 with the node-local tree,
TP8 with the 2x4 hierarchical tree inside one node) are bitwise equal to the single-GPU block. Host names replaced by node-a.

Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com>
@Flink-ddd Flink-ddd added platform: cuda Specific optimizations or bugs in NVIDIA graphics cards (such as FlashInfer, TMA optimizations) new-model MiniMax-H3 WS2 labels Oct 23, 2026
@fusheng-ji fusheng-ji changed the title [WS2][CUDA][MiniMax-H3] ws2 tensor / sequence / context parallel and the hierarchical cross-node collective (RFC #420 stack 3/5) [WS2][CUDA][MiniMax-H3] ws2 tensor / sequence / context parallel and the hierarchical cross-node collective (RFC #420 stack 13/17) Oct 30, 2026
- h3_block._backward: run the golden backward under strict_fp32_matmul (run_graph only covered the forward)
- h3_block_layout: reject num_timesteps outside [1, seq_len] instead of silently returning fewer runs
- h3_block_diagnostic / h3_evidence_integrity: hash files with a local digest; nothing here imports
  h3_full_model, which only exists in the next PR of the stack
- h3_first_step_diagnostic: removed from this PR; it imports h3_full_model and h3_full_generation
  and belongs with the generation gate, where both exist
- plot_h3_evidence: draw a placeholder when an SP report has no run with SP > 1
- rmsnorm backward_partials / backward_dx: require a dense 1-D rstd like h3_rmsnorm_backward (a
  strided or stride-0 view with M elements passed the old numel check and was read as a dense array)
Regression tests for each; each fails on the previous code.

Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com>
@fusheng-ji fusheng-ji changed the title [WS2][CUDA][MiniMax-H3] ws2 tensor / sequence / context parallel and the hierarchical cross-node collective (RFC #420 stack 13/17) [WS2][CUDA][MiniMax-H3] ws2 tensor / sequence / context parallel and the hierarchical cross-node collective (RFC #420 stack 3/7) Oct 30, 2026
fusheng-ji and others added 25 commits October 30, 2026 11:01
Takes 7aa29b8 (review findings on the block-0 replay). h3_first_step_diagnostic.py is removed from this
PR: it imports h3_full_generation, which only exists in the generation gate (RL-Align#588), where it stays.
Takes the RL-Align#586 review fixes through RL-Align#587. h3_first_step_diagnostic.py stays here (it needs
h3_full_generation, which this PR adds) and its usage example now shows the required --contract.
… PR RL-Align#586

RL-Align#494 fixed the same two review findings as 7aa29b8 (dense 1-D rstd in the SP backward entry points,
SP plot without an SP > 1 run) with tests of its own. The conflicting plot hunks and the SP plot test take
RL-Align#494's version, and the duplicate rstd test added here is dropped; the kernel text is identical on both sides.
…after taking RL-Align#494's version

RL-Align#494's copy of the two textwrap.dedent blocks is in a newer black style than the pinned 24.4.2 that the
pre-commit hook and the linting job use; this restores the pinned style (no code change).

Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com>
- rmsnorm backward_partials: the 2N grid bound belongs to the modulated call (shift and scale partials
  side by side); a plain call launches over N and now gets the N bound (no longer rejected above ~8.3M columns)
- gate_grad_partials: reject a zero-width input (it would launch dim3(tiles, 0)) with a clear message
- gate_grad_partials: state that the tile coverage of the caller-built list is the caller's contract
- adaln_row_gather backward: pin the contract that a table without rows is rejected (the RFC's gate asks
  empty cases to fail clearly) with a native test
- layout map: restore tests/h3/test_h3_rmsnorm_native_validation.py, dropped by an earlier merge resolution
- SP evidence plot: keep a run slower than WS1 inside the timing axis; draw the RL-Kernel bars of the
  naive-reduction panel from the recorded equality flags instead of fixed zeros
- TP doc/test: the ownership test now also covers TP 12 and 14, which the document says it does
Tests added for each. The three new plot tests fail on the previous plot code (checked); the native tests
were run against the rebuilt extension only.

Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com>
gather_rows padded every shard past the single-block fast-path limit. On 8 x B200 (2, 4 and 8 ranks, outputs
2 KiB to 512 KiB) the multi-block path costs a flat 55-65 us for 2 and 4 ranks (~90 us for 8) while the
single-block path costs ~4 us/KiB, so below ~8 KiB of output the plain gather is up to ~25 us faster (2 ranks:
54 us plain against 59 us padded at 8 KiB, 63 against 59 at 10 KiB) and above it padding wins by up to 25x
(256 KiB: 1.1-1.7 ms plain, 60-95 us padded). Outputs of at most 8 KiB are now gathered unpadded. A copy either
way: the new test checks gather_rows against the plain all-gather bit for bit at sizes around the threshold.

Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com>
…with its measured size

Signed-off-by: Wenbo Ji <36562829+fusheng-ji@users.noreply.github.com>
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

🔍 OpenCodeReview found 2 issue(s) in this PR.

  • ✅ Successfully posted inline: 0 comment(s)
  • 📋 Routed to summary by policy: 2 comment(s)

⚠️ 4 warning(s) occurred during review.


bug · medium

📄 rl_engine/backends/cuda/model_specific/minimax_h3/parallel.py (L274-L275)

⚠️ GitHub could not post this as an inline comment: Routed to summary (severity medium · category bug)

group defaults to None, which routes the collective over the whole WORLD group, while the buffers are sized for exactly shard.cp participants. When context parallelism is nested inside a larger world (e.g. TP=2 × CP=2 → world=4, shard.cp=2), dist.all_gather receives a chunks list of length 2 but the group has 4 ranks, so it fails (or gathers the wrong ranks). The same latent issue exists in ulysses_attention → _AllToAll (split sizes assume exactly cp ranks) and _SeqLinear/seq_sharded_linear. Concrete trigger: calling any of these with shard.cp != dist.get_world_size(). Please thread the actual CP process group through (or reject cp != world_size when group is None) so the collective cannot silently target WORLD.


performance · medium

📄 rl_engine/backends/cuda/model_specific/minimax_h3/projection.py (L88-L90)

⚠️ GitHub could not post this as an inline comment: Routed to summary (severity medium · category performance)

canonical_row_order is evaluated unconditionally, and it performs a torch.unique(keys, dim=0) plus a stable argsort per key column. In forward-only/inference (torch.no_grad, the common RL rollout path) wants_grad is False, so the full ordering cost is paid on every projection call and the result is immediately discarded. Compute wants_grad first and only build order when it is true (keep the cheap key validation separately if a duplicate-key guard is required in inference).


⚠️ Warnings:

  • .github/workflows/ci.yml,tools/migration/layout.json (review_limit_reached): reached the aggregate token budget before finishing; the grace round completed the task
  • rl_engine/reference/minimax_h3/block.py (token_budget_reached): stopped dispatch: used 584181 tokens + group estimate 70512 = projected 654693 exceeds budget 500000
  • csrc/cuda/h3/gate_residual.cu,csrc/cuda/h3/rmsnorm_modulate.cu,rl_engine/_C.pyi,rl_engine/backends/cuda/model_specific/minimax_h3/sp_norm_adaln.py,rl_engine/backends/cuda/model_specific/minimax_h3/ws2_comm.py (review_limit_reached): reached the aggregate token budget before finishing; the grace round completed the task
  • rl_engine/backends/cuda/model_specific/minimax_h3/parallel.py,rl_engine/backends/cuda/model_specific/minimax_h3/projection.py,rl_engine/backends/shared/triton/gemm/h3_projection.py,rl_engine/distributed/algorithms/hierarchical.py,rl_engine/runtime/registry.py (review_limit_reached): reached the aggregate token budget before finishing; the grace round did not complete the task

@github-actions

Copy link
Copy Markdown

@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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

MiniMax-H3 new-model platform: cuda Specific optimizations or bugs in NVIDIA graphics cards (such as FlashInfer, TMA optimizations) WS2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants