File tree 2 files changed +3
-18
lines changed
2 files changed +3
-18
lines changed Original file line number Diff line number Diff line change 22
22
from vllm .model_executor .layers .rotary_embedding import (
23
23
DeepseekScalingRotaryEmbedding , RotaryEmbedding )
24
24
25
- from vllm_ascend .platform import CUSTOM_OP_ENABLED
25
+ from vllm_ascend .utils import try_register_lib
26
26
27
27
28
28
def custom_rotary_embedding_enabled (query , neox_style , head_size ):
29
- return query .dtype == torch .float16 and neox_style and head_size % 32 == 0 and CUSTOM_OP_ENABLED
29
+ try_register_lib ("vllm_ascend.vllm_ascend_C" )
30
+ return query .dtype == torch .float16 and neox_style and head_size % 32 == 0
30
31
31
32
32
33
def rope_forward_oot (
Original file line number Diff line number Diff line change 15
15
# This file is a part of the vllm-ascend project.
16
16
#
17
17
18
- import logging
19
- import os
20
18
from typing import TYPE_CHECKING , Optional , Tuple
21
19
22
20
import torch
27
25
28
26
from vllm_ascend .utils import update_aclgraph_sizes
29
27
30
- CUSTOM_OP_ENABLED = False
31
- try :
32
- # register custom ops into torch_library here
33
- import vllm_ascend .vllm_ascend_C # type: ignore # noqa: F401
34
-
35
- except ImportError :
36
- logging .warning (
37
- "Warning: Failed to register custom ops, all custom ops will be disabled"
38
- )
39
- else :
40
- CUSTOM_OP_ENABLED = True
41
-
42
28
if TYPE_CHECKING :
43
29
from vllm .config import ModelConfig , VllmConfig
44
30
from vllm .utils import FlexibleArgumentParser
47
33
VllmConfig = None
48
34
FlexibleArgumentParser = None
49
35
50
- os .environ ["RAY_EXPERIMENTAL_NOSET_ASCEND_RT_VISIBLE_DEVICES" ] = "1"
51
-
52
36
53
37
class NPUPlatform (Platform ):
54
38
You can’t perform that action at this time.
0 commit comments