under test, not sure no errors
This commit is contained in:
29
ixformer_sdk/contrib/flashinfer/activation.py
Normal file
29
ixformer_sdk/contrib/flashinfer/activation.py
Normal file
@@ -0,0 +1,29 @@
|
||||
import ixformer.inference.functions as ops
|
||||
import torch
|
||||
|
||||
|
||||
def gelu_and_mul():
|
||||
pass
|
||||
|
||||
|
||||
def gelu_tanh_and_mul():
|
||||
pass
|
||||
|
||||
|
||||
def silu_and_mul(input: torch.Tensor, out: torch.Tensor = None) -> torch.Tensor:
|
||||
r"""Fused SiLU and Mul operation.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
input: torch.Tensor
|
||||
Input tensor, shape (..., 2 * hidden_size).
|
||||
|
||||
out: Optional[torch.Tensor]
|
||||
The the output tensor, if specified, the kernel will update this tensor inplace.
|
||||
|
||||
Returns
|
||||
-------
|
||||
output: torch.Tensor
|
||||
Output tensor, shape (..., hidden_size).
|
||||
"""
|
||||
return ops.silu_and_mul(input=input, output=out)
|
||||
Reference in New Issue
Block a user