[Kernel] port sgl moe_align_block_size kernels (#12574)
sgl_moe_align_block_size is based on: https://github.com/sgl-project/sglang/commit/ded9fcd09a43d5e7d5bb31a2bc3e9fc21bf65d2a moe_align_block_size is based on: https://github.com/sgl-project/sglang/commit/ba5112ff691d791a9e38c6c71f59324a5fcb49d0 Signed-off-by: Yang Chen <yangche@fb.com>
This commit is contained in:
@@ -952,6 +952,15 @@ def moe_align_block_size(topk_ids: torch.Tensor, num_experts: int,
|
||||
num_tokens_post_pad)
|
||||
|
||||
|
||||
def sgl_moe_align_block_size(topk_ids: torch.Tensor, num_experts: int,
|
||||
block_size: int, sorted_token_ids: torch.Tensor,
|
||||
experts_ids: torch.Tensor,
|
||||
num_tokens_post_pad: torch.Tensor) -> None:
|
||||
torch.ops._moe_C.sgl_moe_align_block_size(topk_ids, num_experts,
|
||||
block_size, sorted_token_ids,
|
||||
experts_ids, num_tokens_post_pad)
|
||||
|
||||
|
||||
def topk_softmax(topk_weights: torch.Tensor, topk_ids: torch.Tensor,
|
||||
token_expert_indicies: torch.Tensor,
|
||||
gating_output: float) -> None:
|
||||
|
||||
Reference in New Issue
Block a user