Skip to content

[rl] Install vLLM 0.33.0 on the torch nightly - #5967

Open
felipemello1 wants to merge 28 commits into
felipemello1/inference-graph-sizes/3-vllm-main-compatfrom
felipemello1/rl/vllm-033-override
Open

felipemello1 wants to merge 28 commits into
felipemello1/inference-graph-sizes/3-vllm-main-compatfrom
felipemello1/rl/vllm-033-override

Conversation

@felipemello1

@felipemello1 felipemello1 commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary (human-written)

by @wwwjn

  • vllm 0.33.0 moved to stable ABI so we can pin vllm == 0.33.0 and bump occasionally

Agent details

Written with Claude Code.

TLDR: RL installs the vLLM 0.33.0 release from PyPI on top of the torch nightly, instead of PyTorch's nightly vLLM wheel. vLLM now changes only when a PR bumps vllm_version. It also carries #6389 (KV offload on vLLM 0.33, cherry-picked as 6458f37 with its author kept), which has to land with it.

Before, install_rl_env.sh pins PyTorch's 2026-11-07 nightly vLLM wheel. Newer wheels have no V1 runner, torch is tied to that date, and the pin stops installing around 2027-01. This PR installs vLLM 0.33.0 over the newest torch nightly, and vLLM moves only in a PR that edits install_rl_env.sh, which runs RL CI.

main:     torch + torchvision + vllm==1.0.0.dev20261107   -> PyTorch's 2026-11-07 nightly vLLM wheel (vLLM 9f03b510c); torch tied to that date
this PR:  torch + torchvision, newest nightly
          vllm==0.33.0 --override <installed torch, torchvision>

Stacked on the vLLM 0.33 API fixes PR below it, which makes the generator run on vLLM 0.33; this PR changes how vLLM is installed. It replaces main's pin of the 2026-11-07 nightly vLLM wheel.

Problem

  1. RL installs PyTorch's nightly vLLM wheel of 2026-11-07 (vLLM 9f03b510c). Newer nightly wheels come from a vLLM main without the V1 model runner, which our generator subclasses.
  2. That wheel's metadata pins torch to the same date, so RL CI can't test a newer torch nightly than 2026-11-07.
  3. The nightly index keeps only the newest ~60 days of wheels, so the pin stops installing around 2027-01.
  4. Main's KV offload code (KVOffloadScheduler, VLLMSessionKVHolder) reads Scheduler.skipped_waiting, which vLLM 0.33 replaced with kv_holding_waiting, so on 0.33 it raises AttributeError. [RL] KV offload on vLLM 0.33: drop the Mooncake no-forward save workaround #6389 ports it to 0.33 but fails on the pinned nightly, so main reverted it (Revert "[RL] KV offload on vLLM 0.33: drop the Mooncake no-forward save workaround" (#6389) #6428).

Solution

  1. Install the newest torch and torchvision nightlies, no longer tied to the vLLM wheel's date. --cuda must now be a CUDA 13 tag: the vLLM wheel links libcudart.so.13.
  2. Install vllm==0.33.0 with uv pip install --override. The override file holds the installed torch and torchvision, so uv keeps them over vLLM's torch==2.14.0 pin. The same file removes torchaudio and torchcodec, which vLLM uses only for audio and video inputs. vLLM's other dependencies resolve as usual.
  3. The release validation lane installs the same vLLM with the release candidate's torch, through the same override.
  4. The labeler adds ciflow/rl to PRs that touch the install script, and ciflow/b200 once they are out of draft, so a vLLM bump runs RL CI. Those tags run the RL unit and parity tests, the A10G loss guard and the A10G RL suite. The 3-step GRPO suites on H100 and B200 run daily on main or by manual dispatch.
  5. MLA's decode builder takes vLLM 0.33's new max_query_len argument and keeps the decode rows' own longest query. Without it, every MLA model (DeepSeek V3, Kimi K3) outside batch-invariant mode raises TypeError when it builds decode metadata.
  6. The MXFP8 Dist-MoE generator test clears DTensor's sharding caches before it builds its engine, as the parity test already does. In CI it runs in the same process after the Kimi K3 parity test, and vLLM 0.33's shutdown destroys that test's process groups. Without the clear, a generator param took a mesh whose group no longer exists ("Could not resolve the process group registered under the name 30").
  7. Docs that named the nightly vLLM wheel or its torch date now describe the release install: torchtitan/rl/README.md, generator/sglang/README.md, MODEL_STATE_DICT_TRANSPORT.md and a TODO in _env.py.
  8. KV offload on vLLM 0.33, from [RL] KV offload on vLLM 0.33: drop the Mooncake no-forward save workaround #6389 (cherry-picked as 6458f37, author kept):
  9. The varlen lse guard's TODO (models/common/attention/attention.py) and the GPT-OSS B200 TODO (tests/integration_tests/rl.py) no longer cite RL's torch pin. The guard stays: torch 2.15, which the release validation installs, lacks [sdpa] Add grad_logsumexp input to _flash_attention_backward pytorch#206398. install_rl_env.sh notes how to pin torch if a nightly breaks vLLM.
  10. Unchanged: the torch nightly, torchstore and batch_invariant_ops from git, Flash Attention.

Results

vLLM 0.33.0 wheel: 13 .so files, 0 unstable libtorch symbols (nm -D --undefined-only), 10 use 37-69 stable aoti_torch_* symbols

GB300 (aarch64), fresh venv from scripts/install_rl_env.sh, at f02b9f193 (before the MLA fix):
  installed                              torch 2.16.0.dev20261108+cu132, torchvision 0.30.0.dev20261108, vllm 0.33.0,
                                         flashinfer 0.7.2.post1 (was 0.6.18.post1); no torchaudio, torchcodec, xformers
  tests/rl/unit_tests/cpu                620 passed, 2 skipped (Verifiers installed; dist_moe not; one TODO skip)
  tests/rl/unit_tests/gpu (1 GPU)        27 passed, 1 skipped (dist_moe)
  Kimi K3 bitwise parity (B200's test)   4 passed

MLA fix: at f02b9f193, CI's H100 and B200 RL jobs failed rl_grpo_deepseek_v3_debug with
  TypeError: TorchTitanMLAMetadataBuilder._build_decode() got an unexpected keyword argument 'max_query_len'

CI at d479e4fd1 (with the MLA fix):
  A10G RL integration, incl. the RL loss guard      passed (golden unchanged)
  H100 RL (rl-kimi-k3), incl. rl_grpo_deepseek_v3_debug   passed
  B200 RL integration (DeepSeek V3, Kimi K3, Dist-MoE DP2 TP2 EP4)   passed
  B200 RL unit tests                                 MXFP8 Dist-MoE test failed: stale mesh (Solution 6)

GB300, vLLM 0.33.0, one torchrun process each:
  Kimi K3 parity, then the MXFP8 test        before the fix: MXFP8 failed (same error as CI), 4 passed; after: 5 passed
  the B200 job's full unit-test command      after the fix: 8 passed

At 54423f0 (x86_64 devserver, vLLM 0.33.0, torch 2.17.0.dev20261201): tests/rl/unit_tests/cpu 774 passed, 8 skipped. #6389's own runs (GRPO step time unchanged, generator ITL within noise) are in its description.

You may ask:

  • Why --override, not --no-deps? --no-deps skips all of vLLM's dependencies (flashinfer, transformers, cutlass-dsl, ...), which we would then track by hand. --override resolves them and replaces only vLLM's torch and torchvision pins.
  • Why a release, not PyTorch's nightly vLLM? That wheel sat on one vLLM commit for 8 weeks, then would jump past the V1 runner removal at once. A release changes only when we bump it, about every 2 weeks.
  • What if a torch nightly breaks vLLM 0.33's Python code? The stable ABI only shows the compiled kernels load. The generator runs vLLM with CompilationMode.NONE, which skips most of vLLM's torch._inductor code. If a nightly breaks it anyway, pin torch to the last good date in install_rl_env.sh until a vLLM release has the fix.
  • Why is the MLA fix here? vLLM 0.33 passes max_query_len; the current pin doesn't. So the fix lands with the version change.
  • Why drop xformers? vLLM 0.33 removed its xformers backend, and TorchTitan never imported it.

NOTE:

  • The V2 runner port, at the top of this stack, sets vllm_version to 0.34.0, the first release without the V1 runner (on PyPI since 2026-11-16). The two can't land apart.
  • Not run locally: H100, the 8-GPU suites, the A10G loss guard and the release lane.
  • .ci/docker/README.md still describes the old install. It is not edited here because any edit under .ci/docker changes the CI image hash.
  • On this devserver, vLLM imports need LD_PRELOAD=<venv>/lib/python3.12/site-packages/nvidia/cu13/lib/libcublas.so.13; CI does not.

Follow up / TODO

  • Update .ci/docker/README.md's RL install lines in the next PR that rebuilds the CI image.

Test plan

uv venv /tmp/v033 --python 3.12 && source /tmp/v033/bin/activate && scripts/install_rl_env.sh
export PYTHONPATH=$PWD LD_PRELOAD=/tmp/v033/lib/python3.12/site-packages/nvidia/cu13/lib/libcublas.so.13
CUDA_VISIBLE_DEVICES= pytest tests/rl/unit_tests/cpu      # again after the Verifiers install, as CI does
pytest tests/rl/unit_tests/gpu -m "not multi_gpu"
torchrun --nproc-per-node=1 -m pytest tests/rl/unit_tests/gpu/test_bitwise_parity.py::TestBitwiseParityKimiK3DebugVarlen

ciflow/rl and ciflow/b200 on this PR.

At 886ef55 (main a75b09a merged in through the PR below), tests/rl/unit_tests/cpu on vLLM 0.33.0: 706 passed, 8 skipped. Earlier runs:

Runs at d1fa0f5 (main b1c259c merged in through the PR below), GB300, 2026-11-20. The install row ran at f9fbd42; install_rl_env.sh is unchanged since:

check                                                    result
tests/rl/unit_tests/cpu, vLLM 0.33.0                     682 passed, 8 skipped
scripts/install_rl_env.sh, fresh venv, vllm_version set  installed torch 2.16.0.dev20261119, vLLM 0.34.0; the wheel check passes
  to 0.34.0 (the stack's top PR)                         (and exits 1 with its message on a wrong --cuda tag)

@pytorch-bot pytorch-bot Bot added the ciflow/rl label Nov 9, 2026
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 9, 2026
@felipemello1
felipemello1 added this pull request to stack #5968 November 9, 2026 03:04
@felipemello1

Copy link
Copy Markdown
Contributor Author

Reply from claude: @claude please review

@claude

claude Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @felipemello1's task in 2m 56s —— View job


Approve -- please address the items below before merging (human-written summary is missing, and the RL loss guard result is still pending): see the review on this PR.

@felipemello1
felipemello1 force-pushed the felipemello1/rl/vllm-033-override branch from f02b9f1 to 1588c12 Compare November 9, 2026 03:07

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verdict: Approve -- please address the items below before merging. The problem is real: PyTorch's nightly vLLM wheel follows vLLM main, which deleted the V1 runner we subclass. Pinning a release with --override is the smallest fix that keeps vLLM's other dependencies resolved. A maintainer still needs to review, since this changes the RL install path and the release lane.

What this PR does. install_rl_env.sh installs torch and torchvision from the nightly index on their own. It then installs vllm==0.33.0 from PyPI with a uv override file, which swaps vLLM's torch==2.14.0 / torchvision pins for the versions already installed and drops torchaudio and torchcodec. The release lane uses the same override with the RC torch. The kv_cache_spec is None fallback for the old nightly is deleted, and the labeler now runs RL and B200 CI when the install script changes.

Example.

before: uv pip install torch torchvision vllm (+xformers) --pre  (nightly index)
        -> vllm 1.0.0.devYYYYMMDD+cu132, built from whatever vLLM main commit PyTorch's CI pins
after:  uv pip install --upgrade torch torchvision --pre          (nightly index)
        uv pip install vllm==0.33.0 --override {torch==<installed>, torchvision==<installed>,
                                                torchaudio/torchcodec: never}
        -> vllm 0.33.0; the post-install assert still fails if torch/torchvision stop being +cu13x nightlies

Must fix

  1. PR description -- "Summary (human-written)" is empty. The author needs to fill it in (agents don't).
  2. RL loss guard -- the description says the A10G golden (tests/assets/losses/rl_grpo_cuda.txt) may move because FlashInfer goes from 0.6.18 to 0.7.2. RL CI hasn't reported on this PR yet. If the golden moves, regenerate it in this PR and explain the change. Don't land it with a failing or loosened guard.

Should consider

  • scripts/install_rl_env.sh:35 -- the vLLM pin lives in three places, kept in sync only by a comment. Details inline.
  • .github/labeler.yml:23 -- ciflow/b200 also runs two B200 suites that don't use this script. Details inline.
  • Stale nightly wording outside the diff: the torchtitan/rl/generator/vllm/worker.py:28 docstring still says "vLLM at 9f03b51". This PR already removed the matching reference in attention.py. Update it to vLLM 0.33 if the described FULL-graph keying still holds there. Also, unit_test_cpu_rl.yaml:74-79 ("Keep the nightlies installed above", nightly-constraints.txt) now pins a vLLM release, not a nightly.

Not verified: that the PyPI vLLM 0.33.0 wheel pulls no Triton that would sit alongside the nightly's pytorch-triton (the GB300 install list in the description suggests it doesn't), and the x86_64/H100/8-GPU/release lanes, which the description also lists as not run.

Comment thread scripts/install_rl_env.sh
Comment on lines +34 to +35
# Also set VLLM_VERSION in .github/workflows/validate_release_gpu.yml (2 places).
vllm_version="0.33.0"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The vLLM pin now lives in three places (here, plus VLLM_VERSION twice in validate_release_gpu.yml), kept in sync only by this comment. If a bump misses the workflow, the release lane tests a different vLLM than RL CI and nothing fails until release time.

You could keep one source: have .github/scripts/validate_release_gpu.sh read the version from this script (it already resolves REPO_ROOT, and the B200 archive checkout includes scripts/):

VLLM_VERSION="$(sed -n 's/^vllm_version="\(.*\)"$/\1/p' "${REPO_ROOT}/scripts/install_rl_env.sh")"

Then drop the two VLLM_VERSION entries from the workflow and this comment. That's about +2/-4 lines. Optional: keep the env var if the release lane is meant to be able to pin a different vLLM.

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.

Reply from claude: Keeping the workflow's VLLM_VERSION for now. The release workflow pins the whole release stack in one place: TORCH_VERSION and TORCHVISION_VERSION sit next to it, and validate_release_gpu.sh asks for "an exact version compatible with the release torch". The release torch can need a different vLLM than the nightly does. Reading the version from this script would also be a release-lane change that no PR CI runs. If the two should always match, a follow-up can make this script the one source.

Comment thread .github/labeler.yml
- .github/workflows/*b200*.yaml
- tests/integration_tests/b200.py
- torchtitan_recipes/tests/**/b200.py
- scripts/install_rl_env.sh

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ciflow/b200 triggers three 8xB200 workflows: integration_test_b200.yaml, integration_test_b200_graph_trainer.yaml and integration_test_rl_b200.yaml. Only the RL one runs install_rl_env.sh. So every edit to this script will also run the core and graph_trainer B200 suites, which can't be affected by it. That may be an acceptable cost for a change every ~2 weeks, but it's worth a deliberate call. The alternative is to apply ciflow/b200 by hand on vLLM bumps.

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.

Reply from claude: Keeping it on purpose. Only the B200 RL job runs the generator on SM100 (FA4 with 128-token pages, Kimi K3), and a vLLM bump is what changes that path. Bumps come about every 2 weeks, so the two other B200 suites run about twice a month. A label added by hand is easy to forget on exactly those PRs.

felipemello1 added a commit that referenced this pull request Nov 9, 2026
## Summary (human-written)
everything will break tomorrow after new wheels come out. This is just
to avoid that.

This stack is to fix the code base to work with latest vllm
#5967

## Agent details

Written with Claude Code.

**TLDR:** `scripts/install_rl_env.sh` installs
`vllm==1.0.0.dev20261107+cu132` instead of the newest nightly vLLM
wheel. RL CI keeps the vLLM it installs today when PyTorch moves its
vLLM pin.

```text
main:     torch, torchvision, vllm: newest nightly  -> vLLM = whatever commit PyTorch pins next
this PR:  vllm==1.0.0.dev20261107                   -> vLLM 9f03b510c (same as today), torch 2.16.0.dev20261107
```

**Problem**
1. PyTorch's nightly vLLM wheel is built from the vLLM commit in
PyTorch's `.github/ci_commit_pins/vllm.txt`. That pin has been stuck on
vLLM `9f03b510c` (09-13) because the wheel build was failing. The build
is fixed now, so the pin will move.
2. vLLM main deleted the V1 model runner and
`vllm/v1/cudagraph_dispatcher.py` on 11-07.
3. `torchtitan/rl/generator/vllm/worker.py` imports both. All 5 RL
workflows run `install_rl_env.sh` with no vLLM pin. So the first nightly
after the pin moves fails every RL job at import, on main and on every
PR that runs RL CI.

**Solution**
1. Pin the 11-07 wheel. It holds vLLM `9f03b510c`, the same vLLM RL CI
installs today.
2. That wheel pins torch to its own date, so RL CI runs `torch
2.16.0.dev20261107` until the pin goes. Core CI keeps the newest
nightly.
3. The pin is temporary (TODO: 2026-11-22). The follow-up installs a
vLLM PyPI release on the newest torch nightly, once the generator runs
on vLLM 0.33.

You may ask: why not the 11-08 wheel? The index already replaced it once
(two uploads on 11-08, different contents). If 11-08 were rebuilt after
the pin moved, it would hold the new vLLM. The 11-07 wheel was built
before any pin move.

NOTE:
- If RL CI fails on a torch API newer than 11-07 before the follow-up
lands, land the follow-up first.
- `--cuda` now works only with `cu132`, the only index with the pinned
wheel. No CI job passes `--cuda`.

**Test plan**
- Fresh venv on GB300 (aarch64): `scripts/install_rl_env.sh --flash-attn
none` installs torch `2.16.0.dev20261107+cu132`, torchvision
`0.30.0.dev20261108+cu132` and vllm `1.0.0.dev20261107+cu132`
(`vllm.__version__` = `0.1.dev1+g9f03b510c.d20261107`). The script's
`.dev` / `+cu132` check passes.
- Same venv, GPUs hidden as on the CPU CI runner: `CUDA_VISIBLE_DEVICES=
pytest tests/rl/unit_tests/cpu` -> 566 passed, 8 skipped (verifiers and
dist_moe not installed).
- `ciflow/rl` on this PR.

Co-authored-by: Felipe Mello <[email protected]>
@felipemello1
felipemello1 removed this pull request from stack #5968 November 9, 2026 03:49
@felipemello1
felipemello1 added this pull request to stack #5973 November 9, 2026 03:50
@felipemello1 felipemello1 added the ciflow/b200 Trigger B200 CI label Nov 9, 2026
@felipemello1

Copy link
Copy Markdown
Contributor Author

Reply from claude: @claude please review. New since your last review: the MLA decode builder takes vLLM 0.33's max_query_len (CI's H100 and B200 RL jobs failed rl_grpo_deepseek_v3_debug without it), and the stale-nightly wording you flagged. Replies are on the two inline threads.

@claude

claude Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @felipemello1's task in 52s —— View job


Approve -- please address the items below before merging. Two items are still open: the human-written summary is empty, and the RL CI and loss guard haven't reported on this head yet. See the review on this PR.

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verdict: Approve -- please address the items below before merging. The two new commits are correct and small. The two blockers from the last review are still open, and both are non-code items. A maintainer still needs to review, since this changes the RL install path and the release lane.

What changed since the last review.

  • mla.py:105-111: TorchTitanMLAMetadataBuilder._build_decode now accepts vLLM 0.33's max_query_len keyword and discards it. The decode rows' longest query is still computed from query_start_loc_cpu. That tensor is on the CPU, so .item() is not a device sync. For plain decode the value is 1, so paged_mla_decode keeps max_seqlen_q=1. vLLM's value would only be looser.
  • worker.py:28 now says "vLLM 0.33", and unit_test_cpu_rl.yaml says rl-constraints.txt / "Keep torch, torchvision and vLLM as installed above". That resolves the stale-wording item. No remaining references to 9f03b51, nightly-constraints or the kv_cache_spec is None fallback turned up in the repo.

Example (MLA fix).

vLLM 0.33 calls  builder._build_decode(..., num_decode_tokens=4, max_query_len=4, dcp_tot_seq_lens_device=None)
before: TypeError: unexpected keyword argument 'max_query_len'  -> every non-batch-invariant MLA model (DeepSeek V3, Kimi K3)
after:  argument ignored; 4 one-token decodes -> TorchTitanMLADecodeMetadata(max_query_len=1)

Earlier threads. I accept both replies:

  • Keeping VLLM_VERSION in the release workflow is a reasonable call. The release torch can need a different vLLM, and the release lane's pins already sit together.
  • ciflow/b200 on install-script edits is a deliberate cost, and the reply justifies it with the SM100-only generator path.

Must fix (still open)

  1. PR description: "Summary (human-written)" is still empty. The author needs to fill it in; agents don't.
  2. RL loss guard: the H100, B200 and A10G RL jobs on this head are still queued. They are the check for the MLA fix, and they also show whether the FlashInfer 0.6.18 -> 0.7.2 move shifts tests/assets/losses/rl_grpo_cuda.txt. If the golden moves, regenerate it in this PR and explain why. Don't loosen the tolerance.

Not verified: the comment at mla.py:108, which says vLLM 0.33 passes min(longest query, reorder_batch_threshold). vLLM 0.33 isn't installed in this runner, so I couldn't check it against vLLM's source. The fix doesn't depend on that value, since it is discarded.

@felipemello1

Copy link
Copy Markdown
Contributor Author

Reply from claude: @claude please review. Your must-fix 2: the A10G RL job (loss guard included) passed at d479e4f, so the golden did not move. The H100 and B200 RL integration jobs passed too, which checks the MLA fix. The B200 unit tests failed in the MXFP8 Dist-MoE test on a stale DTensor mesh, which this PR's vLLM bump exposed. New commit 2e739e7 fixes it (details in the description, Solution 6).

@claude

claude Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @felipemello1's task in 1m 4s —— View job


Approve -- please address the items below before merging. The loss guard is resolved. Still open: the human-written summary, and the queued B200 run at 2e739e7 that checks the MXFP8 fix. See the review on this PR.

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verdict: Approve -- please address the items below before merging. The loss-guard blocker is resolved, and the new commit is a small test-only fix. Two things are still open: the human-written summary, and the B200 unit-test run that checks the fix. A maintainer still needs to review, since this changes the RL install path and the release lane.

Earlier must-fix items.

  1. Human-written summary: still open. The section is still empty. The author has to fill it in; agents don't.
  2. RL loss guard: resolved. The A10G RL job, loss guard included, passed at d479e4f with the golden unchanged. The H100 and B200 RL integration jobs passed there too, so the MLA max_query_len fix is covered. 2e739e7 only touches tests, so those results still hold at HEAD.

What 2e739e7 does. It moves the parity test's DTensor sharding-cache clear into _clear_dtensor_sharding_caches (test_bitwise_parity.py:195). The MXFP8 Dist-MoE test now calls it right before build_inference_engine (test_generator_dist_moe_mxfp8.py:271). The code being cleared is unchanged, and the existing TODO moved with it. The MXFP8 file has only that one test that builds an engine, so no other test there needs the clear.

Example.

B200 job: torchrun --nproc-per-node=1 -m pytest  test_bitwise_parity.py::TestBitwiseParityKimiK3DebugVarlen  test_generator_dist_moe_mxfp8.py ...
  Kimi K3 parity test builds meshes -> DTensor caches hold them -> vLLM 0.33 shutdown destroys their process groups
before: MXFP8 test's generator param resolves an equal cached mesh
        -> "Could not resolve the process group registered under the name 30"
after:  caches cleared before build_inference_engine -> the generator uses its own mesh

Must fix (still open)

  1. PR description: "Summary (human-written)" is empty.
  2. CI on 2e739e7: the RL B200 run, whose unit-test step contains the failing MXFP8 test, is still queued, along with the other RL jobs. Merge once it passes. The GB300 run in the description (8 passed with the B200 job's full command) is good evidence, but it isn't that job.

Not verified: that vLLM 0.33's shutdown is what destroys the earlier test's process groups. I'm relying on the description's GB300 before/after run for that; vLLM 0.33 isn't installed here.

Felipe Mello added 4 commits November 9, 2026 12:21
RL installed PyTorch's nightly vLLM wheel, which follows whatever vLLM main
commit PyTorch pins. Install the vLLM 0.33.0 release on top of the torch
nightly instead, with a uv override that keeps the nightly torch and
torchvision over vLLM's torch pins. The release validation lane installs the
same vLLM with the release candidate's torch.
vLLM 0.33 calls MLACommonMetadataBuilder._build_decode with a new keyword,
max_query_len. TorchTitan's override didn't take it, so every MLA model
(DeepSeek V3, Kimi K3) outside batch-invariant mode raised TypeError when it
built decode metadata: at CUDA-graph capture, or at the first decode step in
eager mode. Take it and keep the decode rows' own longest query, which picks
the 1-token decode kernel.
CI's B200 job runs the MXFP8 Dist-MoE generator test in the same process after
the Kimi K3 parity test. DTensor's sharding-propagation caches still held that
test's meshes, and vLLM 0.33's shutdown destroys their process groups, so a
generator param took a mesh whose group no longer exists:
"Could not resolve the process group registered under the name 30".
Move the parity test's cache clear into _clear_dtensor_sharding_caches and call
it in both tests.
@felipemello1
felipemello1 force-pushed the felipemello1/rl/vllm-033-override branch from 2e739e7 to 685502b Compare November 9, 2026 20:45
@felipemello1

Copy link
Copy Markdown
Contributor Author

Reply from claude: @claude please review. The stack is rebased onto main 2805bd6: it picks up the GDN batch-invariant scan fix (it fixes CI's flaky Qwen3.5 parity test) and resolves conflicts with main's move of the model build out of vllm/. No logic changed: 10 of the stack's 15 commits are identical, and the other 5 differ only around main's moved code. The body now says this PR replaces main's 2026-11-07 nightly vLLM pin, which landed meanwhile.

@claude

claude Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @felipemello1's task in 1m 9s —— View job


Approve -- please address the items below before merging. The rebase doesn't change the diff. Two items are still open: the human-written summary, and RL CI on 685502b. See the review on this PR.

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verdict: Approve -- please address the items below before merging. The rebase onto main 2805bd6 leaves this PR's diff the same as at the last review. Two items are still open: the human-written summary, and RL CI on the rebased head. A maintainer still needs to review, since this changes the RL install path and the release lane.

What changed since the last review. Only the base moved. I re-read the full diff at 685502b. The four commits make the same changes as before: the install script, the release-lane override, the labeler entries, the MLA max_query_len argument, the docstring and CPU-job wording, and the _clear_dtensor_sharding_caches helper. The one difference is the removed pin, which is now main's vllm==1.0.0.dev20261107 (vLLM 9f03b510c) instead of the older nightly, and the description says so. The release lane still removes the 1.0.0.dev20261005 wheel special case, as before. After main's move of the model build out of vllm/, nothing in the repo still references 9f03b51, 1.0.0.dev2026*, nightly-constraints or xformers. _build_decode and both get_supported_kernel_block_sizes overrides have no other callers or subclasses in the tree.

Example.

main (after 2805bd634):  torch + torchvision + vllm==1.0.0.dev20261107+cu132 (+xformers on x86_64), one nightly resolve
this PR:                 torch + torchvision --pre (newest nightly)
                         vllm==0.33.0 --override {installed torch, torchvision; torchaudio/torchcodec: never}

Must fix (still open)

  1. PR description: "Summary (human-written)" is still the empty template. The author has to fill it in; agents don't.
  2. CI on 685502b: the earlier passing RL results (A10G loss guard, H100, B200 integration at d479e4f) predate the rebase. The rebase pulled in main's model-build move and the GDN scan fix, so they no longer cover HEAD. All RL jobs (CPU, GPU unit, A10G, H100, B200) are queued or running. B200 is also the first run of the MXFP8 cache-clear fix. Merge once they pass, with tests/assets/losses/rl_grpo_cuda.txt unchanged.

Not verified: anything that needs vLLM 0.33 or a GPU. vLLM 0.33 isn't installed in this runner.

…Install vLLM 0.33.0 on the torch nightly

Conflicts:
- scripts/install_rl_env.sh: main's --sglang usage lines, next to this PR's
  --constraint text.
- tests/rl/unit_tests/gpu/test_generator_dist_moe_mxfp8.py: main renamed
  _make_prompt_tokens to make_prompt_tokens; this PR's
  _clear_dtensor_sharding_caches import stays.
wwwjn and others added 2 commits December 1, 2026 11:14
Conflict: install_rl_env.sh keeps this PR's vLLM release install; main's note about the 2026-11-07 torch (GPT-OSS varlen lse) no longer applies once RL installs the newest torch nightly.
…round (#6389)

<!-- Write this yourself, not with an AI tool. 2-5 sentences: the
problem, why
     this approach, and what you checked yourself. -->
upgrade vlllm to 0.33.0 (the last v1 stable version) and address this
issue vllm-project/vllm#69805

vLLM 0.33.0 fixes
[vllm-project/vllm#69805](vllm-project/vllm#69805):
`kv_connector_no_forward` now calls `wait_for_save`, so Mooncake submits
finish-time saves scheduled on a step without a forward. On the pinned
nightly (`9f03b510c`) it passes `wait_for_save=False`, which is why
`worker.py` overrides it. This PR moves the KV offload code to vLLM 0.33
and drops that override.

**Depends on #5498 and #5967** (felipemello1), which move the generator
to vLLM 0.33.0; land this after them. Until then this PR's CI runs on
the pinned nightly, where these changes fail.

- `kv_offload_scheduler.py`, `session_kv_holder.py`: vLLM 0.33 replaced
`skipped_waiting` with `kv_holding_waiting`, which it always drains
before `waiting`. Rename the queue, and delete the
`_select_waiting_queue_for_scheduling` override: there is no longer a
choice between two queue heads to tie-break.
- `worker.py`: delete the `kv_connector_no_forward` override and its
TODO; delete its unit test in `test_mooncake_coordination.py`.
- Tests (mechanical): fill in the `Scheduler` state 0.33 reads
(`_kv_fetch_stages`, `deferred_loads`, ...) in the hand-built test
schedulers. In `test_kv_offload.py`, on 0.33 the first request's tail no
longer saves on an idle step, so the check that a finish-time save
without forward ran now covers the whole test instead of the first
request.

main vs this PR on top of #5967. Stock Qwen3-0.6B AlphabetSort GRPO
recipe (TP4 generator + 2-GPU trainer, B200), 12 steps, mean of steps
3-12, 3 runs each:

| | main (vLLM nightly 11-07, torch 11-07) | this PR (vLLM 0.33.0, torch
11-24) | change |
|---|---|---|---|
| generator inter-token latency (ms) | 4.64 | 4.80 | +3% |
| generator decode time per request (ms) | 143.6 | 149.5 | +4% |
| step wall time (s) | 2.64 | 2.64 | 0% |
| trainer tokens/s (full step) | 2110 | 2165 | +3% |

Per-run inter-token latency: main 4.53 / 4.68 / 4.70, PR 4.96 / 4.85 /
4.58; the runs overlap, so the generator difference is within noise and
step time is unchanged. These measure the vLLM/torch upgrade (#5967) as
much as this PR.

With #5498 and #5967 applied, on vLLM 0.33.0 + torch 2.16.0.dev20261124:
- `tests/rl/unit_tests/cpu`: 738 passed except
`test_vllm_multimodal_wrapper.py::test_controller_requires_a_vision_processor_exactly_for_multimodal_models`
(needs `math_verify`, not installed locally); `test_dapo_math.py` /
`test_geometry3k.py` not collected for the same reason.
- `tests/rl/unit_tests/gpu/test_kv_offload.py`: 3 passed (the 8-GPU
`dp2` case not run).
- `generate.py` with vLLM, and with SimpleCPU offload: same text as
main.
- Mooncake Store end to end (2 generators x TP2,
`save_decode_cache=True`, 4 steps): one master on the controller host, 4
segments mounted, ~350 keys loaded per generator, 0 failed loads or
saves.

(cherry picked from commit 8ab41b4)
@wwwjn

wwwjn commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

I'm picking up this stack from Felipe to get it landed.

This PR now also carries #6389 (cherry-picked as 6458f37, Jessica's authorship kept), because the two have to land together. vLLM 0.33 replaced Scheduler.skipped_waiting with kv_holding_waiting, so main's KV offload code fails on 0.33 without #6389 (AttributeError), and #6389 fails on the pinned nightly (reverted in #6428).

Why it's urgent: RL CI is pinned to the 2026-11-07 vLLM nightly, which also pins torch to that date. That blocks #6389 and the work that builds on vLLM's V2 runner (#5956, then #6387). The nightly index drops that wheel around 2027-01-06, and after that RL CI can't install it.

Land in order: #5498 -> #5967 -> #5971 -> #5972 -> #5956.

RL CPU unit tests at 6458f37 (vLLM 0.33.0, torch 2.17.0.dev20261201): 773 passed, 0 failed.

wwwjn added 6 commits December 1, 2026 11:50
… GPT-OSS B200 TODO; note the torch escape hatch

RL now installs the newest torch nightly, which includes pytorch/pytorch#206398. The varlen lse guard stays: torch 2.15, which the release validation installs, does not include it (release/2.15 diverged from the fix).
@wwwjn
wwwjn marked this pull request as ready for review December 1, 2026 22:02
@pytorch-bot pytorch-bot Bot added the ciflow/fake-pg Run 1-GPU Fake PG integration tests label Dec 1, 2026
@wwwjn

wwwjn commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

from claude: @claude review

@claude

claude Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @wwwjn's task in 2m 39s —— View job


Approve -- please address the items below before merging. The only open item is re-running rl-b200, which hit a Hugging Face 429 before its integration suite ran. See the review on this PR.

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verdict: Approve -- please address the items below before merging. The new commits are #6389, re-applied unchanged, and some TODO and comment updates. Only one item still blocks: the B200 RL job at 54423f0 failed on a Hugging Face rate limit and never got to the B200 integration suite. A maintainer still needs to review, since this changes the RL install path and the release lane.

What changed since the last full review (d1fa0f5).

  • 6458f37 (#6389, cherry-picked): skipped_waiting becomes kv_holding_waiting in KVOffloadScheduler and VLLMSessionKVHolder. It also deletes the _select_waiting_queue_for_scheduling and Mooncake kv_connector_no_forward overrides. Its diff matches 8ab41b4, the commit that landed on main and was later reverted (#6428). Only context lines differ, around round_up and the runner docstring, which moved in the PR below. No skipped_waiting or _select_waiting_queue_for_scheduling references remain. test_kv_offload.py:228 still patches TorchTitanGPUModelRunner.kv_connector_no_forward. That still works: the attribute is now inherited from GPUModelRunner, and patch.object restores it.
  • 54423f0: TODO and comment updates.
    • The varlen lse guard (attention.py:562) now cites the release lane's torch 2.15. That matches TORCH_VERSION="2.15.0" in validate_release_gpu.yml.
    • install_rl_env.sh:197-198 says how to pin torch with --constraint. The torch install reads that constraint, and the override then freezes the pinned torch.
    • The GPT-OSS B200 TODO (rl.py:131) now has a vague condition; see the inline comment.
  • The merges of #5498 don't touch this PR's files.

Example.

vLLM 0.33 scheduler: waiting requests that hold KV blocks go to `kv_holding_waiting`, drained before `waiting`
before (main on 0.33): KVOffloadScheduler sets self.skipped_waiting       -> AttributeError when vLLM uses kv_holding_waiting
after:                 KVOffloadScheduler sets self.kv_holding_waiting    -> one queue head at a time, so the cross-TP tie-break override goes

Earlier must-fix items

  1. Human-written summary: resolved (filled in by @wwwjn).
  2. RL CI on HEAD: still open, but only for B200. CPU, Lint, the 1-GPU and multi-GPU unit tests, A10G RL integration (with the loss guard) and H100 rl-kimi-k3 all passed at 54423f0. In rl-b200, the unit-test step passed (8 passed, MXFP8 fix included). The SGLang step then failed in snapshot_download('Qwen/Qwen3-0.6B') with HTTP 429 before any test ran, so the B200 RL integration step never ran. The last B200 integration pass (d479e4f) is older than #6389 and several merges. Re-run rl-b200 and merge once it passes.

Should consider

  • tests/integration_tests/rl.py:131 -- the TODO's blocker is gone, and "once it passes on B200" doesn't say whether the test was tried (inline).
Details
  • Overlap search: vllm 0.33 and install_rl_env found only this stack (#5498, #5971, #5972, #5956) and the MTP/GDN PRs that build on it. None replaces this PR.
  • The CI log for the B200 failure is in job 143035056314. The error is httpx.HTTPStatusError: Client error '429 Too Many Requests' for url 'https://huggingface.co/api/models/Qwen/Qwen3-0.6B/revision/main', then MODEL_PATH= and exit 1.

Not verified: that vLLM 0.33 always schedules kv_holding_waiting before waiting, which is why removing the tie-break override is safe. vLLM 0.33 isn't installed in this runner. This was already reviewed when #6389 landed on main.

Comment thread tests/integration_tests/rl.py Outdated
Comment on lines +131 to +134
# TODO: Add rl_grpo_moe_debug_tp4_ep4 (GPT-OSS MoE varlen TP=4 EP=4)
# here once RL's torch includes pytorch/pytorch#206398 (see
# scripts/install_rl_env.sh). GPT-OSS sinks backpropagate through the
# varlen lse, which needs that torch and FA4 (SM100).
# here once it passes on B200. GPT-OSS sinks backpropagate through the
# varlen lse, which needs FA4 (SM100) and pytorch/pytorch#206398; RL's
# torch nightly now includes the latter.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This PR removes this TODO's only stated blocker. Before, it waited for RL's torch to include pytorch/pytorch#206398. After this PR, RL's torch nightly has it, and the comment says so. The new condition, "once it passes on B200", doesn't say whether anyone has tried the test or what fails. So the next reader can't tell whether to enable it or what to wait for.

There are two ways to fix it:

  • If rl_grpo_moe_debug_tp4_ep4 hasn't been run on B200 with this torch, add it to this list. This is the coverage the TODO was waiting for, and ciflow/b200 is already on this PR.
  • If it was run and fails, name the failure (and its upstream issue, if any) in place of "once it passes".

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

from claude: It has not run on B200 yet. 578d3e2 rewords the TODO to say so: add rl_grpo_moe_debug_tp4_ep4 after a first B200 run. I kept it off the list so this install PR's B200 job is not that recipe's first run.

@wwwjn wwwjn changed the title [rl] Install vLLM 0.33.0 on the torch nightly [WIP] [rl] Install vLLM 0.33.0 on the torch nightly Dec 2, 2026
@wwwjn

wwwjn commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

from claude: @claude review

@claude

claude Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @wwwjn's task in 54s —— View job


Approve -- please address the items below before merging. The only open item is a passing rl-b200 run; the re-run at 578d3e2 is in progress. See the review on this PR.

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verdict: Approve -- please address the items below before merging. The one new commit is a comment fix. The only open item is still a passing rl-b200 run, which is now in progress at 578d3e2. A maintainer still needs to review, since this changes the RL install path and the release lane.

What changed since the last full review (54423f0).

  • 578d3e2 (tests/integration_tests/rl.py:131-134): the GPT-OSS B200 TODO now says rl_grpo_moe_debug_tp4_ep4 has not run on B200, and that it should be added after a first run there. Both of its stated needs, FA4 (installed by --flash-attn auto on SM100) and pytorch/pytorch#206398 (in the torch nightly), are now met. That resolves my should-consider. Keeping a recipe's first B200 run out of an install PR's CI is a reasonable call.
  • Merge e780041 brings in ae28a3a from #5498, which removes InferenceParallelismConfig.enable_sequence_parallel. It touches parallelism.py, both engines and test_generator.py. None of those are in this PR's diff, so I reviewed them on #5498, not here.

Example.

next reader of the B200 RL list asks "can I add GPT-OSS TP4 EP4?"
before: "once it passes on B200": no way to tell whether anyone has tried it
after:  "has not run there yet; its torch and FA4 needs are met": run it once on B200, then add it

Earlier must-fix items

  1. RL CI on HEAD: still open, rl-b200 only. At 54423f0 it failed on a Hugging Face 429 before the B200 integration suite ran. The re-run at 578d3e2 (run 46793811095) is in progress. RL CPU and Lint have passed at HEAD. RL GPU unit, A10G and H100 are queued, but they passed at 54423f0, and since then only a comment and files outside this PR have changed. Merge once rl-b200 passes.
Details
  • Overlap search: install_rl_env returns only this PR. The search on the last review (vllm 0.33) found only this stack (#5498, #5971, #5972, #5956).
  • git diff --stat 54423f0 e780041 touches 4 files: test_generator.py, generator/parallelism.py, sglang/engine.py and vllm/engine.py. None of them are in gh pr diff 5967 --name-only.

Not verified: anything that needs vLLM 0.33 or a GPU.

@wwwjn wwwjn changed the title [WIP] [rl] Install vLLM 0.33.0 on the torch nightly [rl] Install vLLM 0.33.0 on the torch nightly Dec 2, 2026

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

ciflow/b200 Trigger B200 CI ciflow/fake-pg Run 1-GPU Fake PG integration tests ciflow/rl CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants