[Refactor] refactor humming linear and moe backends to use explicit layer configs - #49610
Conversation
Co-authored-by: OpenAI Codex <noreply@openai.com>
|
This pull request has merge conflicts that must be resolved before it can be |
| for name, _ in list(layer.named_parameters()): | ||
| delattr(layer, name) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
| @staticmethod | ||
| def _supports_batch_invariance() -> bool: | ||
| return True |
There was a problem hiding this comment.
What is this method used for?
There was a problem hiding this comment.
vllm/vllm/model_executor/layers/fused_moe/modular_kernel.py
Lines 663 to 670 in 38a267c
Humming supports batch invariant, we need to override this method to make it work properly.
There was a problem hiding this comment.
I didn't see it referenced anywhere else. Is it for future work?
There was a problem hiding this comment.
vllm/vllm/model_executor/layers/fused_moe/modular_kernel.py
Lines 577 to 578 in d0ce3da
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, |
There was a problem hiding this comment.
Are you planning on eventually removing the layer argument here as well? Why not pass layer.humming_configs?
There was a problem hiding this comment.
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, |
| assert isinstance(layer, RoutedExperts) | ||
| return get_humming_moe_quant_config(layer) | ||
| return get_humming_moe_quant_config( | ||
| layer, |
…kend # Conflicts: # vllm/model_executor/layers/fused_moe/experts/fused_humming_moe.py
Co-authored-by: OpenAI Codex <noreply@openai.com>
|
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-filesThen, commit the changes and push to your branch. For future commits, |
Co-authored-by: OpenAI Codex <noreply@openai.com>
|
✅ Triggered Buildkite CI #82649 for commit |
|
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-filesThen, commit the changes and push to your branch. For future commits, |
|
/ci run |
|
✅ Triggered Buildkite CI #82687 for commit |
|
/ci run |
1 similar comment
|
/ci run |
|
/ci run |
|
✅ Triggered Buildkite CI #82765 for commit |
|
@mgoin The failed tests seem unreleated. |
…refactor/humming-backend
mgoin
left a comment
There was a problem hiding this comment.
Very nice work, appreciate it!!
…ayer configs (vllm-project#49610) Signed-off-by: Jinzhen Lin <jinzhen.ljz@antgroup.com> Co-authored-by: OpenAI Codex <noreply@openai.com>
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.