[Refactor] Replace activation: str with MoEActivation enum#33843
[Refactor] Replace activation: str with MoEActivation enum#33843vllm-bot merged 15 commits intovllm-project:mainfrom
activation: str with MoEActivation enum#33843Conversation
Signed-off-by: mgoin <mgoin64@gmail.com>
There was a problem hiding this comment.
Code Review
This pull request introduces a great refactoring by defining a MoEActivation enum to replace string-based activation function identifiers. This significantly improves type safety and code clarity across the MoE-related modules. The changes are extensive and have been applied consistently throughout the codebase. I have one piece of feedback regarding a potentially unsafe in-place modification in the new activation utility function.
|
Hi @mgoin, the pre-commit checks have failed. Please run: uv pip install pre-commit
pre-commit install
pre-commit run --all-filesThen, commit the changes and push to your branch. For future commits, Tip Is
|
|
labor of love |
Signed-off-by: mgoin <mgoin64@gmail.com>
|
This pull request has merge conflicts that must be resolved before it can be |
Signed-off-by: Michael Goin <mgoin64@gmail.com>
activation: str with MoEActivation enum
Signed-off-by: mgoin <mgoin64@gmail.com>
Signed-off-by: mgoin <mgoin64@gmail.com>
|
This pull request has merge conflicts that must be resolved before it can be |
|
Nice refactor. I added a few comments/questions. |
Signed-off-by: mgoin <mgoin64@gmail.com>
Signed-off-by: mgoin <mgoin64@gmail.com>
Signed-off-by: mgoin <mgoin64@gmail.com>
…project#33843) Signed-off-by: mgoin <mgoin64@gmail.com> Signed-off-by: Michael Goin <mgoin64@gmail.com>
Signed-off-by: Qiliang Cui <derrhein@gmail.com>
…project#33843) Signed-off-by: mgoin <mgoin64@gmail.com> Signed-off-by: Michael Goin <mgoin64@gmail.com> Signed-off-by: Eldar Kurtic <research@neuralmagic.com>
…project#33843) Signed-off-by: mgoin <mgoin64@gmail.com> Signed-off-by: Michael Goin <mgoin64@gmail.com>
…project#33843) Signed-off-by: mgoin <mgoin64@gmail.com> Signed-off-by: Michael Goin <mgoin64@gmail.com>
Purpose
We have had
activationdefined, validated, and passed around as a raw string forever. Now that we have popular models that don't just use thesiludefault and also need to support non-gated MoEs and their activation functions, we need to have a single source of truth for all the activation functions that exist in vLLM and which MoE kernels support which functions. I want to start with MoE since that is where we have the most divergence in support due to fused kernels.This PR introduces
MoEActivationand aims to replace all usage ofactivation: strin internal interfaces for MoE. Note that we do keepFusedMoE.__init__asactivation: strin order to avoid changes to the model definitions, however we do validate it withMoEActivation.from_str(activation)within the constructor.We do still need to keep
activation: strin some function signatures to be compatible with torch's custom op registration so we will pass in the MoEActivation asactivation.valueand convert it back within the custom op withMoEActivation.from_str(activation)Test Plan
Test Result
Run all tests in CI and discuss with external hardware plugins
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.