Skip to content

[WS1][CUDA][Qwen3-Next] End-to-end speed test: strict path against stock vLLM and stock VIME (RFC #428 §7) - #745

Open
fusheng-ji wants to merge 57 commits into
RL-Align:test-qwennextfrom
fusheng-ji:feat/qwen3-next-e2e-bench
Open

fusheng-ji wants to merge 57 commits into
RL-Align:test-qwennextfrom
fusheng-ji:feat/qwen3-next-e2e-bench

Conversation

@fusheng-ji

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

Copy link
Copy Markdown
Contributor

RFC #428 Qwen3-Next, end-to-end speed test: the strict path against stock vLLM and stock VIME (base test-qwennext). This is the report §7 of the RFC asks for: "Performance numbers are reported against the qualified native path for training, prefill, and decode".

Evidence location:

  • summary: reports/experiments/qwen3_next/qwen3-next-e2e-speed-b200-h100.md, with both charts;
  • raw results: a release ZIP (SHA-256 65fef169…8299d556).

What

  1. The runner (benchmarks/models/qwen3_next/qwen3_next_e2e_bench.py, e2e_bench_cases.py).
    • It takes a passed l2 run of the chain and reuses its checkpoint, environment and certificate. Each arm runs in its own processes on the same four GPUs with the same synthetic inputs, and the report records the median, min, max and every repeat.
    • Rollout: generate (prefill and decode) through the certified strict vLLM engine, and through stock vLLM 0.30.0 with CUDA graphs, eager, and VLLM_BATCH_INVARIANT=1.
      • Strict checks: the same tokens across repeats and rounds, and row 0 of a batch equal to that prompt alone. The same checks are recorded for the stock arms.
      • An arm the engine refuses is recorded as unsupported, with the engine's reason, instead of failing the run.
    • Replay: forward plus selected-token logprob, through RL-Kernel's model and logprob in VIME and through VIME's own Qwen3-Next model.
    • Training: one train_one_step, split into optimizer and forward + backward, for the same two arms.
  2. Stock VIME at its recipe layout (qwen3_next_vime_runtime.py, 64f18040, e0f1959c).
    • Stock VIME cannot run Qwen3-Next at TP4, for two reasons: Megatron's attention output gate is not narrowed when TP exceeds the 2 KV heads, and VIME's loader shards grouped experts only at ETP1.
    • The stock arm therefore runs VIME's own layout (scripts/run-qwen3-next-80B-A3B.sh) on the same four GPUs: TP2 with sequence parallel, EP4, ETP1, DP2. With one sample, the second replica runs a filler copy, because every rank must join the MoE all-to-all; the step time is the slowest rank's.
    • Replay pads packed tokens to a multiple of TP, as VIME's get_batch does.
    • The strict arm keeps its certified TP4 layout without sequence parallel. Each report records both layouts under phases.replay.layouts.
  3. Charts (plot_qwen3_next_e2e_bench.py): one panel per phase and workload, each arm's layout in the title, refused arms marked as not measured. A later report can replace a phase (the rollout re-measure), and the title then names each phase's commit.
  4. Report (reports/experiments/qwen3_next/qwen3-next-e2e-speed-b200-h100.md).
Commit What
f5100979 the speed test: rollout, replay and training arms, report schema
b6237c70 an engine's refusal of an arm is recorded as unsupported
9eea76a2 stock replay and training at EP4 (superseded by 64f18040, see History)
64f18040 stock VIME at its recipe's TP2 layout
e0f1959c stock VIME with sequence parallel, as its recipe; replay pads to a multiple of TP
213a9bcd, 8c9d6539, 37e04258 merges with the GDN fix for the measured runs (37e04258 is the measured commit)
04c20f0b, aa7daa4d, ba101eff, 8fbacb87 merges of #744's head
29e39686 style: import order
ec450e35 chart: each arm's layout, refused arms marked
0ce47260 docs: B200 / H100 report and evidence link
7f41bb9f docs: which settings the stock arms share; prefill_s is the time to the first token
3e06906f the stock vLLM arms run at CUDA's default connection limit; stock VIME keeps CUDA_DEVICE_MAX_CONNECTIONS=1 (the measured rollout commit)
11798650 merge of #744's head (7b5550b3)
9dbb5c5b bot round: the workers get an absolute l2 run path
b0c506cf chart: a phase re-measured at another commit
ecfdf358 docs: the rollout re-measure; replay and training compare layouts, not per-rank speed
3b89d610 merge of #744's head (7af7dad3)
de5dee2c bot round: no arm is timed on busy GPUs; a used --out is refused
5db2be61, f20121c8 merges of #744's head (94704c3e, 69a74a5a)
1c90548a bot round: a worker timeout is recorded; the cross-round check needs two rounds; combined reports need equal versions
3ae6ad43 docs: the one-round B200 arm's cross-round check does not apply
841a7ffc docs: cite the re-uploaded ZIP (host names masked)
54a4563c docs: the report's chart links point at the rewritten pr_assets commit
843a7480 merge of #744's head (9c0e5595)
d3f828d9 docs: the report cites the speed-test ZIP re-uploaded without PCI bus IDs
96324c12 merge of #744's head (a3374d26)
de517036 docs: the report's charts point at the rewritten pr_assets commit

Prior art & reuse decision

No new kernel or reduction. §7 asks for the qualified native path, so the baselines are the stock frameworks, unmodified, and the timing harness is the only new code.

Existing implementation Batch-invariant? Decision
stock vLLM 0.30.0 with CUDA graphs No: tokens differ between repeats or rounds at p1024 b4 and long b16 / b64, on both GPUs reused unmodified, as the graphs baseline
stock vLLM 0.30.0, eager No: same shapes reused unmodified, as the eager baseline
vLLM 0.30.0 with VLLM_BATCH_INVARIANT=1 would be, but vLLM refuses it for GDN attention recorded as unsupported, with vLLM's reason
VIME's own Qwen3-Next model at its recipe layout (TP2 + SP / EP4 / ETP1 / DP2) not claimed by VIME; not measured here reused unmodified, as the replay and training baseline (it cannot run at TP4, see What 2)
vllm bench latency n/a (timing tool) not used: it builds the engine from its own arguments, samples at temperature 1.0 and keeps only the end-to-end time of a batch. The runner times the same LLM.generate call, but builds the strict engine from the l2 run's certificate, measures the time to the first token separately, and records each arm's tokens for the consistency checks
Megatron's step timers (config.timers) n/a (timing tool) not used: the runner turns them off (config.timers = None) and times train_one_step and the optimizer step with a CUDA synchronize around each, the same way in both arms

Decision: reuse stock vLLM and stock VIME unmodified as the native baselines, and time every arm through the frameworks' own entry points (LLM.generate, train_one_step) in one runner; nothing in either framework is changed.

Results (B200 / Blackwell)

On 4 × B200: replay and training at 37e04258, rollout at 3e06906f. Each job first passed the TP4 chain at its commit (37e04258: preflight → l2, bi 97 / 97, gate rc 0; 3e06906f: preflight → l2).

B200

Rollout (prefill + decode).

  • Strict takes 16.6-73.5× as long as stock vLLM with CUDA graphs, and 2.8-7.1× as long as eager.
  • Prefill is no longer the cost: 0.18-0.71 s to the first token for the certified prompts. Decode is: at batch 1, strict decodes 5.0-5.5 tokens/s, against eager's 15.9-16.0 and CUDA graphs' 298-308.
  • The connection limit: without CUDA_DEVICE_MAX_CONNECTIONS=1, stock vLLM is within 2% of the 37e04258 run, except CUDA graphs at p256 b4 and p1024 b4 (19-27% slower, in two runs) and eager at p256 b4 (10% faster). Strict, unchanged, is 1.01-1.03×.
  • One arm has 1 round, not 2: stock CUDA graphs, certified workload. Round 0 failed while compiling: two TP ranks hit Triton KeyError: 'cubin' in the cold shared compile cache, and the others timed out. A rerun failed the same way in round 0; its round 1 agrees within 5%. Both runs are in the ZIP.
  • Consistency: strict gives the same tokens across repeats and rounds on all 9 shapes. Stock vLLM does not: at p256 b4, p1024 b4, long b16 and b64, with CUDA graphs and eager alike, its tokens differ between repeats or rounds of the same request. VLLM_BATCH_INVARIANT=1 is refused by vLLM 0.30.0 for GDN attention.

Replay (forward + selected-token logprob).

Workload Shape Strict Stock VIME Strict / stock
certified p64 b1 0.200 s 0.265 s 0.75
certified p1024 b1 0.293 s 0.296 s 0.99
certified p1024 b4 0.432 s 0.308 s 1.40
long p512+512 b1 0.297 s 0.287 s 1.03
long p512+512 b16 1.146 s 0.338 s 3.39

Training, one step.

Workload Strict step (optimizer / forward + backward) Stock VIME step (optimizer / forward + backward) Strict / stock
certified, p64 b4 75.1 s (25.7 / 49.4) 29.0 s (27.0 / 2.0) 2.6
long, p512+512 b4 570.2 s (26.0 / 544.3) 30.1 s (27.9 / 2.2) 18.9

Results (H100 / Hopper)

On 4 × H100, rollout and replay only: the strict TP4 actor needs about 120 GB per GPU to train. Replay at 37e04258 (after the TP4 chain: bi 97 / 97, gate rc 0), rollout at 3e06906f (after the chain to l2).

H100

  • Rollout: strict takes 16.8-71.9× as long as CUDA graphs and 2.5-6.5× as long as eager. At batch 1, strict decodes 3.1-3.5 tokens/s, against 9.2 eager and 231-238 with graphs. Stock vLLM's tokens again differ between repeats at p1024 b4 (eager), long b16, and long b64 (eager); strict's do not.
  • The connection limit: without it, stock vLLM with CUDA graphs is 0.98-1.00× the 37e04258 run, and eager 1.01-1.02×; strict is 1.00-1.01×.
  • Replay: strict / stock 0.63-0.88 for the certified shapes up to p1024 b1, 1.14 at p1024 b4, and 0.93 / 1.17 / 2.71 for the long workload at batch 1 / 4 / 16.

Status

History

  • 2026-11-20:
    • First full run at f5100979. Strict prefill took 11.6 s for a 1024-token prompt; the cause, a per-token GDN loop, is fixed in [WS1][CUDA][Qwen3-Next] Strict GDN recurrence in one launch per layer #744.
    • Stock VIME's replay failed at TP4 on the expert loader (ETP4).
    • Running it at EP4 (9eea76a2) then failed on the attention output gate: Qwen3-Next has 2 KV heads, fewer than the TP size.
    • So the stock arm moved to its recipe layout (64f18040). Megatron then refused training without sequence parallel at TP > 1, which e0f1959c turns on, as the recipe does.
  • 2026-11-21: the full run on B200 at 37e04258, all green.
  • 2026-11-22, bot round: 7f41bb9f.
  • 2026-11-22: the H100 run at 37e04258, all green. Stacked on [WS1][CUDA][Qwen3-Next] Strict GDN recurrence in one launch per layer #744; the chart shows each arm's layout.
  • 2026-11-23: the rollout re-measured on B200 and H100 at 3e06906f, where the stock vLLM arms no longer keep CUDA_DEVICE_MAX_CONNECTIONS=1, which only Megatron needs. It changes the stock numbers by at most 2%, except B200 CUDA graphs at p256 and p1024 b4 (19-27% slower). New ZIP and charts.
  • 2026-11-23, bot round on 8fbacb87:
    • 9dbb5c5b: the workers get an absolute l2 run path.
    • ecfdf358: the report says that replay and training compare the two layouts as they run, not per-rank provider speed.
    • 7b5550b3 ([WS1][CUDA][Qwen3-Next] Strict GDN recurrence in one launch per layer #744): the GDN gradient check against FP64 at mixed lengths.
    • Three findings needed no change (strict xpass, user-site paths, the functional state bank).
    • Each finding has a reply.
  • 2026-11-23, bot round on ecfdf358: de5dee2c.
    • Each worker waits for free GPUs. If a process is still on them, the arm is recorded as not measured; before, the idle check after a worker only waited.
    • A --out that holds an earlier run is refused, so its worker files cannot be read as this run's.
    • The all-empty GDN bank is fixed in [WS1][CUDA][Qwen3-Next] Strict GDN recurrence in one launch per layer #744. Strict xpass needed no change again: pytest never sets wasxfail on a failed report.
    • The published runs predate the idle guard. The one worker after a failure agrees with its own second round.
    • Each finding has a reply.
  • 2026-11-23, bot round on de5dee2c: 1c90548a, 3ae6ad43.
    • A worker that exceeds --timeout is recorded as an error; before, it aborted the run before report.json was written.
    • same_tokens_across_rounds is null with one round. The one published one-round arm says true there; the report now says the check does not apply to it.
    • The chart refuses to combine reports with different recorded versions. The published charts pass: on each GPU, all 8 version keys are equal.
    • Each finding has a reply.
  • 2026-11-24, bot round on 3ae6ad43: strict xpass again. It now has a test in [WS1][CUDA][Qwen3-Next] Follow-up to the RFC #428 stack: CI skip guard, case outcomes, worker attributes, user-site guard, CUDA_DEVICE_MAX_CONNECTIONS #740 (41f79bbe, merged in f20121c8): pytest reports it as failed, and the recorder counts a failure. The finding has a reply.
  • 2026-11-28: the release ZIP was re-uploaded with the host names in torch's rendezvous files masked; nothing else in it changed. The report cites the new SHA-256 (841a7ffc).

Tests

Command Environment Result
pytest tests/models/qwen3_next/test_qwen3_next_e2e_bench.py training environment, head 1c90548a 25 passed
pytest tests/models/qwen3_next/ (CPU tests) training environment, heads ecfdf358 and 3e06906f the same 15 failures at both heads (the test_qwen3_next_training_checkpoint.py group, as below)
pytest tests/models/qwen3_next/check_qwen3_next_gdn_sequence.py 1 × B200, head 7b5550b3 (#744) 18 passed
pytest tests/models/qwen3_next/test_qwen3_next_e2e_bench.py test_qwen3_next_vime_runtime_actor.py test_qwen3_next_native_recompute.py training environment, head 29e39686 32 passed
pytest tests/models/qwen3_next/ training environment, head 0ce47260 561 passed, 104 skipped, 15 failed (1 × B200 visible). The 15 are the training environment's test_qwen3_next_training_checkpoint.py group: Invalid device id once the cuDNN path is set, as on the B200 and H100 nodes
the speed test itself 4 × B200 and 4 × H100, 37e04258 rc 0, tracked_tree_dirty: false, no failures; only VLLM_BATCH_INVARIANT=1 unsupported
the speed test, rollout phase 4 × B200 and 4 × H100, 3e06906f rc 0, tracked_tree_dirty: false; only VLLM_BATCH_INVARIANT=1 unsupported. On B200, stock CUDA graphs / certified lost round 0 to a compile-cache failure (above)
mypy --ignore-missing-imports rl_engine/ as CI, without site-packages no errors in files this PR changes (the same 8 as test-qwennext, in two other files)
pre-commit run --from-ref be9b0285 --to-ref HEAD passed

Scope / Known limitations

  • Measures, changes no strict arithmetic. The strict arm is the certified path.
  • Layouts differ by necessity: strict runs TP4 and stock VIME runs TP2 + SP / EP4 / DP2, both on the same four GPUs. A per-layout comparison is not possible, because stock VIME does not run Qwen3-Next at TP4. So the replay and training ratios compare the two setups, not per-rank provider speed: each strict rank processes every sequence, each stock rank half of them.
  • Training is B200 only.
  • Known gaps, for later PRs:
    • strict training's forward + backward (the GDN backward still differentiates the per-token loop, and the MoE backward loops over experts);
    • strict decode (one sequence at about 5.5 tokens/s on B200).

…pped

The step only asserted four visible GPUs. A missing vLLM, kernel or
dtype support makes these modules skip, and pytest exits 0 for an
all-skipped run, so the job reported a real-model pass that never ran.
Apply the provider step's guard: tee the log, fail on any skip and
require at least one pass.

Signed-off-by: Wenbo Ji <[email protected]>
The case recorder wrote "skipped" for every report with wasxfail, so a
non-strict xpass of a mandatory case showed up as a skip. Record xfail
and xpass as themselves. The verdict is unchanged: xfail counts as a
skip and xpass as a failure, and either fails the run.

Signed-off-by: Wenbo Ji <[email protected]>
…constructor

SharedQwenWorker assigned shared_l2_trace and the execution mode after
Worker.__init__. vLLM 0.30.0's constructor calls no model method, so
nothing read them early, but an override reached from a later vLLM's
constructor would raise AttributeError. Assign both first; the contract
test checks they exist when the native constructor runs.

Signed-off-by: Wenbo Ji <[email protected]>
…ckages

On an H100 host every rollout smoke aborted while FlashInfer loaded
(__ffi_repr__ already registered): apache-tvm-ffi 0.1.16 in the user
site-packages was imported ahead of the environment's own copy. The
user site comes first on sys.path, so a package there replaces the
environment's copy, and the environment identity listed both without
flagging it.

current_identity() now raises environment_mismatch when a distribution
in the user site also exists in another installation root, and names
the packages and PYTHONNOUSERSITE=1. Packages only in the user site are
still recorded as before. The chain usage doc says so.

Signed-off-by: Wenbo Ji <[email protected]>
On four H100s the l2 recompute failed in Megatron's validate_args, which
requires CUDA_DEVICE_MAX_CONNECTIONS=1 with tensor parallelism. The B200
runs did not hit the check. The dense launcher already sets it; the
Qwen3-Next stage environment did not.

Set it next to the thread limits, outside provider_config.runtime_env,
so the run manifest does not change. It limits the hardware work queues
and does not change any kernel's arithmetic. The B200 chain has not been
rerun with it.

Signed-off-by: Wenbo Ji <[email protected]>
…ock vLLM and VIME

RFC RL-Align#428 asks for performance against the qualified native path for training,
prefill and decode. The chain checks only correctness, and its harnesses trace
every layer, so they cannot be timed.

benchmarks/models/qwen3_next/qwen3_next_e2e_bench.py runs after a passing
certified l2 stage at the same commit and reads its manifest. On the same four
GPUs and topology it times:
- rollout: the certified engine (CUSTOM attention, shared model, batch-invariant
  mode, eager) with vLLM's scheduler and no tracing, against stock vLLM with
  CUDA graphs, eager, and VLLM_BATCH_INVARIANT=1;
- replay: one VIME forward plus selected-token logprob, RL-Kernel spec and
  provider against VIME's own Qwen3-Next spec;
- train: VIME train_one_step, with the optimizer step timed separately.

Two workloads: the L2 shapes the certificate covers, and a 512 + 512 token set
that runs the certified providers outside those shapes. Each arm, phase and
workload runs in its own process; rounds alternate the arm order. Rollout also
records whether greedy tokens repeat across repeats and processes, and whether
row 0 of a batch equals the single-request run.

create_actor/runtime_argv gain providers= (stock VIME spec, model provider and
logprob; default unchanged) and seq_length= (default 1040, never below).

Signed-off-by: Wenbo Ji <[email protected]>
…rted

vLLM 0.30.0 refuses VLLM_BATCH_INVARIANT=1 for Qwen3-Next's GDN layers
("batch_invariant mode is not supported for GDN_ATTN"). The first B200 run
listed that arm as a crash. The bench now records it under the phase's
"unsupported" entry with the engine's message, and leaves it out of the
ratios.

Signed-off-by: Wenbo Ji <[email protected]>
packed_recurrent_sequence launched vLLM's packed decode kernel once per token
position from Python, so the GDN layers cost about 0.28 ms per token per layer
on a B200, independent of batch and cache size. With 36 GDN layers that was
about 10 ms per prompt token in strict vLLM prefill, VIME replay and the
training forward.

The forward now calls vLLM 0.30.0's fused_recurrent_gated_delta_rule, which
runs the same per-token update with the same tiles (BK=128, BV=32, one warp,
three stages) and the time loop inside one launch. It takes g and beta as
inputs; a small Triton kernel computes them with the decode kernel's own
loads, casts and expressions. Computing them in PyTorch instead changes low
bits, so the copy is required.

The backward differentiates the old per-token decode loop, now
decode_loop_sequence, so gradients come from the same computation as before.
GDNProviderConfig.recurrence is renamed, so an older certificate does not
cover this provider.

check_qwen3_next_gdn_sequence.py now also requires the one-launch forward to
equal the decode loop bit for bit (output, final state, untouched slots of a
362-slot bank, mixed and zero lengths), and the gradients of both to be equal.
On one B200 the layer takes 2.3 ms instead of 348 ms for 1024 tokens.

Signed-off-by: Wenbo Ji <[email protected]>
At EP1 the bench actor splits each expert four ways by expert tensor
parallelism. Stock VIME's HuggingFace loader cannot shard that layout:
Megatron's grouped expert layers divide the expert width themselves and
carry no tensor-parallel flag, so the loader copies the full expert
tensor and stops with a shape mismatch. VIME's own Qwen3-Next recipe
uses expert tensor parallel 1.

Run both arms on an EP4 l2 run instead. The train actor now takes the
run's EP, as replay already did. On an EP1 run the stock replay and
train arms are recorded as unsupported without being started.

Signed-off-by: Wenbo Ji <[email protected]>
Stock VIME cannot run Qwen3-Next at TP4 with any EP. The model has two
KV heads; when TP exceeds them Megatron gives each rank the query heads
of a whole KV group and keeps its share for attention, but does not
narrow the attention output gate, so the forward stops on the gate's
shape. Its expert weights also load only with expert tensor parallel 1.
The EP4 rule of the previous commit therefore did not help, and
training at EP4 is refused for the certified strict profile.

The stock replay and train arms now run VIME's recipe layout on the
same four GPUs: TP2, expert tensor parallel 1, experts over all four
ranks, data parallel 2. Each step handles the same samples; the two
data-parallel replicas split them (a single sample leaves one replica a
filler copy, which every rank needs for the MoE all-to-all) and the step
time is the slowest rank's. The strict arm keeps the l2 run's certified
TP4 layout; strict training on an EP4 run is reported as unsupported.
The report records each arm's layout and why the stock one differs.

Signed-off-by: Wenbo Ji <[email protected]>
Megatron's MoE layer refuses to train at TP > 1 without sequence parallel,
so the stock VIME train phase failed at its TP2 layout. VIME's own
Qwen3-Next recipe runs TP2 with --sequence-parallel; the stock arm now does
too, for replay and training. The strict arm keeps its certified profile
without sequence parallel.

Replay packs its own batch, so under sequence parallel it pads the packed
tokens to a multiple of TP the way VIME's get_batch does. None of the
current workload shapes needs padding. The reported layouts record "sp".

Signed-off-by: Wenbo Ji <[email protected]>
…perf/qwen3-next-gdn-fused-recurrence

Stacks the one-launch GDN recurrence on the follow-up PR, which itself merged test-qwennext 12d5041.

Signed-off-by: Wenbo Ji <[email protected]>
…next-e2e-bench

Stacks the end-to-end speed test on the one-launch GDN PR, which itself sits on RL-Align#740. The
measured commit 37e0425 is this branch's parent; the merge adds only RL-Align#622's files (via RL-Align#740).

Signed-off-by: Wenbo Ji <[email protected]>
The figure title said TP4 for every arm, but stock VIME's replay and training run at TP2 +
SP / EP4 / DP2; it now prints both layouts from the report's phases.replay.layouts. Stock
VIME had the same colour as stock vLLM with CUDA graphs, and an arm the engine refused
(VLLM_BATCH_INVARIANT=1 for GDN) appeared in the legend as if measured; it is now labelled
refused, not measured.

Signed-off-by: Wenbo Ji <[email protected]>
Bits against the per-token loop, the real-weight TP4 / EP4 chain and the strict path's time
before and after, with a link to the raw results (release ZIP) and how to reproduce them.

Signed-off-by: Wenbo Ji <[email protected]>
…RFC RL-Align#428 section 7)

Strict path against stock vLLM (CUDA graphs, eager) for rollout and against stock VIME at
its recipe layout for replay and training, at 37e0425, with both charts, a link to the raw
results (release ZIP) and how to reproduce them.

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

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 98d38d8b-0b24-44c2-b702-0c1a23592d8b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

probe_environment ran qwen3_next_runtime.py --json with check_output, so a refusal in the
child (environment_mismatch for a shadowing user site) reached the launcher as a bare
'returned non-zero exit status 1'. It now captures the child's stderr and raises a
ProcessFailure with its tail and failure_kind. New test with a refusing stand-in interpreter
(fails on the old code).

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

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

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

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

⚠️ 4 warning(s) occurred during review.


bug · medium

📄 rl_engine/integrations/engines/train/vllm/qwen3_next_gdn.py (L398-L409)

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

decode_loop_sequence is now the documented reference that packed_recurrent_sequence claims bit-equality with, but the two paths diverge on empty input. _fused_sequence guards if not max(lengths, default=0) and returns empty tensors, whereas _decode_loop still executes torch.cat(outputs) over an empty list when every sequence boundary is equal (all-zero lengths, e.g. an empty packed batch). That raises RuntimeError: torch.cat(): expected a non-empty list of Tensors. It also crashes the autograd path: _PackedSequence.backward always calls _decode_loop, so a forward over zero tokens succeeds but backprop fails. Mirror the empty guard in _decode_loop (return qkv.new_empty((0, state.shape[1], 128)) / torch.cat fallback) so the reference and fused forward agree on the empty case.


⚠️ Warnings:

  • .github/workflows/qwen3-next-provider-gpu.yml (review_limit_reached): reached the aggregate token budget before finishing; the grace round completed the task
  • rl_engine/validation/models/pytest_case_manifest.py (token_budget_reached): stopped dispatch: used 614445 tokens + group estimate 97272 = projected 711717 exceeds budget 500000
  • benchmarks/models/qwen3_next/e2e_bench_cases.py,benchmarks/models/qwen3_next/plot_qwen3_next_e2e_bench.py,benchmarks/models/qwen3_next/qwen3_next_e2e_bench.py,tests/models/qwen3_next/test_qwen3_next_e2e_bench.py (review_limit_reached): reached the aggregate token budget before finishing; the grace round did not complete the task
  • rl_engine/integrations/engines/rollout/vllm/qwen3_next_vllm_worker.py,rl_engine/integrations/engines/train/vllm/qwen3_next_gdn.py,rl_engine/integrations/engines/train/vllm/qwen3_next_provider.py,rl_engine/integrations/orchestrators/vime/providers/qwen3_next_vime_runtime.py,tools/validation/models/qwen3_next/qwen3_next_runtime.py (review_limit_reached): reached the aggregate token budget before finishing; the grace round did not complete the task

Comment on lines +580 to +581
timeout=args.timeout,
).returncode

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · high
A worker that exceeds --timeout raises subprocess.TimeoutExpired here. That exception is not caught, so it propagates out of run_worker -> orchestrate -> main, aborting the whole benchmark before report.json is written (all measurements collected so far are lost) and skipping the wait_gpus_idle() cleanup below. For the actor phases the mp.spawn grandchildren are not killed by subprocess.run, so they can stay resident on the four GPUs and later arms will never run. Handle the timeout like the busy-GPU case: record the arm as not measured and still wait for the GPUs.

Suggestion:

Suggested change
timeout=args.timeout,
).returncode
try:
with log.open("w") as handle:
code = subprocess.run(
command,
cwd=manifest["source"],
env=arm_environment(base_env, arm),
stdout=handle,
stderr=subprocess.STDOUT,
timeout=args.timeout,
).returncode
except subprocess.TimeoutExpired:
idle = wait_gpus_idle()
return {
"error": f"worker timed out after {args.timeout}s; see logs/{log.name}",
"gpus_after_timeout": idle,
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 1c90548a. A subprocess.TimeoutExpired is now caught in run_worker. The arm is recorded as error ("worker timed out after N s; see logs/…"), the run goes on, and report.json is written as usual.

  • subprocess.run kills the worker itself on a timeout. Its mp.spawn children may outlive it, so the record also says whether the GPUs were idle after waiting.
  • If they are still busy, the next worker's pre-start check (de5dee2c) records that worker as not measured instead of timing it next to them.

New test test_worker_timeout_is_recorded_not_raised.

…e constructor

The existing check builds the worker without a config, so the mode it sees
is None. The new check passes a config with an identity and asserts that
the mode activated for it is already set when vLLM's Worker.__init__ runs;
it fails if the worker drops the mode.

Signed-off-by: Wenbo Ji <[email protected]>
…equal versions

- A worker that exceeds --timeout is recorded as an error instead of
  aborting the run before report.json is written.
- same_tokens_across_rounds is null, not true, when only one round
  produced the shape.
- combine_reports refuses reports whose recorded versions differ (torch,
  vLLM, Triton, Megatron-core, ...), not only the GPUs.

New tests.

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

Copy link
Copy Markdown
Contributor Author

Replies to the two OpenCodeReview findings routed to the summary (run on de5dee2c).

1. e2e_bench_cases.py L214-215: same_tokens_across_rounds is true with one round. Fixed in 1c90548a: it is now null (does not apply) when only one round produced the shape. New assertion in test_merge_rounds_pools_values_and_compares_tokens_across_processes.

  • One published arm has one round: B200, stock CUDA graphs, certified workload. Its report.json predates the fix and says true there.
  • 3ae6ad43 says this in the report, next to the note on that arm's single round. Those shapes' within-round check (same_tokens_across_repeats) still applies, and is false at p256 b4 and p1024 b4.

2. e2e_bench_cases.py L271-272: combine_reports checks only the GPUs. Fixed in 1c90548a: it refuses reports whose recorded versions differ in any key (torch, vLLM, Triton, Megatron-core, FlashInfer, Transformer Engine, VIME, GPUs), and names the keys. New assertion with a different vLLM version.

  • The published charts pass this check. On each GPU, the 37e04258 and 3e06906f reports record identical versions in all 8 keys.

@Flink-ddd Flink-ddd added platform: cuda Specific optimizations or bugs in NVIDIA graphics cards (such as FlashInfer, TMA optimizations) new-model qwen WS1 labels Nov 24, 2026
…s a failure

The worker execution-mode test also checks that the activator gets the
configured identity itself, so a dropped or different identity fails it.

A strict xpass gets its own case in the plugin test: pytest reports it as
"failed" without wasxfail, and the report counts it under failures.

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

Copy link
Copy Markdown
Contributor Author

Reply to the OpenCodeReview finding routed to the summary (run on 3ae6ad43).

pytest_case_manifest.py L67-69: strict xpass. Not changed, and now tested (41f79bbe in #740, merged here in f20121c8).

  • pytest reports a strict xpass as failed with [XPASS(strict)] in longrepr, and does not set wasxfail on it (_pytest/skipping.py, pytest 9.1.1). So the branch is not taken, the recorder stores failed, and execution_verdict counts it under failures, not skipped.
  • test_plugin_enforces_real_pytest_outcomes has a new strict-xpass case: a real pytest subprocess runs an xfail(strict=True) test that passes. The report says call: failed, failures == 1, skipped == 0 and passed false, with exit status 1.

g=g.reshape(1, tokens, heads),
beta=beta.reshape(1, tokens, heads),
scale=scale,
initial_state=new_state,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · high
The state bank is handed to fused_recurrent_gated_delta_rule unchanged, but the two kernels do not use the same last-two-dims order. This repo's own transcription of the decode kernel (rl_engine/reference/linear_attn/gated_delta_rule.py, docstring lines 28-36 and 140-141, and docs/archive/design/rfc428-c6-gdn-recurrent-replay.md) states the decode state ABI is [num_blocks, HV, V, K] — V-major — and unpacks it that way (h = state[blocks] used as [R, HV, V, K]). FLA's fused_recurrent_gated_delta_rule instead takes initial_state as [N, H, K, V] (K-major). Because Qwen3-Next has V == K == 128 and _validate only checks state.shape[-2:] == (128, 128), both layouts pass validation, and the data_ptr() check below only proves in-place updating, not layout — so a transposed interpretation would silently corrupt every recurrence step (and every gradient computed from _decode_loop) with no error. Please make the layout explicit instead of assuming the fused kernel matches the decode ABI, e.g. pass a K-major view and transpose the result back, and/or assert the layout against a non-square case in the GPU parity test.

Suggestion:

Suggested change
initial_state=new_state,
# FLA takes [N, H, K, V]; the decode ABI bank is [num_blocks, HV, V, K].
initial_state=new_state.transpose(-1, -2).contiguous(),

The release ZIP was re-uploaded with the host names in torch's rendezvous
files masked; nothing else changed. The report cites its new SHA-256.

Signed-off-by: Wenbo Ji <[email protected]>
Comment on lines +319 to +321
logits = captured[0].reshape(-1, captured[0].shape[-1])[positions]
# Looked up at call time: the RL-Kernel provider when installed, else VIME's.
vime_loss.calculate_log_probs_and_entropy(logits, targets, group, with_entropy=True)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · high
For the stock (native) replay arm this indexing is inconsistent with the sequence-parallel layout: create_actor sets args.sequence_parallel = not providers (see qwen3_next_vime_runtime.py), so with the native arm (providers=False, layout sp=True) the LM-head output captured by the forward hook is the rank's local sequence shard, not the full packed sequence. The code itself relies on that (multiple = layout["tp"] if layout["sp"] else 1 pads the packed tokens to the TP multiple). However, positions from response_positions(shape, rows) are global indices into the DP-share packed sequence. Indexing the local shard with global positions will either raise IndexError once a position exceeds the shard length (e.g. shape (512, 1, 512): positions start near token 511 while the shard holds only 512 tokens) or silently select the wrong tokens, so the native replay arm is either recorded as a failure or measures a wrong logprob. The strict arm is unaffected (sp=False, full sequence). Index with each rank's local shard positions (or gather the sequence dimension before indexing) as stock VIME does.

Suggestion:

Suggested change
logits = captured[0].reshape(-1, captured[0].shape[-1])[positions]
# Looked up at call time: the RL-Kernel provider when installed, else VIME's.
vime_loss.calculate_log_probs_and_entropy(logits, targets, group, with_entropy=True)
# Map global packed positions onto this rank's sequence-parallel shard
# (or gather across TP) before indexing the captured logits.

fusheng-ji added a commit to fusheng-ji/RL-Kernel that referenced this pull request Nov 28, 2026
…ownloads are served as attachments); RL-Align#744 plot script

Signed-off-by: Wenbo Ji <[email protected]>
…ets commit

pr_assets was rewritten to remove host and user identifiers; the charts'
commit f295151 is now 9d2d72e, with the same files.

Signed-off-by: Wenbo Ji <[email protected]>
)
if len(captured) != 1:
raise RuntimeError("Expected exactly one LM-head output per forward")
logits = captured[0].reshape(-1, captured[0].shape[-1])[positions]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · high
The native replay arm runs with sequence parallel (create_actor(providers=False) forces args.sequence_parallel = True, TP2), but this captures raw.output_layer's output and indexes it with positions derived from the full packed length of this DP rank's share. Under Megatron sequence parallel the hidden states reaching the LM head are split across the TP group, so captured[0] for a TP rank covers only its sequence chunk (and its reshape(-1, vocab/tp) row count is the local shard, not the full packed length). Indexing it with full-share positions therefore either raises IndexError once a position exceeds the local shard (e.g. certified (64,1,16): packed length 80, TP2 shard 40, positions 63..78) or, where it stays in range, selects the wrong tokens. The strict arm is unaffected because actor_layout gives it sp=False. The reference native_recompute.response_rows only ever exercises this under TP4/no-SP, so it does not cover this path, and the CPU tests here do not run a real TP reactor. As written, the native replay logprob — and thus the strict/native replay ratio — is measured against misaligned logits. Either disable SP for the replay actor, or gather the sequence shards (or offset positions per TP rank) before indexing.

…_assets

The release ZIPs were re-uploaded with the B200 PCI bus IDs masked, and
pr_assets was rewritten to remove host and user identifiers. The merged
batch-invariance, chain and EP4 logprob reports cite the ZIPs' new SHA-256,
and the two RMSNorm docs link pr_assets c44f3f1 (was 692c408), which holds
the same files.

Signed-off-by: Wenbo Ji <[email protected]>
The release ZIP was re-uploaded with the B200 PCI bus IDs and a site home
path masked; the report cites its new SHA-256.

Signed-off-by: Wenbo Ji <[email protected]>
… IDs

The release ZIP was re-uploaded again with the B200 PCI bus IDs masked; the
report cites its new SHA-256.

Signed-off-by: Wenbo Ji <[email protected]>
fusheng-ji added a commit to fusheng-ji/RL-Kernel that referenced this pull request Nov 29, 2026
…ownloads are served as attachments); RL-Align#744 plot script

Signed-off-by: Wenbo Ji <[email protected]>
The release asset qwen3-next-gdn-one-launch-b200-h100.zip was repacked
with the numeric user and group IDs masked in its environment records
and replaced. Update the SHA-256 the report cites.

Signed-off-by: Wenbo Ji <[email protected]>
…ets commit

pr_assets history was rewritten to mask account IDs in published
evidence. The two chart images are unchanged; only the commit that
holds them moved.

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

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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants