[MOE Refactor] Remove QuantType in prepare_finalize.py#6534
[MOE Refactor] Remove QuantType in prepare_finalize.py#6534wangxiyuan merged 1 commit intovllm-project:mainfrom
Conversation
Summary of ChangesHello @shenchuxiaofugui, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refactors the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
👋 Hi! Thank you for contributing to the vLLM Ascend project. The following points will speed up your PR merge:
If CI fails, you can run linting and testing checks locally according Contributing and Testing. |
There was a problem hiding this comment.
Code Review
This pull request is a refactoring effort to remove a duplicate QuantType enum definition from vllm_ascend/ops/fused_moe/prepare_finalize.py. By centralizing the QuantType enum in vllm_ascend/quantization/methods.base, the changes improve code clarity, reduce redundancy, and prevent potential confusion. The implementation of _get_quant_type in fused_moe.py is also simplified as part of this refactoring. The changes are well-executed and improve the overall code quality.
As per the repository's style guide, I've provided a suggested pull request title and summary below. The current summary is incomplete and contains placeholder text.
Suggested PR Title:
[MoE][Refactor] Remove duplicate QuantType from prepare_finalize.pySuggested PR Summary:
### What this PR does / why we need it?
This pull request refactors the codebase to eliminate a duplicate `QuantType` enum definition in `vllm_ascend/ops/fused_moe/prepare_finalize.py`.
All modules that previously used the local definition now import `QuantType` from a single source of truth: `vllm_ascend.quantization.methods.base`. This change prevents confusion between different `QuantType` classes and improves code maintainability.
As a result of this refactoring, the `_get_quant_type` method in `vllm_ascend/ops/fused_moe/fused_moe.py` has also been simplified.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
CI passed.c08ba91 to
668193f
Compare
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
668193f to
61422ce
Compare
Signed-off-by: shenchuxiaofugui <1311027364@qq.com>
61422ce to
924f1a7
Compare
…to qwen3next_rebase * 'main' of https://github.com/vllm-project/vllm-ascend: [Feat] 310p support MoE W8A8 quantizaition (vllm-project#6641) [TEST]add a qwen3-30b acc case with mooncake mempool (vllm-project#6244) [MOE Refactor] Remove QuantType in prepare_finalize.py (vllm-project#6534) [EPLB] Avoiding eplb's dependency on a specified model (vllm-project#6528) [Doc][Misc] Restructure tutorial documentation (vllm-project#6501) implement batch invariant with ascendc (vllm-project#6590) [Refact]Refact MLA/SFA weight prefetch to consist with moe weight prefetch (vllm-project#6629) [Misc] upgrade to vllm main (vllm-project#6646) [main][Docs] Fix spelling errors across documentation (vllm-project#6649) [bugfix]Fix no attribute 'data' when MLAPO is enable (vllm-project#6601) [DOC]Add Memcache Usage Guide (vllm-project#6476) [main][bugfix] Fix spec acceptance rate problem in vllm_0.15.0 (vllm-project#6606) [Test][LoRA] Add e2e test for base model inference (vllm-project#6624) [refactor]Optimized the kvcache usage of Deepseek v3.2 (vllm-project#6610) [Feat](sfa,dcp) support dcp for sfa (vllm-project#6563) [BugFix] Add support for rotary_dim parameter when using partial rope in rotary_embedding (vllm-project#6581) [fix bug] fix tensor mismatch bug in sigmoid operate test case (vllm-project#6619) [Kernel]: Optimize DispatchFFNCombine performance (vllm-project#6468) [MISC] Clean up useless env USE_OPTIMIZED_MODEL (vllm-project#6618)
…6534) ### What this PR does / why we need it? To prevent confusion between different QuantType classes, we remove** QuantType in prepare_finalize.py - vLLM version: v0.15.0 - vLLM main: https://github.com/vllm-project/vllm/commit/v0.15.0 Signed-off-by: shenchuxiaofugui <1311027364@qq.com> Signed-off-by: mikequan0425 <mikequan0425@foxmail.com>
…6534) ### What this PR does / why we need it? To prevent confusion between different QuantType classes, we remove** QuantType in prepare_finalize.py - vLLM version: v0.15.0 - vLLM main: https://github.com/vllm-project/vllm/commit/v0.15.0 Signed-off-by: shenchuxiaofugui <1311027364@qq.com> Signed-off-by: momochenchuw <chenchuw@huawei.com>
…6534) ### What this PR does / why we need it? To prevent confusion between different QuantType classes, we remove** QuantType in prepare_finalize.py - vLLM version: v0.15.0 - vLLM main: https://github.com/vllm-project/vllm/commit/v0.15.0 Signed-off-by: shenchuxiaofugui <1311027364@qq.com>
…6534) ### What this PR does / why we need it? To prevent confusion between different QuantType classes, we remove** QuantType in prepare_finalize.py - vLLM version: v0.15.0 - vLLM main: https://github.com/vllm-project/vllm/commit/v0.15.0 Signed-off-by: shenchuxiaofugui <1311027364@qq.com> Signed-off-by: zrj026 <zhangrunjiang026@gmail.com>
…6534) ### What this PR does / why we need it? To prevent confusion between different QuantType classes, we remove** QuantType in prepare_finalize.py - vLLM version: v0.15.0 - vLLM main: https://github.com/vllm-project/vllm/commit/v0.15.0 Signed-off-by: shenchuxiaofugui <1311027364@qq.com>
…6534) ### What this PR does / why we need it? To prevent confusion between different QuantType classes, we remove** QuantType in prepare_finalize.py - vLLM version: v0.15.0 - vLLM main: https://github.com/vllm-project/vllm/commit/v0.15.0 Signed-off-by: shenchuxiaofugui <1311027364@qq.com> Signed-off-by: zrj026 <zhangrunjiang026@gmail.com>
…6534) ### What this PR does / why we need it? To prevent confusion between different QuantType classes, we remove** QuantType in prepare_finalize.py - vLLM version: v0.15.0 - vLLM main: https://github.com/vllm-project/vllm/commit/v0.15.0 Signed-off-by: shenchuxiaofugui <1311027364@qq.com>
What this PR does / why we need it?
To prevent confusion between different QuantType classes, we remove** QuantType in prepare_finalize.py
Does this PR introduce any user-facing change?
How was this patch tested?
Of course! Here is a comprehensive explanation of deep learning, broken down for clarity.\n\n### The Simple Analogy: A Child Learning to Recognize a Cat\n\nImagine teaching a child what a cat is. You don't give them a rulebook with instructions like "has pointy ears, whiskers, and a tail." Instead, you show them many pictures, saying "this is a cat" or "this is not a cat." The child's brain gradually learns to identify the complex patterns—the combination of shapes, colors, and textures—that define "cat-ness."\n\nDeep learning is essentially this, but for computers. It's a method for teaching computers to learn from examples and recognize patterns directly from data (like images, sound, or text) without being explicitly programmed with rigid rules.\n\n---\n\n### The Technical Definition\n\nDeep Learning is a subfield of machine learning, which itself is a subfield of artificial intelligence (AI). It uses artificial neural networks with many layers ("deep" networks) to model and understand complex patterns in data.\n\nHere are the key concepts in that definition:\n\n1. Artificial Intelligence (AI): The broad science of making machines smart and capable of performing tasks that typically require human intelligence.\n2. Machine Learning (ML): A subset of AI that gives computers the ability to learn from data without being explicitly programmed for every single rule.\n3. Deep Learning (DL): A specific, powerful