[Bugfix] Fix humming kernel crash when layer.has_bias is None#48769
Open
kylesayrs wants to merge 4 commits into
Open
[Bugfix] Fix humming kernel crash when layer.has_bias is None#48769kylesayrs wants to merge 4 commits into
kylesayrs wants to merge 4 commits into
Conversation
kylesayrs
requested review from
mgoin,
pavanimajety,
robertgshaw2-redhat,
tlrmchlsmth,
yewentao256 and
zyongye
as code owners
July 15, 2026 18:32
yewentao256
approved these changes
Jul 15, 2026
yewentao256
left a comment
Member
There was a problem hiding this comment.
LGTM, thanks for the work!
mgoin
requested changes
Jul 15, 2026
Member
There was a problem hiding this comment.
@kylesayrs can we fix the model definition instead? LinearBase's bias arg is typed as bool, so we should try to follow the type (even if it isn't currently being enforced)
vllm/vllm/model_executor/layers/linear.py
Lines 245 to 263 in de100ff
Contributor
|
I feel that the model definition might have been passed incorrectly because the parameter name |
LinearBase sets has_bias = bias, and some custom model layers pass bias=None. This None propagates into HummingLayerMeta, causing to_cpp_str() to skip kHasBias (isinstance(None, (bool, int, Enum)) is False), producing a NVRTC compilation error: class "LayerConfig" has no member "kHasBias" Fix both call sites that forward has_bias=layer.has_bias to prepare_layer_meta() by converting None to False. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Some models (e.g. hy_v3) pass bias=None to LinearBase subclasses. Since has_bias is typed bool, enforce that at the source with bool(bias) so callers always see a proper bool and no downstream guard is needed. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
LinearBase.bias is typed as bool, so follow the type at the call site rather than guarding downstream. Reverts the bool() coercion in LinearBase.__init__ in favor of the model-level fix. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
kylesayrs
force-pushed
the
fix/humming-has-bias-none
branch
from
July 18, 2026 17:25
dfb7369 to
241b1d8
Compare
Contributor
Author
|
@jinzhen-lin I definitely agree, but there's also precedent from |
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
LinearBase.__init__setsself.has_bias = bias, and some custom model layers (e.g.Hy3-NVFP4-FP8) passbias=None. ThisNonepropagates ashas_bias=NoneintoHummingLayerMeta.BaseHummingConfig.to_cpp_str()skips any field whose value failsisinstance(value, (bool, int, Enum))—Nonefails this check, sokHasBiasis omitted from the generated C++ struct.class "LayerConfig" has no member "kHasBias".None → Falseat the two call sites that forwardlayer.has_biastoprepare_layer_meta().Why this is not a duplicate
Searched open PRs for
humming has_bias,kHasBias humming,humming NoneType bias— no results.Test commands and results
Sanity check (basic generation with
Hy3-NVFP4-FP8, 4×A100, TP=4):GPQA Diamond eval (
inspect_evals/gpqa_diamond, 1 epoch, 198 samples):Notes
None → Falsematches the existing default (has_bias: bool = FalseinLayerConfig) and is safe for all callers where the layer genuinely has no bias.🤖 Generated with Claude Code