[core] Support custom ascendc kernels in vllm-ascend (#233)

This PR add custom ascendc kernel rotary_embedding support in
vllm-ascend, related CMakeLists and setuptools is also added in this PR.

Related: https://github.com/vllm-project/vllm-ascend/issues/156

---------

Signed-off-by: ganyi <pleaplusone.gy@gmail.com>
This commit is contained in:
Pleaplusone
2025-04-03 14:52:34 +08:00
committed by GitHub
parent 14d9a64047
commit ce8259975e
15 changed files with 1378 additions and 9 deletions

View File

@@ -15,6 +15,7 @@
# limitations under the License.
#
import logging
import os
from typing import TYPE_CHECKING, Optional, Tuple
@@ -23,6 +24,19 @@ import torch_npu # noqa: F401
import vllm.envs as envs
from vllm.config import CompilationLevel
from vllm.logger import init_logger
try:
# register custom ops into torch_library here
import vllm_ascend.vllm_ascend_C # type: ignore # noqa: F401
except ImportError as e:
if not str(
e
) == "dynamic module does not define module export function (PyInit_vllm_ascend_C)":
logging.warning(
"Warning: Failed to register custom ops, all custom ops will be disabled"
)
from vllm.platforms import Platform, PlatformEnum
if TYPE_CHECKING: