Repository navigation
[WS1][CUDA][Qwen3-Next] Full-model chain: vLLM rollout vs VIME recompute, raw-bit through two updates and a reload (RFC #428 stack 7/11) - #543
Conversation
Signed-off-by: Wenbo Ji <[email protected]>
RFC RL-Align#428 full_model_chain (CUDA). - Engine adapters: the native vLLM rollout (exact-prefill scheduler, paged KV, traced response rows), the VIME/Megatron replay and training actor, engine weight import/export and the logprob adapter, all on the shared TP4 providers. - Stage runners (preflight, layers, l2, train1, train2, train) with the validated acceptance contract (version 4) and scripts/qwen3_next_run.py, a launcher that works inside any four-GPU allocation: each stage gets a clean clone, an immutable run.json identified by a fresh execution_id, and refuses a predecessor that did not pass or pins another identity. Scheduler-independent helpers live in scripts/qwen3_next_runtime.py. - Sub-node digests: both engines observe the normed mixer input, the mixer output, the normed MLP input, the selected expert ids and the MoE output of every layer, plus the embedding; the first divergence names the layer and sub-node. - scripts/qwen3_next_chain_report.py writes a ChainGateReport-compatible report (schema qwen3-next-chain-v1, compatible with ws1-c10-c11-v5) with first_drift_family/layer/cell; scripts/qwen3_next_publish_evidence.py publishes a chain's records without site paths, hosts or users. - Native rollout caps raised to 64 sequences, 16384 batched tokens and a 4 GiB KV budget so the batch-invariance matrix runs under the same certified profile; the exact-prefill scheduler still fixes every chunk. - The operator-case registry is regenerated from collection by scripts/qwen3_next_operator_cases.py. - Packaging: transformers may be 5.13.1-5.17.0; a qwen3-next extra pins the audited runtime. Signed-off-by: Wenbo Ji <[email protected]>
Editable sources, base interpreters and build directories in package metadata now keep only their last path component; cgroup paths keep only their file name. The leftover check matches absolute paths only, so package paths such as vllm/.../cpu/data/ are not flagged, and any mention of the batch scheduler blocks publication. Signed-off-by: Wenbo Ji <[email protected]>
Merge the migrated TP4 mixers (and through them the refactored test-qwennext) and move the full-model chain into the new layout: - model-level TP4 pieces (embedding, engine weights, logprob, sub-node observations) into rl_engine/models/qwen3_next/; - vLLM adapters and the native rollout into rl_engine/integrations/engines/rollout/vllm/; - VIME providers into rl_engine/integrations/orchestrators/vime/providers/ and the native VIME lifecycle (recompute, training, workers, profile) into rl_engine/integrations/orchestrators/vime/experiments/qwen3_next/; - the provider identity into rl_engine/integrations/common/; - chain report, L2/case fixtures and manifests into rl_engine/validation/models/; - stage runners and the launcher into tools/validation/models/, CI scripts into ci/scripts/, tests into tests/models/qwen3_next/. Imports point at canonical modules; the provider-source digest list names the canonical RMSNorm backend instead of its compatibility alias. Recorded contract identities (e.g. sample_counter_owner) are unchanged. Signed-off-by: Wenbo Ji <[email protected]>
Signed-off-by: Wenbo Ji <[email protected]>
…ouched The published chain evidence is a byte-exact copy covered by SHA256SUMS; a pytest JUnit XML without a final newline would otherwise be rewritten by end-of-file-fixer and break the checksum. Same treatment as reports/archive/. Signed-off-by: Wenbo Ji <[email protected]>
…p directory Node ids are relative to pytest's rootdir. When the temp directory sits under another checkout, the subprocess picked that checkout as rootdir and the manifest's case id no longer matched. Signed-off-by: Wenbo Ji <[email protected]>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
tools/validation/models/plot_qwen3_next_chain.py draws, from the published evidence only, the rollout-vs-recompute raw-bit matrix (16 cases x 4 weight versions x tokens/logits/logprobs/layer digests) and the per-layer digest change between weight versions. Signed-off-by: Wenbo Ji <[email protected]>
Signed-off-by: Wenbo Ji <[email protected]>
b5d63a5 to
45a343f
Compare
Signed-off-by: Wenbo Ji <[email protected]>
…xt gate scripts The scripts moved from ci/ to ci/scripts/ with the repository refactor but still resolved the root one directory up, so the preflight operator gates looked for the runner under ci/. Signed-off-by: Wenbo Ji <[email protected]>
Signed-off-by: Wenbo Ji <[email protected]>
Per the layout review on RL-Align#549, this branch's own files move the way RL-Align#549 already moved them, by applying that migration to this branch's versions: - validation modules and JSON resources go to rl_engine/validation/models/qwen3_next/, runners and stage scripts to tools/validation/models/qwen3_next/; imports, resource paths, CI scripts and tests follow; - the chain plot moves to the Qwen3-Next benchmark PR; - the committed chain evidence becomes a ZIP release attachment with a short summary in reports/experiments/qwen3_next/ (bytes unchanged), so the pre-commit exclusion for it is dropped. The RMSNorm files that RL-Align#467/RL-Align#468 introduce keep their paths here. Signed-off-by: Wenbo Ji <[email protected]>
| python3 -m pytest -q -rs tests/models/qwen3_next/check_qwen3_next_norm_providers.py tests/models/qwen3_next/check_gdn_recurrent_golden.py \ | ||
| tests/models/qwen3_next/check_qwen3_next_forward.py tests/models/qwen3_next/check_qwen3_next_attention.py \ |
There was a problem hiding this comment.
This expands the set of PR-controlled test modules executed on the GPU provider runner (which the pinned torch==2.13.0+cu130 / vLLM 0.30.0 environment implies is a dedicated/self-hosted image). If this job is triggered by pull_request and the runner holds any credentials or is persistent, a fork PR can run arbitrary Python (these modules import vLLM and touch the GPU) with that access. Please confirm the runner is ephemeral/credential-free for untrusted PRs, or gate the run to a trusted-base checkout (e.g. pull_request_target with base-code + artifact checkout) so PR-controlled code does not execute with privileged access.
Provider job, chain preflight (failed at rollout-smoke), logprob prior art over 13 NCCL settings, EP matrix at 2c699e3, RL-Align#557 gates at f935bf3, RL-Align#549 parity at 30c0e5a, RL-Align#543/RL-Align#544 preflight at their own heads. Redacted. Signed-off-by: Wenbo Ji <[email protected]>
… gpu probe Signed-off-by: Wenbo Ji <[email protected]> (cherry picked from commit a705d28) Signed-off-by: Wenbo Ji <[email protected]>
…RL-Align#543 Signed-off-by: Wenbo Ji <[email protected]>
…GPUs only Signed-off-by: Wenbo Ji <[email protected]>
Signed-off-by: Wenbo Ji <[email protected]>
A report with "passed": "false", 1 or null exited 0 or 1 as if judged; it is now a malformed report (exit 2), like the other structural checks. Signed-off-by: Wenbo Ji <[email protected]>
The vLLM attention-metadata test imported vLLM at collection time under a test_ name, so a default pytest run over tests/ failed collection without vLLM and broke the no-optional-framework import check with it. It is now check_qwen3_next_vllm_attention_metadata.py. The provider step also runs check_qwen3_next_native_rollout.py, check_qwen3_next_engine_metadata.py and check_qwen3_next_vllm_model_contract.py, which no job ran before; the chain doc no longer lists the attention-metadata test as needing VIME. Signed-off-by: Wenbo Ji <[email protected]>
…n#543 Signed-off-by: Wenbo Ji <[email protected]>
| self._progress() | ||
|
|
||
| def pytest_runtest_logreport(self, report): | ||
| outcome = "skipped" if hasattr(report, "wasxfail") else report.outcome |
There was a problem hiding this comment.
This collapses two distinct pytest states into "skipped": a genuine xfail (report.outcome is already "skipped" with wasxfail) and an xpass (report.outcome is "passed" with wasxfail). For an xpass the record loses the fact that the mandatory case actually passed (and that a known-broken case started passing), so the acceptance verdict can either be reported as a skip (false acceptance if execution_verdict accepts skips) or hide the regression. Preserve the real outcome and only normalize the xfail case, e.g. distinguish report.outcome == "passed" from "skipped" when wasxfail is set.
Suggestion:
| outcome = "skipped" if hasattr(report, "wasxfail") else report.outcome | |
| if hasattr(report, "wasxfail") and report.outcome == "skipped": | |
| outcome = "xfail" | |
| elif hasattr(report, "wasxfail"): | |
| outcome = "xpass" | |
| else: | |
| outcome = report.outcome |
There was a problem hiding this comment.
Fixed in the follow-up #740 (add156f5). The recorder now writes xfail and xpass instead of skipped for both. This was not a false acceptance: execution_verdict fails a run with any skipped case, so a non-strict xpass already failed it. The verdict is unchanged: xfail counts as a skip and xpass as a failure.
| register_shared_model() | ||
| self.shared_provider_binary = imported_provider_identity() | ||
| super().__init__(*args, **kwargs) | ||
| self.shared_l2_trace = None | ||
| self.shared_provider_execution_mode = mode |
There was a problem hiding this comment.
self.shared_l2_trace (and self.shared_provider_execution_mode) are only assigned after super().__init__(). In vLLM V1, Worker.__init__ performs load_model() and compile_or_warm_up_model(), which can invoke the overridden execute_model/warmup path before these attributes exist. Because execute_model unconditionally reads self.shared_l2_trace, that warm-up forward raises AttributeError and aborts worker construction. Initialize both attributes before calling super().__init__().
Suggestion:
| register_shared_model() | |
| self.shared_provider_binary = imported_provider_identity() | |
| super().__init__(*args, **kwargs) | |
| self.shared_l2_trace = None | |
| self.shared_provider_execution_mode = mode | |
| register_shared_model() | |
| self.shared_l2_trace = None | |
| self.shared_provider_execution_mode = mode | |
| self.shared_provider_binary = imported_provider_identity() | |
| super().__init__(*args, **kwargs) |
There was a problem hiding this comment.
Not a failure with the pinned vLLM 0.30.0: Worker.__init__ stores configuration and calls no model method; load_model and compile_or_warm_up_model are later calls from the executor, after the constructor returns. The full chain ran on four GPUs with this worker. I moved both assignments before super().__init__() anyway in #740 (e863c090), and the contract test now checks they exist when the native constructor runs.
Signed-off-by: Wenbo Ji <[email protected]>
…rovider job, #503 bias grad gate) into #544 Signed-off-by: Wenbo Ji <[email protected]>
…, real smoke, RL-Align#543/RL-Align#544/RL-Align#557 chains, RL-Align#544 bi 97 cells, step 5 Signed-off-by: Wenbo Ji <[email protected]>
…10-29). Includes Run A/B reports, logs, and operators collection failure bundle for B200 review.
…e (2026-10-29). Run A/B reports, logs, and operators collection bundle under pending/h100-qwen3-next-543-544/.
… evidence. Operators and layers passed; L2 failed on Megatron load_checkpoint signature; timeout reruns attached.
Provider job, chain preflight (failed at rollout-smoke), logprob prior art over 13 NCCL settings, EP matrix at 2c699e3, RL-Align#557 gates at f935bf3, RL-Align#549 parity at 30c0e5a, RL-Align#543/RL-Align#544 preflight at their own heads. Redacted. Signed-off-by: Wenbo Ji <[email protected]>
…, real smoke, RL-Align#543/RL-Align#544/RL-Align#557 chains, RL-Align#544 bi 97 cells, step 5 Signed-off-by: Wenbo Ji <[email protected]>
…, real smoke, RL-Align#543/RL-Align#544/RL-Align#557 chains, RL-Align#544 bi 97 cells, step 5 Signed-off-by: Wenbo Ji <[email protected]>
What
rl_engine/integrations/engines/rollout/vllm/); VIME/Megatron replay and the training actor (rl_engine/integrations/orchestrators/vime/); HF ↔ engine weight import/export; the TP4 logprob adapter (rl_engine/models/qwen3_next/).preflight,layers,l2,train1,train2,train) with a versioned acceptance contract, andtools/validation/models/qwen3_next/qwen3_next_run.py, a launcher that works inside any four-GPU allocation: each stage gets a clean clone, an immutablerun.jsonwith a freshexecution_id, and refuses a predecessor that did not pass or that pins a different source, environment, checkpoint, provider or topology.layer23.routerwith its layer family.rl_engine/validation/models/qwen3_next/qwen3_next_chain_report.py): every field of the Qwen3-8BChainGateReport(schemaws1-c10-c11-v5) plusfirst_drift_family,first_drift_layer,first_drift_cell.transformersmay now be 5.13.1-5.17.0 (affects every user); aqwen3-nextextra pins the audited runtime.rl_engine/validation/models/qwen3_next/, runners undertools/validation/models/qwen3_next/, the chain plot in the benchmark PR ([WS1][CUDA][Qwen3-Next] Comparison benchmarks and plots for the Qwen3-Next stack: MoE, attention, logprob, EP (RFC #428 stack 11/11) #551).Prior art & reuse decision
N/A for a new kernel: this PR composes the rows below it and reuses vLLM's engine, scheduler and paged KV, VIME/Megatron's training stack and NCCL. The engines' own paths were measured in the operator PRs: vLLM routes the MoE in BF16 while VIME/Megatron routes in FP32 and is not batch-invariant (#503), and their logprob reductions differ by up to 9.5e-7 and move with NCCL settings (#549). Both engines therefore run the shared RL-Kernel providers.
Results (4 × B200, official checkpoint)
Left: rollout vs recompute for every case, weight version and comparison. Right: share of cases whose layer digest changes between weight versions; both updates change every layer, and the reload reproduces update 2 bit for bit.
preflightlayersl2train1,train2trainqwen3-next-chain-v1passed: true,first_drift: nullThe 16 cases are prompt length 8 / 64 / 256 / 1024 × batch 1 / 4 × full / chunked prefill, 16 response tokens. Summary, tested commit and commands:
reports/experiments/qwen3_next/qwen3-next-chain-b200.md; raw stage records ZIP (SHA-2568b6f93ac…58ee6), measured atc67ec14.Status
85675a74, on top of [WS1][CUDA][Qwen3-Next] MoE route/combine contract with a batch-invariant grouped expert GEMM (RFC #428 stack 5/11) #503 (e514d42f) and [WS1][CUDA][Qwen3-Next] TP4 GDN, convolution and D=256 attention mixers on real weights (RFC #428 stack 6/11) #507. CI is green on this head: lint, unit-tests, docs, DCO and the bot review pass;providerandws1-gtestskip because no self-hosted runner is attached.preflightandgpu_probenow accept exactly four B200, H100 or H200 GPUs (af186dd2, the change [WS1][CUDA][Qwen3-Next] EP4 distributed logprob parity: expert-parallel MoE, full-model L2 bitwise on TP4 x EP4 (RFC #428 stack 10/11) #557 carried asa705d287), so an H100 run no longer needs a local patch. A CPU test pins the guard (f14478a1: four B200, H100 or H200 pass; three, eight, a mixed set with an A100, and four RTX 5090 fail withtopology_mismatch). H200 is accepted by the guard but not tested: no H200 is available to us.4e2c33afplus the same allowance as a patch)preflightfailed inrollout-smoke: with no NVSwitch multicast, vLLM's FlashInfer all-reduce falls back to itstrtllmbackend, and every rank then aborts withtvm::ffi::Error: TypeAttr __ffi_repr__ is already registered(preflight-own-head). With the same package versions, B200 runs this path without error even when thetrtllmbackend is forced, so it is being diagnosed on H100 first.layersandl2need a passedpreflight.combine_routesbackward is merged in (41b970dd). The forward is unchanged, sopreflight,layersandl2compute the same bits; the backward, which the training stages use, now sums the route-weight gradient over H withfixed_order_row_sum. Thetrain1/train2/trainresults above were measured before this change.90c09164, 4 × B200): preflight, layers (all five TP4 gates) and l2 passed; the 32 L2 artifacts (16 rollout, 16 recompute) are bitwise identical to thec67ec14run -- tokens, logits, logprobs and every layer and sub-node digest -- so the move to the reviewed layout changed no bit. The training stages were then rerun on the same commit:train1,train2andtrainpassed (16 / 16 raw-bit on every weight version; reload == update 2, continuous == resumed step 3, checkpoint fault injection), and the chain-gate report has 64 cells,passed: true,first_drift: null(raw results ZIP, SHA-256cf67f9b7…b1ca).train1andtrain2were preempted and restarted several times; each published stage is one complete passed attempt, and the training journal was checked beforetrain.trainafter a preemption can reuse the final reload of an earlier, interruptedtrainrun.repeat_reload_in_current_attemptkeys on the attempt number alone, which restarts at0in every stage run. The chain report refuses such a run ("Tensor artifact escaped its current attempt"), so it cannot pass silently; the publishedtrainrun had the earlier reload and controls retired intorecoveryfirst. Fix: key the check on the stage run as well as the attempt.15718ed3) and hashes with bounded streaming SHA-256 on Python 3.10 (45a343fd).History
af186dd2) and a CPU test for it (f14478a1); [WS1][CUDA][Qwen3-Next] MoE route/combine contract with a batch-invariant grouped expert GEMM (RFC #428 stack 5/11) #503's heade514d42fmerged in (41b970dd): the fixed-ordercombine_routesbackward, and through [WS1][CUDA][Qwen3-Next] MoE route/combine contract with a batch-invariant grouped expert GEMM (RFC #428 stack 5/11) #503's own merge oftest-qwennextthe provider workflow's fork notice reading the PR fields fromenv(2b64780b); the launcher docstring wrapped to 100 columns (85675a74). The PRs above it merge this head.pull_requestpaths were missing Qwen3-Next modules that its checks import; addedcsrc/cuda/logprob/**,rl_engine/integrations/engines/rollout/vllm/qwen3_next*,rl_engine/integrations/common/qwen3_next*andrl_engine/integrations/orchestrators/vime/experiments/qwen3_next/**(the paged-attention check reaches the vLLM rollout bridge, the VIME profile, the binary helpers and the logprob kernels) (d78b22b3). Workflow-only change; shared infrastructure such asrl_engine/opsandrl_engine/platformsstays out of the filter.73872d5cmakes the operator-gate script executable and corrects the comment above the KV-cache write. The fixes of the PRs below it are merged in; new headecafcc27. Kernel arithmetic is unchanged, so the measured results stand.test-qwennextafter [WS1][CUDA][Qwen3-Next] C1: zero-centred RMSNorm references and CUDA kernel (RFC #428 stack 2/4) #467 landed (c382dd4b), through [WS1][CUDA][Qwen3-Next] TP4 GDN, convolution and D=256 attention mixers on real weights (RFC #428 stack 6/11) #507's new headb36b8f6a, ind243839f. One conflict, in the provider workflow's pytest step: [WS1][CUDA][Qwen3-Next] C6: GDN decode-step goldens and recurrent/conv state contract (RFC #428 stack 4/4) #469's fail-closed skip check now also runs this PR's check modules.Tests
ci.yml(29 files)Qwen3-Next-provider-GPUlist)90c09164(the vLLM model contract is not in this list; it is covered by the EP PR's real-config tests)test_qwen3_next_training_checkpoint.py,test_qwen3_next_vllm_attention_metadata.py,check_qwen3_next_vime_weight_hooks.py)c67ec14)Scope
CUDA, TP4 × EP1, one node of four B200 (the four-GPU guards also accept four H100 or H200; see the H100 section). EP4 is #557; ROCm, other topologies and MTP are separate claims.
Results (H100 / Hopper, 4 GPUs, official checkpoint)
Run on validation commit
4460db96plus2a8f18e4. 4 × NVIDIA H100 80GB, torch 2.13.0+cu130, vLLM 0.30.0, NCCL 2.29.7, checkpoint revision9c7f2fbe. Raw data:hopper-qwen3-next/pr543.At the time of this run this PR still gated the four-GPU preflight on B200 (
topology_mismatch: requires exactly four B200 GPUs), so commit2a8f18e4(the Hopper allowance from #557) was applied locally on top of the PR head; nothing else differs. Sinceaf186dd2the allowance is part of this PR; the run at the new head is pending (see Status). Build flags:KERNEL_ALIGN_FORCE_SM90=1 KERNEL_ALIGN_DET_GEMM_SM90=1 TORCH_CUDA_ARCH_LIST=9.0. The patch is inhopper_preflight_2a8f18e4.patch. For full-modell2on 4 × H100, local validation commits load Megatron recompute without DDP / optimizer (no giant FP32 grad buffer). These commits are for Hopper evidence only and are not merged upstream; patches are underpr_assets.preflight(device, topology, operators, checkpoint identity)layers(layer and scheduler gates, TP4)l2(rollout vs native recompute, full matrix)full_model_l2: passed)See
chain/.