Skip to content

[WS1][CUDA][MiniMax-H3] Follow-up to #699 / #700 / #701: round-3 review fixes and the run_world test doubles (RFC #420 follow-up) - #719

Merged
Flink-ddd merged 5 commits into
RL-Align:test-h3from
fusheng-ji:fix/h3-ws2-test-doubles
Nov 20, 2026
Merged

Flink-ddd merged 5 commits into
RL-Align:test-h3from
fusheng-ji:fix/h3-ws2-test-doubles

Conversation

@fusheng-ji

@fusheng-ji fusheng-ji commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

RFC #420, follow-up to #699 / #700 / #701 (base test-h3). Independent of the SGLang adapter PR. This PR's own diff.

Evidence location: this PR changes tests and merges reviewed fixes, so the test counts below are its evidence. The charts, the H100 logs and the failure lists are not part of its diff. They are on the fork's pr_assets branch under pending/h3-followup-699-700-701/ (links in this description are fixed to a commit).

Follow-up to #699, #700 and #701, all merged into test-h3. It contains two things those PRs left out.

What

  1. Four tests/distributed tests fail on test-h3 since [WS2][CUDA][MiniMax-H3] ws2 full model: ring context parallel, CP weight gradients and the 50-block H3 on TP x CP x SP, bitwise against the single-GPU run (RFC #420 follow-up 3/3) #701; fixed here (2575e44c).

    • Cause: [WS2][CUDA][MiniMax-H3] ws2 full model: ring context parallel, CP weight gradients and the 50-block H3 on TP x CP x SP, bitwise against the single-GPU run (RFC #420 follow-up 3/3) #701's ring commit d6459f49 gave h3_ws2._bootstrap an eighth argument, with_collective, and run_world passes it by position. The five test doubles that replace _bootstrap still took seven arguments, so each spawned double raised TypeError.
    • What failed:
      • test_run_world_reaps_workers[success/error/crash] and test_run_world_returns_rank_ordered_results fail.
      • test_run_world_cleans_up_failed_workers passed anyway: a crashed worker also ends in RuntimeError, and in the timeout case the 1 s timeout fires while the workers are still importing torch.
    • Why CI did not catch it: CI's unit-test job does not run tests/distributed.
    • The fix: the doubles accept with_collective. The cleanup test now matches each mode's message, so a double that cannot be called fails it in the clean_exit, crash and reported_error cases.
  2. The OpenCodeReview round-3 fixes for [WS1][CUDA][MiniMax-H3] Review follow-up for #568 / #570 / #571 / #574 and the strict full-model backward session (RFC #420 follow-up 1/3) #699 and [WS1][CUDA][MiniMax-H3] Strict full model binds time_embedder and norm_out to timestep_mlp_fp32 / final_adaln_out (RFC #420 follow-up 2/3) #700. They were committed after both PRs were merged, so test-h3 does not have them. They are merged here unchanged in ba811b90:

    Commit From What
    424f6279 [WS1][CUDA][MiniMax-H3] Review follow-up for #568 / #570 / #571 / #574 and the strict full-model backward session (RFC #420 follow-up 1/3) #699 fused_qkv refuses a ctx that evaluation_ctx did not make, instead of adding a cache to the caller's ctx. A CUDA out-of-memory error while building the candidate ops propagates instead of becoming a CandidateBindingError. The audit provider rerun names no diagnostic provider nodes.
    390ac695 [WS1][CUDA][MiniMax-H3] Strict full model binds time_embedder and norm_out to timestep_mlp_fp32 / final_adaln_out (RFC #420 follow-up 2/3) #700 The five projection rows resolve through _cuda_row like time_embedder and norm_out, so a reference op added to one of their CUDA lists later is refused instead of being recorded as row.
    • On a working build nothing changes: every executor already used evaluation_ctx, and the projection rows' CUDA lists hold the CUDA op alone.
    • Merge: clean. 390ac695 sits on c7383555, a merge of 424f6279, so one merge brings both.
Commit What
2575e44c test doubles take with_collective; the cleanup test matches messages
ba811b90 merge of 390ac695 (with 424f6279): the #699 / #700 round-3 fixes

Prior art & reuse decision

There is no new operator, no new kernel and no runtime change. Both parts reuse what is already reviewed:

Need Reused
test doubles for run_world the eight-argument h3_ws2._bootstrap signature of #701 (d6459f49); the doubles only accept with_collective
the #699 / #700 round-3 fixes 424f6279 and 390ac695 as reviewed on those PRs, merged unchanged

Decision: adapt the tests and merge the reviewed fixes; nothing new to write.

Results (B200 / Blackwell)

Measured on 2 x NVIDIA B200 (sm100), driver 580.126.20, CUDA 13.0, torch 2.13.0+cu130, strict build and pinned MiniMax-H3@42ed227 weights where noted. test-h3 (10552d82) against this branch, same environment for both trees.

Test results, test-h3 (10552d82) vs this branch: failures and passes per suite

Suite Environment test-h3: passed / failed / skipped this branch: passed / failed / skipped change
tests/distributed 2 x B200 237 / 7 / 31 241 / 3 / 31 (2575e44c) +4 passed, -4 failed
tests/models/minimax_h3 CUDA hidden 424 / 1 / – 430 / 1 / – (ba811b90) +6 passed, +0 failed
tests/models/minimax_h3 2 x B200, strict build, pinned weights 1159 / 1 / 71 1165 / 1 / 71 (ba811b90) +6 passed, +0 failed

The chart and the table hold the same counts: the pytest summaries of the runs in Tests below. The tests/distributed row is at 2575e44c, the commit that changes those tests; the two tests/models/minimax_h3 rows are at ba811b90.

  • What changed: in tests/distributed, only the four _bootstrap double tests, from failed to passed. The 6 extra passes in tests/models/minimax_h3 are the round-3 tests (see Tests).
  • Why 3 still fail: they fail the same way on test-h3. Two are not H3: a ROCm OpBackend KeyError in test_rocm_attention_transport, and a call to the removed KernelRegistry.get_loss_op. test_h3_tp_adaln::test_nccl_byte_equal_to_ws1[2] failed allocating its CUDA IPC buffer on these shared GPUs (invalid argument), on rank 0 for test-h3 and on rank 1 here.
  • The cleanup test: with the old seven-argument doubles, its clean_exit, crash and reported_error cases now fail, and test_run_world_returns_rank_ordered_results fails as before.
  • test_h3_token_refiner.py::test_nodes_accuracy_repeat_batch_and_isolated[1-257] fails on both trees on B200 (its swiglu error against the bound); it passes on H100.

Results (H100 / Hopper)

Measured on 2 x NVIDIA H100 (sm90), driver 580.173.02, CUDA 13.0, torch 2.13.0+cu130, both trees at ba811b90 and 10552d82 with the strict build in place (_C inside each worktree) and the same pinned weights. The two trees ran at the same time on separate nodes, two GPUs each.

Test results on 2 x H100, test-h3 (10552d82) vs this branch: failures and passes per suite

Suite Environment test-h3: passed / failed / skipped this branch: passed / failed / skipped change
tests/distributed 2 x H100 237 / 7 / 31 241 / 3 / 31 (ba811b90) +4 passed, -4 failed
tests/models/minimax_h3 2 x H100, strict build, pinned weights 1161 / 0 / 70 1167 / 0 / 70 (ba811b90) +6 passed, +0 failed

Logs, failure lists and their comm: h100/.

  • What changed: the same as on B200. The tests failing only on test-h3 are exactly the four _bootstrap double tests; no test fails only on this branch.
  • Still failing on both trees: the same three as on B200. That run did not record the reasons (--tb=no).
  • tests/models/minimax_h3: no failure on either tree, so [1-257] passes on H100. Of the same 1231 tests, H100 passes 2 more than B200: [1-257], and one test that skips on B200.

Status

Current head ba811b90. Ready for review. Run on 2 x B200 and 2 x H100 (Results).

Tests

Command Environment Result
pytest tests/distributed 2 x B200 241 passed / 3 failed / 31 skipped (test-h3: 237 / 7 / 31); see Results
same 2 x H100 241 passed / 3 failed / 31 skipped at ba811b90 (test-h3: 237 / 7 / 31); the same three fail on both trees
pytest tests/models/minimax_h3 CUDA hidden 430 passed / 1 failed at ba811b90 (test-h3: 424 / 1). The 6 are the round-3 tests; the failure is the known [gather] timing case.
pytest tests/models/minimax_h3 2 x B200, strict build, pinned weights 1165 passed / 1 failed / 71 skipped at ba811b90; test-h3 tree: 1159 / 1 / 71. The difference is the round-3 tests: 390ac695 renames the time_embedder / norm_out refusal test to test_strict_refuses_the_reference_op_of_a_boundary_row and adds three rows to it, and 424f6279 adds three tests. No other test changes. The one failure is the same on both: test_h3_token_refiner.py::test_nodes_accuracy_repeat_batch_and_isolated[1-257] (B200 swiglu error against its bound; it passes on H100, next row).
same 2 x H100, strict build, pinned weights 1167 passed / 0 failed / 70 skipped at ba811b90; test-h3 tree: 1161 / 0 / 70. The difference is the same 6 round-3 tests; [1-257] passes on both trees.
mypy --ignore-missing-imports rl_engine/ without torch (as CI) no issues
same with torch the same 36 errors as test-h3
pre-commit on the diff passes

Scope / Known limitations

Summary by CodeRabbit

  • Bug Fixes

    • Strict mode now rejects any selected boundary operation that resolves to a non-CUDA implementation, including reference fallbacks.
    • CUDA out-of-memory errors during candidate setup now remain distinguishable from other binding failures.
    • Audit-mode fallback reports provider nodes only for the candidate graph, not the provider-only rerun.
  • Documentation

    • Clarified strict-mode boundary checks and the role of provider arithmetic.

…rerun provenance honest

- fused_qkv refuses a ctx that evaluation_ctx did not make, instead of adding a cache to the
  caller's own ctx, where a later evaluation could read an earlier one's outputs.
- A CUDA out-of-memory error while building the candidate ops propagates; only other
  RuntimeErrors there (e.g. missing kernels) are a CandidateBindingError.
- The audit provider rerun passes no provider_nodes, so its trace names no diagnostic hybrid.

Signed-off-by: Wenbo Ji <[email protected]>
The projection rows now go through _cuda_row like time_embedder and norm_out. Their CUDA
priority lists hold the CUDA op alone today, so nothing changes on a working build; a reference
added to one of those lists later is refused instead of being bound and recorded as "row".

Signed-off-by: Wenbo Ji <[email protected]>
RL-Align#701's ring commit d6459f4 added `with_collective` to h3_ws2._bootstrap and
run_world passes it positionally, but the five doubles that replace
_bootstrap in tests/distributed still took seven arguments. Every spawned
double raised TypeError: test_run_world_reaps_workers[success/error/crash]
and test_run_world_returns_rank_ordered_results failed on test-h3, and
test_run_world_cleans_up_failed_workers passed only because a crashed worker
also ends in RuntimeError (or the 1 s timeout fires first).

The doubles now accept `with_collective`, and the cleanup test matches each
mode's message, so a double that cannot be called fails it.

Signed-off-by: Wenbo Ji <[email protected]>
…to fix/h3-ws2-test-doubles

424f627 (RL-Align#699) and 390ac69 (RL-Align#700) were committed after both PRs were
merged into test-h3. 390ac69 sits on c738355, a merge of 424f627, so
merging it brings both.

Signed-off-by: Wenbo Ji <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The H3 validation path now checks every strict boundary row against its designated CUDA operator and preserves CUDA out-of-memory errors. Fused-QKV calls require an evaluation context. Provider-only fallback runs pass no provider nodes. Distributed test workers accept an optional argument, and failure tests check mode-specific messages.

Changes: MiniMax-H3 runtime and validation

Layer / File(s) Summary
Strict boundary binding
rl_engine/validation/models/h3_full_model.py, docs/operators/h3-full-transformer.md, tests/models/minimax_h3/test_h3_full_model.py
Strict binding checks each selected registry row against its designated CUDA operator. The documentation describes the expanded row requirement. Candidate-op construction propagates CUDA out-of-memory errors, and tests cover row mappings and error handling.
Fused-QKV evaluation context
rl_engine/validation/models/h3_block.py, tests/models/minimax_h3/test_h3_one_block.py, tests/models/minimax_h3/test_h3_token_refiner.py
fused_qkv now rejects contexts without an existing evaluation cache. Tests use evaluation_ctx and verify that an invalid context is rejected before the QKV operator runs.
Provider fallback reporting
rl_engine/models/minimax_h3/runtime.py, tests/models/minimax_h3/test_h3_runtime_integration.py
Provider-only runs pass an empty provider_nodes tuple. The integration test checks that candidate binding failure triggers a provider rerun and records a fallback.

Distributed worker tests

Layer / File(s) Summary
Worker arguments and failure assertions
tests/distributed/sp/test_h3_sp_norm_adaln.py, tests/distributed/test_h3_ws2_processes.py
The worker functions accept an optional with_collective argument. The failed-worker test checks the expected message for clean exit, crash, reported error, and timeout.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Possibly related issues

  • RL-Align/RL-Kernel issue 420: The issue describes the MiniMax-H3 WS1/WS2 roadmap, and this pull request updates H3 binding checks and runtime tests.

Possibly related PRs

Suggested labels: platform: cuda, MiniMax-H3, WS1

Merge Risk: Minimal · up to ba811

The change tightens strict CUDA boundary binding, requires an evaluation context for fused QKV, and fixes the distributed test doubles. No concrete regression was found in the changed code paths. It looks safe to merge, with callers expected to use evaluation_ctx for fused_qkv.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the ticket series, a workstream tag, and 'round-3 review fixes and the run_world test doubles'. The changeset does contain round-3 review fixes (fused_qkv context requirement, CUDA OOM…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the ticket series, a workstream tag, and 'round-3 review fixes and the run_world test doubles'. The changeset does contain round-3 review fixes (fused_qkv context requirement, CUDA OOM propagation, audit-mode provider nodes, strict boundary-row verification) and the distributed test-double updates (with_collective parameter, per-mode cleanup messages). The title is therefore related to the main change. It is verbose and uses internal ticket prefixes, which reduces clarity, but it is not misleading or vague.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 10552d8 and ba811b9.

Files selected for processing: 10

  • docs/operators/h3-full-transformer.md
  • rl_engine/models/minimax_h3/runtime.py
  • rl_engine/validation/models/h3_block.py
  • rl_engine/validation/models/h3_full_model.py
  • tests/distributed/sp/test_h3_sp_norm_adaln.py
  • tests/distributed/test_h3_ws2_processes.py
  • tests/models/minimax_h3/test_h3_full_model.py
  • tests/models/minimax_h3/test_h3_one_block.py
  • tests/models/minimax_h3/test_h3_runtime_integration.py
  • tests/models/minimax_h3/test_h3_token_refiner.py

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

@github-actions

Copy link
Copy Markdown

✅ OpenCodeReview: Review complete: 0 finding(s) across 9 selected item(s).

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

@maxiaosong1124 maxiaosong1124 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Flink-ddd Flink-ddd added platform: cuda Specific optimizations or bugs in NVIDIA graphics cards (such as FlashInfer, TMA optimizations) MiniMax-H3 WS1 new-model labels Nov 20, 2026
@Flink-ddd
Flink-ddd merged commit 9d57c0a into RL-Align:test-h3 Nov 20, 2026
6 checks passed
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) WS1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants