[Bugfix][Attention] Preserve post-load tensors across weight reloads - #48251
Merged
Isotr0py merged 4 commits intoJul 17, 2026
Merged
Conversation
aoshen02
force-pushed
the
codex/fix-flashinfer-sinks-reload
branch
2 times, most recently
from
July 10, 2026 12:57
1beedfb to
7921598
Compare
Assisted-by: OpenAI Codex Signed-off-by: aoshen02 <aoshen@inferact.ai>
Assisted-by: OpenAI Codex Signed-off-by: aoshen02 <aoshen@inferact.ai>
aoshen02
force-pushed
the
codex/fix-flashinfer-sinks-reload
branch
from
July 11, 2026 13:47
7921598 to
1f023cb
Compare
This was referenced Jul 12, 2026
This was referenced Jul 13, 2026
Merged
5 tasks
aoshen02
marked this pull request as ready for review
July 16, 2026 14:53
aoshen02
requested review from
LucasWilkinson,
MatthewBonanni,
mgoin,
pavanimajety and
vadiklyutiy
as code owners
July 16, 2026 14:53
Contributor
|
Hi @aoshen02, the pre-commit checks have failed. Please run: uv pip install pre-commit>=4.5.1
pre-commit install
pre-commit run --all-filesThen, commit the changes and push to your branch. For future commits, |
Co-authored-by: OpenAI Codex <codex@openai.com> Signed-off-by: aoshen02 <aoshen@inferact.ai>
Isotr0py
approved these changes
Jul 17, 2026
ywang96
approved these changes
Jul 17, 2026
plasticchris
pushed a commit
to plasticchris/vllm
that referenced
this pull request
Jul 20, 2026
…llm-project#48251) Signed-off-by: aoshen02 <aoshen@inferact.ai>
edwinlim0919
pushed a commit
to chaeminlim-mb/vllm
that referenced
this pull request
Jul 29, 2026
…llm-project#48251) Signed-off-by: aoshen02 <aoshen@inferact.ai>
aditi-amd
pushed a commit
to aditi-amd/vllm
that referenced
this pull request
Aug 4, 2026
…llm-project#48251) 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.
Purpose
Preserve attention runtime tensors derived by
process_weights_after_loading()across layerwise weight reloads. This fixes stale FlashInfer attention sinks and prevents standard MLA CUDA graphs from retaining obsoleteW_UV/W_UK_Taddresses.Root cause
Two post-load paths replaced tensors instead of refreshing their existing storage:
MLAAttentionreassigned derivedW_UVandW_UK_Tviews. CUDA graphs captured before a reload continued to reference the old allocations.self.sinks = self.sinks.to(torch.float32). Later reloads updated the source parameter but not the detached FP32 tensor used by the backend.Level-2 sleep makes the MLA failure severe because the stale weights allocation is remapped without restoring its contents. Level 1 can mask the corruption by restoring the old values, but it still does not make a captured graph observe updated derived weights.
Changes
replace_parameter(..., prefer_copy=True)for standard MLAW_UVandW_UK_T, preserving compatible storage across post-load processing.Validation
Focused tests on the rebased PR head:
pre-commit run --fileson all four changed files passed, including Ruff and mypy.End-to-end MLA evaluation used Moonlight-16B-A3B-Instruct-FP8 on 8x H200 with VIME level-2 sleep, layerwise weight update, and FULL/PIECEWISE CUDA graphs:
A minimal CUDA graph A/B also reproduced token divergence before the fix, no divergence in eager mode, and no divergence with CUDA graphs after the fix.
FlashInfer sink refresh is covered by the focused dtype-parametrized regression. A Blackwell end-to-end sink-model run was not available locally.
Duplicate-work check
Searched open and historical vLLM PRs/issues for FlashInfer sink reload, MLA post-load tensor rebinding, and
process_weights_after_loadingreload fixes. No matching fix was found. PR #45648 releases and recaptures CUDA graphs around full sleep/wake, but does not fix reloads outside that lifecycle and adds recapture overhead. PR #35956 addresses KV-cache allocation ownership, not weight tensor address identity.Notes
AITER FP8/FP4 branches are intentionally unchanged because their platform-specific derived tensors require separate hardware coverage.
AI assistance: OpenAI Codex was used to investigate, implement, and test this change. The submitter reviewed the resulting diff and validation evidence.