-
Notifications
You must be signed in to change notification settings - Fork 442
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor fused_moe on ascend platform (#2613)
- Loading branch information
1 parent
c918669
commit 77be205
Showing
3 changed files
with
21 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright (c) OpenMMLab. All rights reserved. | ||
import dlinfer.ops as ext_ops | ||
from torch import Tensor | ||
|
||
|
||
def fused_moe( | ||
hidden_states: Tensor, | ||
top_k: int, | ||
topk_ids: Tensor, | ||
topk_weights: Tensor, | ||
gate_up_weights: Tensor, | ||
down_weights: Tensor, | ||
): | ||
"""ascend fused moe.""" | ||
return ext_ops.fused_moe(hidden_states, top_k, topk_ids, topk_weights, | ||
gate_up_weights, down_weights) |