support qwen2 running on ascend npu device (#7022)

Co-authored-by: 刁莹煜 <diaoyingyu1@hisilicon.com>
This commit is contained in:
Yijie Zhu
2025-06-18 02:24:10 +08:00
committed by GitHub
parent 10d60cd41b
commit a39d928782
9 changed files with 63 additions and 16 deletions

View File

@@ -4,7 +4,7 @@ from typing import List, Tuple
import torch
from sglang.srt.utils import get_bool_env_var, is_hip, is_hpu
from sglang.srt.utils import get_bool_env_var, is_hip, is_hpu, is_npu
logger = logging.getLogger(__name__)
use_vllm_custom_allreduce = get_bool_env_var(
@@ -25,7 +25,7 @@ if not is_hpu():
logger.warning("Failed to import from custom_ar with %r", e)
if not is_hip():
if not is_hip() and not is_npu():
if use_vllm_custom_allreduce:
custom_op = torch.ops._C_custom_ar
else: