Skip to content

[Refactor] refactor humming linear and moe backends to use explicit layer configs - #49610

Merged
vllm-bot merged 40 commits into
vllm-project:mainfrom
jinzhen-lin:refactor/humming-backend
Aug 7, 2026
Merged

vllm-bot merged 40 commits into
vllm-project:mainfrom
jinzhen-lin:refactor/humming-backend

Conversation

@jinzhen-lin

Copy link
Copy Markdown
Contributor

This PR refactor the Humming linear and MoE backends to use explicit layer configs and tensors instead of passing vLLM layers into the backend.

Also update Humming CI coverage and pin the dependency to the latest upstream commit.

AI assistance (OpenAI Codex) was used.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

jinzhen-lin and others added 2 commits July 24, 2026 00:05
Co-authored-by: OpenAI Codex <noreply@openai.com>
@mergify

mergify Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @jinzhen-lin.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase label Jul 28, 2026
@mgoin mgoin added the ready ONLY add when PR is ready to merge/full CI is needed label Jul 29, 2026
Comment on lines +514 to +515
for name, _ in list(layer.named_parameters()):
delattr(layer, name)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it safe to delete all the parameters in the layer? I'm not very familiar with all the parameters used by linear layers but I'd be worried that there are other required parameters that might not be transformed that need to be preserved?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, all parameters in layer are tensors related to humming. A similar processing step has already been performed earlier in the same function (deleting all parameters and then recreating them). However, the logic in these two places can indeed be merged, and I have already combined them into one.

Comment on lines +316 to +318
@staticmethod
def _supports_batch_invariance() -> bool:
return True

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this method used for?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@staticmethod
def _supports_batch_invariance() -> bool:
"""
Whether the kernel supports batch invariance, i.e. the output does not
depend on the order of the tokens in the input batch. This is useful
for determining if the kernel can used with VLLM_BATCH_INVARIANT=1.
"""
return False

Humming supports batch invariant, we need to override this method to make it work properly.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see it referenced anywhere else. Is it for future work?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

elif envs.VLLM_BATCH_INVARIANT and not cls._supports_batch_invariance():
return False, _make_reason("batch invariance")

It is used for kernel filitering here.

assert isinstance(layer, RoutedExperts)
return get_humming_moe_quant_config(layer)
return get_humming_moe_quant_config(
layer,

@bnellnm bnellnm Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you planning on eventually removing the layer argument here as well? Why not pass layer.humming_configs?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part cannot be removed for now, as it is responsible for reading various weight tensors. The weight preprocessing results of Humming may produce a few extra tensors compared to the original, for example, in the case of mxfp4 × fp8, Humming splits the e8m0 scale into a group scale plus a tensor scale / channel scale form. However, the mxfp4 MoE oracle does not reserve space for the tensor scale / channel scale.

I plan to address this in future work.

assert isinstance(layer, RoutedExperts)
return get_humming_moe_quant_config(layer)
return get_humming_moe_quant_config(
layer,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

assert isinstance(layer, RoutedExperts)
return get_humming_moe_quant_config(layer)
return get_humming_moe_quant_config(
layer,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

jinzhen-lin and others added 2 commits July 30, 2026 20:44
…kend

# Conflicts:
#	vllm/model_executor/layers/fused_moe/experts/fused_humming_moe.py
Co-authored-by: OpenAI Codex <noreply@openai.com>
@mergify

mergify Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Hi @jinzhen-lin, the pre-commit checks have failed. Please run:

uv pip install pre-commit>=4.5.1
pre-commit install
pre-commit run --all-files

Then, commit the changes and push to your branch.

For future commits, pre-commit will run automatically on changed files before each commit.

Co-authored-by: OpenAI Codex <noreply@openai.com>
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

✅ Triggered Buildkite CI #82649 for commit e75e020ca591.

@mergify

mergify Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Hi @jinzhen-lin, the pre-commit checks have failed. Please run:

uv pip install pre-commit>=4.5.1
pre-commit install
pre-commit run --all-files

Then, commit the changes and push to your branch.

For future commits, pre-commit will run automatically on changed files before each commit.

@mergify mergify Bot removed the needs-rebase label Aug 6, 2026
@jinzhen-lin

Copy link
Copy Markdown
Contributor Author

/ci run

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

✅ Triggered Buildkite CI #82687 for commit 6c678f0d99f7.

@jinzhen-lin

Copy link
Copy Markdown
Contributor Author

/ci run

1 similar comment
@jinzhen-lin

Copy link
Copy Markdown
Contributor Author

/ci run

@jinzhen-lin

Copy link
Copy Markdown
Contributor Author

/ci run

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

✅ Triggered Buildkite CI #82765 for commit 83f648991370.

@jinzhen-lin

Copy link
Copy Markdown
Contributor Author

@mgoin The failed tests seem unreleated.

@mgoin mgoin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice work, appreciate it!!

@github-project-automation github-project-automation Bot moved this to Ready in NVIDIA Aug 7, 2026
@vllm-bot
vllm-bot merged commit fcde8e1 into vllm-project:main Aug 7, 2026
7 checks passed
@github-project-automation github-project-automation Bot moved this from Ready to Done in NVIDIA Aug 7, 2026
zyp2014 pushed a commit to zyp2014/vllm that referenced this pull request Aug 21, 2026
…ayer configs (vllm-project#49610)

Signed-off-by: Jinzhen Lin <jinzhen.ljz@antgroup.com>
Co-authored-by: OpenAI Codex <noreply@openai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/build nvidia quantization ready ONLY add when PR is ready to merge/full CI is needed

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants