Skip to content

Commit f10251e

Browse files
authored
[Platform] Add import_kernels interface (#3694)
### What this PR does / why we need it? Add import_kernels interface to avoid import useless vLLM C library Closes #3488. Reopen #3498 for CI. ### How was this patch tested? CI tested. - vLLM version: v0.11.0 - vLLM main: vllm-project/vllm@2918c1b --------- Signed-off-by: gcanlin <[email protected]>
1 parent 094f32c commit f10251e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

vllm_ascend/platform.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,17 @@ def check_and_update_config(cls, vllm_config: VllmConfig) -> None:
370370
"needs to be equal if use cp or dcp > 1 in P/D disaggregate scenario."
371371
)
372372

373+
@classmethod
374+
def import_kernels(cls) -> None:
375+
# Directly importing vllm_ascend_C prevents ASCEND_RT_VISIBLE_DEVICES
376+
# from being applied during runtime initialization, which causes bugs
377+
# in the RL module. Therefore, we currently use lazy initialization
378+
# to avoid this issue. See https://github.com/vllm-project/vllm-ascend/pull/884.
379+
# TODO: when the above issue is fixed, we can uncomment the following lines.
380+
# from vllm_ascend.utils import enable_custom_op
381+
# enable_custom_op()
382+
pass
383+
373384
@classmethod
374385
def get_attn_backend_cls(
375386
cls,

0 commit comments

Comments
 (0)