feat: update torch 2.5.1 (#2069)

This commit is contained in:
Yineng Zhang
2024-11-18 21:29:13 +08:00
committed by GitHub
parent 2a3992b6f1
commit 766192610e
10 changed files with 127 additions and 33 deletions

View File

@@ -32,12 +32,14 @@ from vllm.distributed import (
)
from vllm.model_executor.custom_op import CustomOp
from sglang.srt.layers.custom_op_util import register_custom_op
from sglang.srt.layers.quantization.base_config import QuantizationConfig
from sglang.srt.utils import set_weight_attrs
logger = logging.getLogger(__name__)
@register_custom_op("sglang_silu_and_mul")
class SiluAndMul(CustomOp):
def forward_native(self, x: torch.Tensor) -> torch.Tensor:
d = x.shape[-1] // 2
@@ -51,6 +53,7 @@ class SiluAndMul(CustomOp):
return out
@register_custom_op("sglang_gelu_and_mul")
class GeluAndMul(CustomOp):
def __init__(self, approximate="tanh"):
super().__init__()