-
Notifications
You must be signed in to change notification settings - Fork 0
Add apply_router_weight_on_input to all FusedMoEMethodBase classes #5
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -202,6 +202,8 @@ def apply( | |
| custom_routing_function: Optional[Callable] = None, | ||
| scoring_func: str = "softmax", | ||
| e_score_correction_bias: Optional[torch.Tensor] = None, | ||
| apply_router_weight_on_input: bool = False, | ||
| activation: str = "silu", | ||
| ) -> torch.Tensor: | ||
| from vllm.model_executor.layers.fused_moe import fused_experts | ||
|
|
||
|
|
@@ -217,16 +219,18 @@ def apply( | |
| scoring_func=scoring_func, | ||
| e_score_correction_bias=e_score_correction_bias) | ||
|
|
||
| return fused_experts(x, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: this seems no need to change, the format previously is following vllm format style There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. formatted changed it because we are passing |
||
| layer.w13_weight, | ||
| layer.w2_weight, | ||
| topk_weights=topk_weights, | ||
| topk_ids=topk_ids, | ||
| inplace=True, | ||
| use_fp8_w8a8=True, | ||
| global_num_experts=global_num_experts, | ||
| expert_map=expert_map, | ||
| w1_scale=layer.w13_weight_scale, | ||
| w2_scale=layer.w2_weight_scale, | ||
| a1_scale=layer.w13_input_scale, | ||
| a2_scale=layer.w2_input_scale) | ||
| return fused_experts( | ||
| x, | ||
| layer.w13_weight, | ||
| layer.w2_weight, | ||
| topk_weights=topk_weights, | ||
| topk_ids=topk_ids, | ||
| inplace=True, | ||
| use_fp8_w8a8=True, | ||
| global_num_experts=global_num_experts, | ||
| apply_router_weight_on_input=apply_router_weight_on_input, | ||
| expert_map=expert_map, | ||
| w1_scale=layer.w13_weight_scale, | ||
| w2_scale=layer.w2_weight_scale, | ||
| a1_scale=layer.w13_input_scale, | ||
| a2_scale=layer.w2_input_scale) | ||
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 should be above "activation", if you run "pre-commit run --show-diff-on-failure --color=always --all-files --hook-stage manual" there would be a failure that it does not compatible with the base signature