Repository navigation
[Bugfix] Make Humming DeviceInfo lookups traceable under torch.compile - #61858
Merged
vllm-bot merged 2 commits intoOct 15, 2026
Merged
Conversation
Humming builds a DeviceInfo on every forward call (LayerConfig.check_device, PDL heuristics). Under vLLM's fullgraph compile this recurses forever in DeviceInfo.__getattr__ (vllm-project/humming#147), and even with the upstream fix (vllm-project#148) Dynamo cannot trace the extension's _DeviceInfo constructor. Patch humming on first use through the vllm.utils.humming facade: backport the vllm-project#148 __getattr__ fix and hand out one cached DeviceInfo per device, which prepare_layer_config creates eagerly during weight processing. Signed-off-by: mgoin <mgoin64@gmail.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mgoin
requested review from
robertgshaw2-redhat and
yewentao256
as code owners
October 15, 2026 15:46
mgoin
requested review from
AndreasKaratzas,
Harry-Chen,
khluu,
pavanimajety and
zyongye
as code owners
October 15, 2026 15:46
Member
Author
|
/ci run |
|
✅ Triggered Buildkite CI #95176 for commit |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: mgoin <mgoin64@gmail.com>
Member
Author
|
Humming-side fix: vllm-project/humming#149. Verified vLLM main without this workaround serves the compiled int6 + Hadamard + int8 Humming model on that branch, so this can be reverted once the pin includes it. |
Member
Author
|
Previous build passed and latest commit just updated comment, merging |
khluu
pushed a commit
that referenced
this pull request
Oct 17, 2026
#61858) Signed-off-by: mgoin <mgoin64@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
thanks for the fix! I think this also fixes my issue with Humming kernels on sm120 |
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.
Overview
Fixes vllm-project/humming#147 for vLLM: models served through Humming fail torch.compile with
RecursionErrorwhenever Humming's forward path quantizes or Hadamard-transforms activations (seen during warmup of MXFP4 MoE checkpoints on H200). This patches Humming from thevllm.utils.hummingfacade so the pinnedhumming-kernels==0.1.17works for v0.32.0.Claims
fullgraph=True) works again on Humming forward paths that runmay_process_input(input quantization, Hadamard): noRecursionError, no DynamoUnsupported.Validation
B300 (SM103), this branch on main with
humming-kernels[cu13]==0.1.17:tests/quantization/test_humming_compile.pyRecursionError--quantization humming, int6 weights + Hadamard + int8 activations, torch.compile + CUDA graphsRecursionErrorat engine init__getattr__fix backported (on 0.1.16)torch._dynamo.exc.Unsupportedon_DeviceInfo.__new__copy.copy,torch.compile,fullgraph=True)RecursionErrorRegression tests (same setup):
pytest tests/kernels/moe/test_moe.py tests/kernels/core/test_activation.py tests/quantization/test_humming_ignore.py tests/quantization/test_humming_mxfp4_block_fp8.py tests/kernels/quantization/test_mxfp4_kernel_selection.py tests/model_executor/test_utils.py -k humming→ 194 passed.Not run locally on Hopper. The new test runs in the H200 Quantization CI step, and I added
vllm/utils/humming.pyto that step's trigger paths. Note the existing Humming lm-eval configs all use--enforce-eager, which is why CI never caught this.Details
Root cause. On every call,
LayerConfig.check_deviceand the PDL heuristics (_resolve_use_pdl→get_heuristics_class) build a newhumming.device.DeviceInfo(device). vLLM traces these frommay_process_inputinside its fullgraph-compiled region. Two problems stack up:DeviceInfohas__slots__and a catch-all__getattr__. When Dynamo creates the instance, it reads the unset_valueslot, which re-enters__getattr__and recurses forever. humming#148 fixes this by raisingAttributeErrorfor private names._DeviceInfo(index)constructor, so fullgraph compile fails withUnsupported. Reading attributes from an extension object that already exists does trace fine; that's why the module-globalcurrent_devicealready works under compile. Humming main still has these per-call constructions, so 0.1.18 alone would still break vLLM.Fix. On first use of the facade,
_patch_humming():__getattr__change (also fixescopy.copy(DeviceInfo)), andDeviceInfoname in the five Humming modules that call it (config.config,transform,tune,tune.process_input,utils.smem) with a factory that returns one cached instance per device index.prepare_layer_configpopulates the cache eagerly during weight processing, so at trace time Dynamo only sees a dict lookup on an existing object.All vLLM Humming access goes through the lazy facade, so the patch is always applied before any layer is prepared. The swap is skipped for any module whose
DeviceInfois no longer Humming's class.DeviceInfoonly exposes static device properties, so caching it is safe.Follow-up. This should be removed once Humming's
DeviceInfocan be constructed in traced code (for example, by caching inside Humming itself); there's a TODO. I'll raise this on the Humming side so 0.1.18+ can drop the patch.Pull Request Checklist
I used vLLM's
/pr-checklistskill. (Mandatory for agents, optional for humans).AI assistance was used during the creation of this PR.
Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.
Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.
Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.
Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.
No duplicate: no open vLLM PR touches Humming
DeviceInfoor this compile failure (searched "humming DeviceInfo", "humming torch.compile", "humming recursion", "humming fullgraph").🤖 Generated with Claude Code