Skip to content

[rollout, vllm] fix: keep vLLM compile mode working under full_determinism - #8366

Open
flyingdoubleG wants to merge 1 commit into
verl-project:mainfrom
flyingdoubleG:fix-full-determinism-inductor-benchmark
Open

flyingdoubleG wants to merge 1 commit into
verl-project:mainfrom
flyingdoubleG:fix-full-determinism-inductor-benchmark

Conversation

@flyingdoubleG

Copy link
Copy Markdown

What does this PR do?

actor_rollout_ref.rollout.full_determinism=true does not work with the default vLLM compile mode on the pinned stack (vllm 0.29.0, torch 2.13). The vLLM engine fails during startup:

torch._inductor.exc.InductorError: RuntimeError: In the deterministic mode of Inductor, we will avoid those
benchmarkings that would cause non-deterministic results. ...
  scheduler.py create_combo_kernel_nodes -> speedup_by_combo_kernel -> benchmark_fused_nodes -> may_ban_benchmarking
RuntimeError: Engine core initialization failed.

Cause:

  1. enable_full_determinism() runs in the vLLM server and calls torch.use_deterministic_algorithms(True). That call also sets torch._inductor.config.deterministic = True.
  2. In this mode Inductor refuses to benchmark kernels.
  3. vLLM before v0.32 sets inductor_compile_config["benchmark_combo_kernel"] = True unconditionally on torch >= 2.9, so torch.compile of the model aborts.

vLLM fixed this upstream in vllm-project/vllm#59074, which turns off combo-kernel benchmarking in deterministic mode. That fix first ships in v0.32.0, so 0.29 (pinned) and 0.30 (#8072) are both affected. The determinism tests in this repo all set enforce_eager=true, so CI does not exercise the compile path. The setup in docs/advance/determinism.md does not mention enforce_eager, so users following it hit the crash.

Fix: when full_determinism is on, the vLLM server sets combo_kernels=True, benchmark_combo_kernel=False in compilation_config.inductor_compile_config, the same values vLLM >= 0.32 chooses itself. If the user already set either key through engine_kwargs.vllm.compilation_config, it is left alone. Nothing changes when full_determinism is off.

Not a duplicate: I searched issues and PRs for full_determinism, deterministic mode of Inductor and benchmark_combo_kernel. The open ones (#7667, #8026) cover routing and actor-side batch invariance, not this startup failure.

Checklist Before Starting

Test

CPU tests: tests/workers/rollout/test_vllm_cli_args_on_cpu.py gains TestApplyDeterministicInductorDefaults, which covers the defaults, preserving other inductor options, and user settings winning.

pytest -q tests/workers/rollout/test_vllm_cli_args_on_cpu.py
# 38 passed

GPU runs: 1x RTX 4090, main @ 3c6d9b4, vllm 0.29.0, torch 2.13. Qwen3-0.6B, GSM8K GRPO, batch 32 × n=4, 2 steps, following the setup in docs/advance/determinism.md: rollout.full_determinism=true, trainer.use_v1=false, and actor/ref fsdp_config.full_determinism=true. Each config ran twice; the values below are step 1 / step 2.

config starts critic/score/mean response_length/mean rollout_probs_diff_mean run 1 vs run 2
main, compile mode no (InductorError above) – – – –
main, enforce_eager=true yes 0.0625 / 0.21875 492.3125 / 463.0625 0.005955675151 / 0.006048386917 identical
this PR, compile mode yes 0.03125 / 0.21875 500.53125 / 471.4375 0.005736875348 / 0.005824934691 identical

The V1 trainer fails the same way. Its separate reproducibility limitations are already documented.

Design & Code Changes

  • verl/workers/rollout/vllm_rollout/utils.py: new apply_deterministic_inductor_defaults(compilation_config).
  • verl/workers/rollout/vllm_rollout/vllm_async_server.py: call it while building compilation_config when config.full_determinism is set.

Once verl moves to vLLM >= 0.32, the helper is a no-op in effect, since vLLM picks the same values, and it can be removed.

Checklist Before Submitting

AI assistance: This PR was prepared with AI assistance (Claude), which helped find the failure during GPU config sweeps, trace it to vLLM's combo-kernel defaults, write the fix and tests, and run the commands above.

…inism

full_determinism calls torch.use_deterministic_algorithms(True), which also
puts Inductor in deterministic mode. vLLM < 0.32 enables combo-kernel
benchmarking on torch >= 2.9, which Inductor then refuses, so the vLLM
engine fails to start unless enforce_eager=True. Disable combo-kernel
benchmarking (keeping combo kernels) when full_determinism is on, matching
vllm-project/vllm#59074; user-provided combo kernel settings are kept.

Co-authored-by: Claude
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 67b1a1bd-00d5-426c-90fb-05d8554b2b27
Commits

Reviewing files that changed from the base of the PR and between 3c6d9b4 and e1ac734.

Files selected for processing: 3
  • tests/workers/rollout/test_vllm_cli_args_on_cpu.py
  • verl/workers/rollout/vllm_rollout/utils.py
  • verl/workers/rollout/vllm_rollout/vllm_async_server.py

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

📝 Summary

Summary by CodeRabbit

  • New Features
    • Enabling full determinism now applies default Inductor compilation settings: combo kernels are enabled and combo-kernel benchmarking is disabled when neither option is specified.
    • Existing compilation settings are preserved, including user-provided values for either option.

When full_determinism is enabled, vLLM server setup applies defaults for combo_kernels and benchmark_combo_kernel. The helper leaves both options unchanged if either is already set. Tests cover these cases and preservation of other Inductor compile options.

Changes: Deterministic Inductor Defaults

Layer / File(s) Summary
Apply and verify deterministic defaults
verl/workers/rollout/vllm_rollout/utils.py, verl/workers/rollout/vllm_rollout/vllm_async_server.py, tests/workers/rollout/test_vllm_cli_args_on_cpu.py
Adds a helper that sets both defaults only when neither option is present. Server setup calls the helper when full_determinism is enabled. Tests check default values, preservation of other options, and user-provided settings.

Priority: Normal

Merge Risk: Minimal · up to e1ac7

The change addresses the reported vLLM compile-mode startup failure without an established new regression. It is mergeable after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the rollout and vLLM scope and states the primary fix: preserving vLLM compile-mode operation under full determinism.
Description check Passed The description directly explains the failure, cause, fix, user-configuration behavior, tests, and reported validation results.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant