[Kernel] Add gpt-oss Router GEMM kernel (#37205)
Signed-off-by: Xin Yang <xyangx@amazon.com>
This commit is contained in:
@@ -2362,6 +2362,19 @@ def dsv3_router_gemm(
|
||||
return output
|
||||
|
||||
|
||||
def gpt_oss_router_gemm(
|
||||
hidden_states: torch.Tensor, weight: torch.Tensor, bias: torch.Tensor
|
||||
) -> torch.Tensor:
|
||||
output = torch.empty(
|
||||
hidden_states.shape[0],
|
||||
weight.shape[0],
|
||||
device=hidden_states.device,
|
||||
dtype=hidden_states.dtype,
|
||||
)
|
||||
torch.ops._moe_C.gpt_oss_router_gemm(output, hidden_states, weight, bias)
|
||||
return output
|
||||
|
||||
|
||||
def topk_softmax(
|
||||
topk_weights: torch.Tensor,
|
||||
topk_ids: torch.Tensor,
|
||||
|
||||
Reference in New Issue
Block a user