diff --git a/.github/workflows/pr-test-npu.yml b/.github/workflows/pr-test-npu.yml index 196e88376..6d91dfde4 100644 --- a/.github/workflows/pr-test-npu.yml +++ b/.github/workflows/pr-test-npu.yml @@ -291,7 +291,7 @@ jobs: pip config set global.index-url http://${CACHING_URL}/pypi/simple pip config set global.trusted-host "${CACHING_URL}" - bash scripts/ci/npu/npu_ci_install_dependency.sh a3 + bash scripts/ci/npu/npu_ci_install_dependency.sh a3 diffusion # copy required file from our daily cache cp ~/.cache/modelscope/hub/datasets/otavia/ShareGPT_Vicuna_unfiltered/ShareGPT_V3_unfiltered_cleaned_split.json /tmp # copy download through proxy @@ -333,7 +333,7 @@ jobs: pip config set global.index-url http://${CACHING_URL}/pypi/simple pip config set global.trusted-host "${CACHING_URL}" - bash scripts/ci/npu/npu_ci_install_dependency.sh a3 + bash scripts/ci/npu/npu_ci_install_dependency.sh a3 diffusion # copy required file from our daily cache cp ~/.cache/modelscope/hub/datasets/otavia/ShareGPT_Vicuna_unfiltered/ShareGPT_V3_unfiltered_cleaned_split.json /tmp # copy download through proxy @@ -372,7 +372,7 @@ jobs: pip config set global.extra-index-url "https://pypi.tuna.tsinghua.edu.cn/simple" pip config set global.trusted-host "${CACHING_URL} pypi.tuna.tsinghua.edu.cn" - bash scripts/ci/npu/npu_ci_install_dependency.sh a3 + bash scripts/ci/npu/npu_ci_install_dependency.sh a3 diffusion # copy required file from our daily cache cp ~/.cache/modelscope/hub/datasets/otavia/ShareGPT_Vicuna_unfiltered/ShareGPT_V3_unfiltered_cleaned_split.json /tmp # copy download through proxy diff --git a/scripts/ci/npu/npu_ci_install_dependency.sh b/scripts/ci/npu/npu_ci_install_dependency.sh index 8a8f44da0..643b116ce 100755 --- a/scripts/ci/npu/npu_ci_install_dependency.sh +++ b/scripts/ci/npu/npu_ci_install_dependency.sh @@ -3,6 +3,7 @@ set -euo pipefail PIP_INSTALL="python3 -m pip install --no-cache-dir" DEVICE_TYPE=$1 +OPTIONAL_DEPS="${2:-}" # Install the required dependencies in CI. @@ -32,11 +33,19 @@ ${PIP_INSTALL} memfabric-hybrid==1.0.5 ### Install PyTorch and PTA -PYTORCH_VERSION="2.8.0" -TORCHVISION_VERSION="0.23.0" -${PIP_INSTALL} torch==${PYTORCH_VERSION} torchvision==${TORCHVISION_VERSION} --index-url ${TORCH_CACHE_URL:="https://download.pytorch.org/whl/cpu"} --extra-index-url ${PYPI_CACHE_URL:="https://pypi.org/simple/"} -PTA_URL="https://gitcode.com/Ascend/pytorch/releases/download/v7.3.0-pytorch2.8.0/torch_npu-2.8.0.post2-cp311-cp311-manylinux_2_28_aarch64.whl" -${PIP_INSTALL} ${PTA_URL} +if [ -n "$OPTIONAL_DEPS" ]; then + PYTORCH_VERSION="2.10.0" + TORCHVISION_VERSION="0.25.0" + ${PIP_INSTALL} torch==${PYTORCH_VERSION} torchvision==${TORCHVISION_VERSION} --index-url ${TORCH_CACHE_URL:="https://download.pytorch.org/whl/cpu"} --extra-index-url ${PYPI_CACHE_URL:="https://pypi.org/simple/"} + PTA_URL="https://gitcode.com/Ascend/pytorch/releases/download/7.3.0.alpha002/torch_npu-2.10.0rc2-cp311-cp311-manylinux_2_28_aarch64.whl" + ${PIP_INSTALL} ${PTA_URL} +else + PYTORCH_VERSION="2.8.0" + TORCHVISION_VERSION="0.23.0" + ${PIP_INSTALL} torch==${PYTORCH_VERSION} torchvision==${TORCHVISION_VERSION} --index-url ${TORCH_CACHE_URL:="https://download.pytorch.org/whl/cpu"} --extra-index-url ${PYPI_CACHE_URL:="https://pypi.org/simple/"} + PTA_URL="https://gitcode.com/Ascend/pytorch/releases/download/v7.3.0-pytorch2.8.0/torch_npu-2.8.0.post2-cp311-cp311-manylinux_2_28_aarch64.whl" + ${PIP_INSTALL} ${PTA_URL} +fi ### Install Triton-Ascend