[Bugfix] Skip bias tensors in online FP8 quantization pipeline#39665
Closed
r266-tech wants to merge 1 commit into
Closed
[Bugfix] Skip bias tensors in online FP8 quantization pipeline#39665r266-tech wants to merge 1 commit into
r266-tech wants to merge 1 commit into
Conversation
Add "bias" to SKIP_TENSORS so bias parameters are not wrapped by make_online_process_loader during initialize_online_processing. Without this, bias tensors on models with bias=True (Qwen2/2.5, GPT-2, Phi, etc.) silently stay at zero when using --quantization fp8 on BF16 checkpoints. Fixes vllm-project#39663 Signed-off-by: r266-tech <183631678+r266-tech@users.noreply.github.com>
8120d4b to
274a4f8
Compare
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
Add
"bias"toSKIP_TENSORSinvllm/model_executor/model_loader/reload/meta.pyso bias parameters bypassmake_online_process_loaderwrapping duringinitialize_online_processing.Problem: When using
--quantization fp8on BF16 checkpoints, models withbias=Truelinear layers (Qwen2/2.5, GPT-2, Phi, etc.) produce garbage output. The bias tensors get wrapped by the online processing pipeline but never materialize — they silently stay at zero.Root cause:
initialize_online_processinginlayerwise.pywraps weight loaders for all tensors not inSKIP_TENSORS. Bias parameters (1D, small) don't need FP8 quantization and are not designed to flow through the deferred loading pipeline. Same class of bug as #37334 and #38746.Fix: 1-line addition of
"bias"to the skip set. All vllm parallel linear layers (ColumnParallelLinear,QKVParallelLinear,RowParallelLinear, etc.) register bias asself.biasviaParameter(...)orregister_parameter("bias", None), so the exact string"bias"matches all standard bias parameters.Note: Custom non-standard bias parameters with different names (e.g.,
e_score_correction_bias) are already individually listed inSKIP_TENSORS. This fix targets the standardnn.Linear-style bias that all parallel linear layers inherit.Fixes #39663