[Bugfix][RL] Set vLLM config during weight reload - #45989
Merged
Isotr0py merged 1 commit intoJul 20, 2026
Conversation
aoshen02
added a commit
to vllm-project/vime
that referenced
this pull request
Jun 18, 2026
…l_utils weight-reload fix (#45989) v0.23.0 already includes the sleep/scheduler guard from #44483, so the core.py patch is no longer needed. Replace it with the FP8+DeepEP weight-reload fix (vllm-project/vllm#45989): snapshot max_num_batched_tokens from FusedMoEConfig instead of calling get_current_vllm_config() during layerwise reload. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Ao Shen <aoshen@inferact.ai>
aoshen02
force-pushed
the
fix/set-vllm-config-in-weight-update
branch
from
June 18, 2026 09:16
a9c0e56 to
c7fe756
Compare
aoshen02
added a commit
to vllm-project/vime
that referenced
this pull request
Jun 18, 2026
…l_utils weight-reload fix (#45989) v0.23.0 already includes the sleep/scheduler guard from #44483, so the core.py patch is no longer needed. Replace it with the FP8+DeepEP weight-reload fix (vllm-project/vllm#45989): snapshot max_num_batched_tokens from FusedMoEConfig instead of calling get_current_vllm_config() during layerwise reload. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Ao Shen <aoshen@inferact.ai> Signed-off-by: aoshen02 <aoshen@inferact.ai>
aoshen02
added a commit
to vllm-project/vime
that referenced
this pull request
Jun 18, 2026
…l_utils weight-reload fix (#45989) v0.23.0 already includes the sleep/scheduler guard from #44483, so the core.py patch is no longer needed. Replace it with the FP8+DeepEP weight-reload fix (vllm-project/vllm#45989): snapshot max_num_batched_tokens from FusedMoEConfig instead of calling get_current_vllm_config() during layerwise reload. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Ao Shen <aoshen@inferact.ai> Signed-off-by: aoshen02 <aoshen@inferact.ai>
CalvinXKY
pushed a commit
to vllm-project/vime
that referenced
this pull request
Jun 18, 2026
* docker: upgrade base to vLLM 0.23.0, remove CUDA 13 build path - Base image: v0.22.0-cu129-ubuntu2404 → v0.23.0-cu129-ubuntu2404 - Remove `ENABLE_CUDA_13` ARG and all conditional cu13 blocks: - cu13 apt dev headers (libcublas-dev-13-0, cuda-nvrtc-dev-13-0, etc.) - TE source build (cu13 wheel didn't exist; cu129 wheel works on arm64) - fzyzcjy triton source build (cu13 specific) - TMS_CUDA_MAJOR export (no longer needed) - Simplify cublas-dev to unconditional libcublas-dev-12-9 - Simplify TE install to wheel-only - justfile: remove `build-cu13` target and cu13 tag scheme - vllm.patch: adapt line numbers for 0.23.0 (776/1896 vs 750/1844), preserve `with self.log_iteration_details(None):` wrapper cu129 nvcc already supports sm100/sm120 (Blackwell), so cu13 build path was unnecessary — it caused build failures on gb300 (cu13 apt packages hijacked /etc/alternatives/cuda, breaking TE CMake). Tested: built successfully on gb200 (arm64), h200 (x86), gb300 (arm64). All three confirmed vLLM 0.23.0. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: aoshen02 <aoshen@inferact.ai> * docker/patch: replace core.py sleep fix (already in v023) with all2all_utils weight-reload fix (#45989) v0.23.0 already includes the sleep/scheduler guard from #44483, so the core.py patch is no longer needed. Replace it with the FP8+DeepEP weight-reload fix (vllm-project/vllm#45989): snapshot max_num_batched_tokens from FusedMoEConfig instead of calling get_current_vllm_config() during layerwise reload. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Ao Shen <aoshen@inferact.ai> Signed-off-by: aoshen02 <aoshen@inferact.ai> --------- Signed-off-by: aoshen02 <aoshen@inferact.ai> Signed-off-by: Ao Shen <aoshen@inferact.ai> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
aoshen02
referenced
this pull request
in aoshen02/vllm-detached-backup-20260720
Jun 21, 2026
Add TestWeightReloadCodePaths to test_weight_update.py — exercises the layerwise weight-reload path (initialize → finalize → process_weights_after_loading) across model architecture × quantization combinations using vllm.LLM in-process. Test matrix: - moe-bf16-tiny: TitanML/tiny-mixtral (MoE reload baseline) - moe-bf16-3b: ibm-research/PowerMoE-3b (real MoE kernel reconstruction) - moe-fp8: allenai/OLMoE-1B-7B-0924 with fp8 (#45989 crash path) - moe-mxfp8: allenai/OLMoE-1B-7B-0924 with mxfp8 (#44613 crash path, SM100+) Each case triggers finalize_layerwise_reload which calls process_weights_after_loading on all layers — the exact code path where get_current_vllm_config() crashes during MoE kernel reconstruction if the config context is missing. Verified on GB200 (SM100): 4/4 passed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Collaborator
Author
Contributor
|
This pull request has merge conflicts that must be resolved before it can be |
This was referenced Jul 10, 2026
Assisted-by: OpenAI Codex Signed-off-by: aoshen02 <aoshen@inferact.ai>
aoshen02
force-pushed
the
fix/set-vllm-config-in-weight-update
branch
from
July 20, 2026 04:28
c7fe756 to
cf606d5
Compare
Collaborator
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Isotr0py
approved these changes
Jul 20, 2026
ArjunPakhan
pushed a commit
to ArjunPakhan/vllm
that referenced
this pull request
Jul 21, 2026
Signed-off-by: aoshen02 <aoshen@inferact.ai>
aarushjain29
pushed a commit
to ROCm/vllm
that referenced
this pull request
Jul 21, 2026
Signed-off-by: aoshen02 <aoshen@inferact.ai> Signed-off-by: aarushjain29 <Aarushi.Jain2@amd.com>
edwinlim0919
pushed a commit
to chaeminlim-mb/vllm
that referenced
this pull request
Jul 29, 2026
Signed-off-by: aoshen02 <aoshen@inferact.ai>
itej89
pushed a commit
to itej89/vllm
that referenced
this pull request
Aug 4, 2026
Signed-off-by: aoshen02 <aoshen@inferact.ai> Signed-off-by: Tej Kiran <kiran.tej@amd.com>
aditi-amd
pushed a commit
to aditi-amd/vllm
that referenced
this pull request
Aug 4, 2026
Signed-off-by: aoshen02 <aoshen@inferact.ai> Signed-off-by: root <root@smci355-ccs-aus-m02-09.cs-aus.dcgpu>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
RL weight updates re-run layer post-processing after model initialization.
Those paths may call
get_current_vllm_config(), but the worker reload APIs didnot establish the config context, causing an assertion failure on the FP8 MoE +
DeepEP path.
This PR wraps the stable worker-level reload boundaries with
set_current_vllm_config():reload_weightsstart_weight_update,update_weights, andfinish_weight_updateV1 and the default V2 runner both use these worker entry points. The context is
scoped to each synchronous operation and restored afterward.
Lifecycle investigation
We audited when
VllmConfigis first consumed, when it can change, and why thesame config-dependent code is reached again during reload.
Initial model load
VllmConfig.__post_init__validates the configuration and derives startupsettings.
GPUWorker.load_modelentersset_current_vllm_config(self.vllm_config).initialize_modelalso scopes the model constructor, so modules can read thecurrent config without threading it through every constructor.
Initial weight post-processing builds quantized kernels. For the affected
MoE/EP path, V2 then calls:
Some quantization paths create the modular kernel directly from
process_weights_after_loading; both initial paths are still inside theouter
GPUWorker.load_modelconfig scope.Startup may subsequently update the live config: auto-fit writes
model_config.max_model_len, KV-cache initialization writescache_config.num_gpu_blocks, and compilation/CUDA-graph settings arefinalized during startup. By engine-ready time, these values are available
on the same
VllmConfiginstance.After initialization
Normal inference mostly consumes the finalized config. The explicit exceptions
we found are:
update_config, which can replacemodel_configorload_config; V2 keepsself.vllm_configsynchronized. There is no default internal productioncaller—the interface is triggered explicitly by an integration/RPC or tests.
weights_path, which updatesmodel_config.modelto that path.The RL paths covered by this PR—
weights_iteratorand the weight-transferengines—do not modify
VllmConfig.Why reload still needs the context
Although RL reload does not change the config, it deliberately re-enters code
normally associated with initialization:
Regular
reload_weightssimilarly runsinitialize_layerwise_reload,model.load_weights, andfinalize_layerwise_reload. Any current or futurequantization/layer post-processing reached from those hooks may legitimately
need the worker's live config.
This is why fixing individual
get_current_vllm_config()call sites is fragile:the repository has many constructor and post-load consumers, and new consumers
can be added later. Establishing the context once at the reload boundaries makes
the already-finalized, live worker config available to the entire operation
without copying fields into every subsystem or keeping a process-global context
active permanently.
Tests
.venv/bin/python -m pytest tests/v1/worker/test_gpu_worker_weight_transfer.py -q(
7 passed)pre-commit run --files vllm/v1/worker/gpu_worker.py tests/v1/worker/test_gpu_worker_weight_transfer.py(all hooks passed, including ruff and mypy)
Duplicate-work check
This updates the existing fix in #45989 rather than opening another PR. Searches
for open PRs covering the same config-context failure found no duplicate; the
other weight-reload PRs address different problems.
AI assistance
OpenAI Codex was used to help investigate, implement, and test this change. The
human submitter is responsible for reviewing every changed line and defending
the change end-to-end.