[Bugfix][Quantization] Reuse online NVFP4 MoE kernel across reloads - #50074
Open
S1ro1 wants to merge 1 commit into
Open
[Bugfix][Quantization] Reuse online NVFP4 MoE kernel across reloads#50074S1ro1 wants to merge 1 commit into
S1ro1 wants to merge 1 commit into
Conversation
Assisted-by: OpenAI Codex Signed-off-by: S1ro1 <matej.sirovatka@gmail.com>
S1ro1
requested review from
AndreasKaratzas,
mgoin,
pavanimajety,
robertgshaw2-redhat,
tlrmchlsmth,
yewentao256 and
zyongye
as code owners
July 28, 2026 03:35
Contributor
|
This pull request has merge conflicts that must be resolved before it can be |
Collaborator
|
@S1ro1 Could you please resolve the conflict? |
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
Online NVFP4 MoE models re-run
process_weights_after_loadingwhenever fresh BF16 weights are loaded and quantized in place._setup_kernelcurrently also replaces the MoE kernel and quantization-config objects on every reload. Compiled and captured execution paths still reference the original kernel object, so replacing it can leave reloads executing against stale state and eventually produce non-finite outputs.This change keeps the online NVFP4 MoE kernel and its quantization config stable for the lifetime of the layer. Weight conversion and
process_weights_after_loadingremain outside the guard and still run on every reload, so each fresh set of BF16 weights is quantized and installed as before.Related to #41670 and #48902, but not a duplicate: this covers online NVFP4 and deliberately preserves per-reload weight processing.
AI assistance (OpenAI Codex) was used for investigation, implementation, and test drafting. I reviewed and understand the change.
Test Plan
_setup_kerneltwice and verifies:Test Result
uvx ruff check tests/quantization/test_online.py vllm/model_executor/layers/quantization/online/nvfp4.py: passed.uvx ruff format --check tests/quantization/test_online.py vllm/model_executor/layers/quantization/online/nvfp4.py: passed.Paired end-to-end result:
The fixed run completed all five reloads without an invalid response. The control first returned non-finite values after repeated reloads and recorded 16 provider errors in its fifth persisted batch.
No documentation change is needed because this restores the existing online-reload contract.
Essential Elements of an Effective PR Description Checklist