[NPU] custom-ops adapt (#30731)

This commit is contained in:
monkeyLoveding
2026-07-17 10:39:00 +08:00
committed by GitHub
parent 9910ef8167
commit 7355e0cb87
4 changed files with 28 additions and 3 deletions
+14 -1
View File
@@ -61,13 +61,26 @@ ${PIP_INSTALL} triton-ascend==3.2.1.dev20260530 --extra-index-url=https://mirror
### Install sgl-kernel-npu
SGLANG_KERNEL_NPU_TAG="2026.6.2"
SGLANG_KERNEL_NPU_TAG="2026.7.2"
mkdir sgl-kernel-npu
(cd sgl-kernel-npu && wget "${GITHUB_PROXY_URL:=""}https://github.com/sgl-project/sgl-kernel-npu/releases/download/${SGLANG_KERNEL_NPU_TAG}/sgl-kernel-npu-${SGLANG_KERNEL_NPU_TAG}-torch${PYTORCH_VERSION}-py311-cann9.0.0-${DEVICE_TYPE}-$(arch).zip" \
&& unzip ./sgl-kernel-npu-${SGLANG_KERNEL_NPU_TAG}-torch${PYTORCH_VERSION}-py311-cann9.0.0-${DEVICE_TYPE}-$(arch).zip \
&& ${UV_PIP_INSTALL} ./deep_ep*.whl ./sgl_kernel_npu*.whl \
&& (cd "$(python3 -m pip show deep-ep | grep -E '^Location:' | awk '{print $2}')" && ln -s deep_ep/deep_ep_cpp*.so))
### Install custom-ops
mkdir cann-custom-ops
(cd cann-custom-ops && \
wget "${GITHUB_PROXY_URL:=""}https://github.com/sgl-project/sgl-kernel-npu/releases/download/${SGLANG_KERNEL_NPU_TAG}/custom-ops-${SGLANG_KERNEL_NPU_TAG}-torch${PYTORCH_VERSION}-cann9.0.0-${DEVICE_TYPE}-$(arch).zip" && \
wget "${GITHUB_PROXY_URL:=""}https://github.com/sgl-project/sgl-kernel-npu/releases/download/${SGLANG_KERNEL_NPU_TAG}/ops-transformer-${SGLANG_KERNEL_NPU_TAG}-torch${PYTORCH_VERSION}-cann9.0.0-${DEVICE_TYPE}-$(arch).zip" && \
unzip custom-ops-${SGLANG_KERNEL_NPU_TAG}-torch${PYTORCH_VERSION}-cann9.0.0-${DEVICE_TYPE}-$(arch).zip && \
unzip ops-transformer-${SGLANG_KERNEL_NPU_TAG}-torch${PYTORCH_VERSION}-cann9.0.0-${DEVICE_TYPE}-$(arch).zip && \
chmod +x *.run && \
./CANN-custom_ops-none-linux.$(arch).run --install-path=/usr/local/Ascend/cann-9.0.0/opp && \
./cann-ops-transformer-custom_linux-$(arch).run --install-path=/usr/local/Ascend/cann-9.0.0/opp && \
${PIP_INSTALL} custom_ops-1.0-cp311-cp311-linux_$(arch).whl)
rm -rf cann-custom-ops
### Install SGLang
rm -rf python/pyproject.toml && mv python/pyproject_npu.toml python/pyproject.toml