-
Notifications
You must be signed in to change notification settings - Fork 547
Remove unused code in fused_moe.py #2805
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: machenglong <machenglong_yewu@cmss.chinamobile.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request correctly removes a redundant line of code in fused_moe.py, which improves code clarity. My review confirms this change is beneficial. I have also pointed out other nearby unused variables that could also be removed to align with the goal of this PR.
| # When all_reduce_merge is in progress, shared_experts does not do all_reduce in mlp, but waits until shared_experts+router_experts are completed before doing all_reduce | ||
| shared_hidden_states = shared_experts(hidden_states) | ||
|
|
||
| mc2_mask = forward_context.mc2_mask |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This removal is correct as mc2_mask was already assigned at line 408. In the spirit of removing unused code, the variables quantized_x_for_share and dynamic_scale_for_share initialized at line 410 also appear to be unused. They are always None and are passed to self.quant_method.apply. Removing them and their usage in the apply call would further improve code clarity and maintainability.
|
👋 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. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2805 +/- ##
=======================================
Coverage 72.61% 72.61%
=======================================
Files 154 154
Lines 21319 21317 -2
=======================================
Hits 15480 15480
+ Misses 5839 5837 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
### What this PR does / why we need it? line 408 already declared mc2_mask , remove duplicated unused code ### Does this PR introduce _any_ user-facing change? no ### How was this patch tested? CI passed with existing test. - vLLM version: v0.10.1.1 - vLLM main: vllm-project/vllm@60f0843 Signed-off-by: machenglong <machenglong_yewu@cmss.chinamobile.com> Signed-off-by: 1Fire4 <wangdingyi2@huawei.com>
### What this PR does / why we need it? line 408 already declared mc2_mask , remove duplicated unused code ### Does this PR introduce _any_ user-facing change? no ### How was this patch tested? CI passed with existing test. - vLLM version: v0.10.1.1 - vLLM main: vllm-project/vllm@60f0843 Signed-off-by: machenglong <machenglong_yewu@cmss.chinamobile.com>
### What this PR does / why we need it? line 408 already declared mc2_mask , remove duplicated unused code ### Does this PR introduce _any_ user-facing change? no ### How was this patch tested? CI passed with existing test. - vLLM version: v0.10.1.1 - vLLM main: vllm-project/vllm@60f0843 Signed-off-by: machenglong <machenglong_yewu@cmss.chinamobile.com> Signed-off-by: offline0806 <z00858301@china.huawei.com>
### What this PR does / why we need it? line 408 already declared mc2_mask , remove duplicated unused code ### Does this PR introduce _any_ user-facing change? no ### How was this patch tested? CI passed with existing test. - vLLM version: v0.10.1.1 - vLLM main: vllm-project/vllm@60f0843 Signed-off-by: machenglong <machenglong_yewu@cmss.chinamobile.com>
### What this PR does / why we need it? line 408 already declared mc2_mask , remove duplicated unused code ### Does this PR introduce _any_ user-facing change? no ### How was this patch tested? CI passed with existing test. - vLLM version: v0.10.1.1 - vLLM main: vllm-project/vllm@60f0843 Signed-off-by: machenglong <machenglong_yewu@cmss.chinamobile.com>
### What this PR does / why we need it? line 408 already declared mc2_mask , remove duplicated unused code ### Does this PR introduce _any_ user-facing change? no ### How was this patch tested? CI passed with existing test. - vLLM version: v0.10.1.1 - vLLM main: vllm-project/vllm@60f0843 Signed-off-by: machenglong <machenglong_yewu@cmss.chinamobile.com>
What this PR does / why we need it?
line 408 already declared mc2_mask , remove duplicated unused code
Does this PR introduce any user-facing change?
no
How was this patch tested?
CI passed with existing test.