[Kernel] Register punica ops directly (#10522)
Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
This commit is contained in:
@@ -9,6 +9,8 @@ import torch
|
||||
import triton
|
||||
import triton.language as tl
|
||||
|
||||
from vllm.utils import direct_register_custom_op
|
||||
|
||||
from .utils import get_lora_op_configs
|
||||
|
||||
|
||||
@@ -179,9 +181,26 @@ def _bgmv_expand_slice(
|
||||
return
|
||||
|
||||
|
||||
def bgmv_expand_slice_fake(
|
||||
inputs: torch.Tensor,
|
||||
lora_b_weights: torch.Tensor,
|
||||
output_tensor: torch.Tensor,
|
||||
lora_indices_tensor: torch.Tensor,
|
||||
slice_offset: int,
|
||||
slice_size: int,
|
||||
add_inputs: bool = True,
|
||||
) -> None:
|
||||
return
|
||||
|
||||
|
||||
try:
|
||||
bgmv_expand_slice = torch.library.custom_op("lora::bgmv_expand_slice",
|
||||
_bgmv_expand_slice,
|
||||
mutates_args=["output_tensor"])
|
||||
direct_register_custom_op(
|
||||
op_name="bgmv_expand_slice",
|
||||
op_func=_bgmv_expand_slice,
|
||||
mutates_args=["output_tensor"],
|
||||
fake_impl=bgmv_expand_slice_fake,
|
||||
)
|
||||
bgmv_expand_slice = torch.ops.vllm.bgmv_expand_slice
|
||||
|
||||
except AttributeError:
|
||||
bgmv_expand_slice = _bgmv_expand_slice
|
||||
|
||||
Reference in New Issue
Block a user