diff --git a/.buildkite/hardware_tests/ascend_npu.yaml b/.buildkite/hardware_tests/ascend_npu.yaml index 0f693bd819..c694e740d7 100644 --- a/.buildkite/hardware_tests/ascend_npu.yaml +++ b/.buildkite/hardware_tests/ascend_npu.yaml @@ -4,8 +4,101 @@ steps: - label: "Ascend NPU Test" key: ascend-npu-test soft_fail: true - timeout_in_minutes: 20 no_plugin: true device: ascend_npu + source_file_dependencies: + - vllm/ + - .buildkite/scripts/hardware_ci/run-npu-test.sh + - "!vllm/platforms/cuda.py" + - "!vllm/platforms/xpu.py" + - "!vllm/platforms/tpu.py" + - "!vllm/platforms/cpu.py" + - "!vllm/platforms/zen_cpu.py" + - "!vllm/cute_utils/" + - "!vllm/tilelang_utils/" + - "!vllm/device_allocator/" + - "!vllm/vllm_flash_attn/" + - "!vllm/kernels/" + - "!vllm/model_executor/kernels/" + - "!vllm/engine/" + - "!vllm/entrypoints/" + - "!vllm/ray/" + - "!vllm/v1/attention/backends/flash_attn.py" + - "!vllm/v1/attention/backends/flash_attn_diffkv.py" + - "!vllm/v1/attention/backends/flashinfer.py" + - "!vllm/v1/attention/backends/triton_attn.py" + - "!vllm/v1/attention/backends/triton_attn_diffkv.py" + - "!vllm/v1/attention/backends/rocm_attn.py" + - "!vllm/v1/attention/backends/rocm_aiter_fa.py" + - "!vllm/v1/attention/backends/rocm_aiter_unified_attn.py" + - "!vllm/v1/attention/backends/flex_attention.py" + - "!vllm/v1/attention/backends/hpc_attn.py" + - "!vllm/v1/attention/backends/mamba1_attn.py" + - "!vllm/v1/attention/backends/mamba2_attn.py" + - "!vllm/v1/attention/backends/mamba_attn.py" + - "!vllm/v1/attention/backends/short_conv_attn.py" + - "!vllm/v1/attention/backends/turboquant_attn.py" + - "!vllm/v1/attention/backends/cpu_attn.py" + - "!vllm/v1/attention/backends/fa_utils.py" + - "!vllm/distributed/device_communicators/pynccl.py" + - "!vllm/distributed/device_communicators/pynccl_wrapper.py" + - "!vllm/distributed/device_communicators/pynccl_allocator.py" + - "!vllm/distributed/device_communicators/xpu_communicator.py" + - "!vllm/distributed/device_communicators/cpu_communicator.py" + - "!vllm/distributed/device_communicators/cuda_wrapper.py" + - "!vllm/distributed/device_communicators/flashinfer_all_reduce.py" + - "!vllm/distributed/device_communicators/aiter_custom_all_reduce.py" + - "!vllm/distributed/device_communicators/custom_all_reduce.py" + - "!vllm/distributed/device_communicators/quick_all_reduce.py" + - "!vllm/distributed/device_communicators/all2all.py" + - "!vllm/distributed/device_communicators/all_reduce_utils.py" + - "!vllm/distributed/device_communicators/shm_object_storage.py" + - "!vllm/distributed/device_communicators/symm_mem.py" + - "!vllm/distributed/device_communicators/mnnvl_compat.py" + - "!vllm/distributed/device_communicators/ray_communicator.py" + - "!vllm/third_party/flashmla/" + - "!vllm/third_party/pynvml.py" + - "!vllm/_custom_ops.py" + - "!vllm/_xpu_ops.py" + - "!vllm/_aiter_ops" + - "!vllm/collect_env.py" + - "!vllm/connections.py" + - "!vllm/env_override.py" + - "!vllm/logits_process.py" + - "!vllm/logprobs.py" + - "!vllm/model_inspection.py" + - "!vllm/outputs.py" + - "!vllm/scalar_type.py" + - "!vllm/scripts.py" + - "!vllm/version.py" + - "!vllm/assets/" + - "!vllm/benchmarks/" + - "!vllm/inputs/" + - "!vllm/ir/" + - "!vllm/parser/" + - "!vllm/plugins/" + - "!vllm/reasoning/" + - "!vllm/renderers/" + - "!vllm/tokenizers/" + - "!vllm/tool_parsers/" + - "!vllm/tracing/" + - "!vllm/usage/" + - "!tests/" + - "!benchmarks/" + - "!docs/" + - "!examples/" + - "!scripts/" + - "!vllm/model_executor/layers/quantization/auto_awq.py" + - "!vllm/model_executor/layers/quantization/auto_gptq.py" + - "!vllm/model_executor/layers/quantization/inc/" + - "!vllm/model_executor/layers/quantization/awq_triton.py" + - "!vllm/model_executor/layers/quantization/experts_int8.py" + - "!vllm/model_executor/layers/quantization/fbgemm_fp8.py" + - "!vllm/model_executor/layers/quantization/fp_quant.py" + - "!vllm/model_executor/layers/quantization/humming.py" + - "!vllm/model_executor/layers/quantization/moe_wna16.py" + - "!vllm/model_executor/layers/quantization/qutlass_utils.py" + - "!vllm/model_executor/layers/quantization/quark/" + - "!vllm/model_executor/layers/quantization/turboquant/" commands: - bash .buildkite/scripts/hardware_ci/run-npu-test.sh diff --git a/.buildkite/scripts/hardware_ci/run-npu-test.sh b/.buildkite/scripts/hardware_ci/run-npu-test.sh index b925b74c4c..aafc87a0bf 100644 --- a/.buildkite/scripts/hardware_ci/run-npu-test.sh +++ b/.buildkite/scripts/hardware_ci/run-npu-test.sh @@ -76,30 +76,35 @@ FROM ${BASE_IMAGE_NAME} ENV DEBIAN_FRONTEND=noninteractive ENV SOC_VERSION="ascend910b1" -RUN pip config set global.index-url http://cache-service-vllm.nginx-pypi-cache.svc.cluster.local:${PYPI_CACHE_PORT}/pypi/simple && \ - pip config set global.trusted-host cache-service-vllm.nginx-pypi-cache.svc.cluster.local && \ - apt-get update -y && \ +# Install uv and configure uv to use internal PyPI mirror +RUN curl -LsSf https://astral.sh/uv/install.sh | sh +ENV PATH="/root/.local/bin:$PATH" +ENV UV_SYSTEM_PYTHON=true +ENV UV_INDEX_URL="http://cache-service-vllm.nginx-pypi-cache.svc.cluster.local:${PYPI_CACHE_PORT}/pypi/simple" +ENV UV_EXTRA_INDEX_URL="https://mirrors.huaweicloud.com/ascend/repos/pypi" + +RUN apt-get update -y && \ apt-get install -y python3-pip git vim wget net-tools gcc g++ cmake libnuma-dev && \ rm -rf /var/cache/apt/* && \ rm -rf /var/lib/apt/lists/* # Install for pytest to make the docker build cache layer always valid -RUN --mount=type=cache,target=/root/.cache/pip \ - pip install pytest>=6.0 'modelscope<1.38' +RUN --mount=type=cache,target=/root/.cache/uv \ + uv pip install pytest>=6.0 'modelscope<1.38' --quiet WORKDIR /workspace/vllm # Install vLLM dependencies in advance. Effect: As long as common.txt remains unchanged, the docker cache layer will be valid. COPY requirements/common.txt /workspace/vllm/requirements/common.txt RUN --mount=type=cache,target=/root/.cache/pip \ - pip install -r requirements/common.txt + uv pip install -r requirements/common.txt --quiet COPY . . # Install vLLM -RUN --mount=type=cache,target=/root/.cache/pip \ - VLLM_TARGET_DEVICE="empty" python3 -m pip install -v -e /workspace/vllm/ --extra-index https://download.pytorch.org/whl/cpu/ && \ - python3 -m pip uninstall -y triton +RUN --mount=type=cache,target=/root/.cache/uv \ + VLLM_TARGET_DEVICE="empty" uv pip install -e /workspace/vllm/ --extra-index-url https://download.pytorch.org/whl/cpu/ --quiet --index-strategy unsafe-best-match && \ + uv pip uninstall -y triton --quiet # Install vllm-ascend WORKDIR /workspace @@ -109,15 +114,14 @@ RUN git config --global url."https://gh-proxy.test.osinfra.cn/https://github.com git clone --depth 1 \$VLLM_ASCEND_REPO --branch \$VLLM_ASCEND_TAG /workspace/vllm-ascend # Install vllm dependencies in advance. Effect: As long as common.txt remains unchanged, the docker cache layer will be valid. -RUN --mount=type=cache,target=/root/.cache/pip \ - pip install -r /workspace/vllm-ascend/requirements.txt +RUN --mount=type=cache,target=/root/.cache/uv \ + uv pip install -r /workspace/vllm-ascend/requirements.txt --extra-index-url https://mirrors.huaweicloud.com/ascend/repos/pypi --quiet --index-strategy unsafe-best-match -RUN --mount=type=cache,target=/root/.cache/pip \ - export PIP_EXTRA_INDEX_URL=https://mirrors.huaweicloud.com/ascend/repos/pypi && \ +RUN --mount=type=cache,target=/root/.cache/uv \ source /usr/local/Ascend/ascend-toolkit/set_env.sh && \ source /usr/local/Ascend/nnal/atb/set_env.sh && \ export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/usr/local/Ascend/ascend-toolkit/latest/$(uname -i)-linux/devlib && \ - python3 -m pip install -v -e /workspace/vllm-ascend/ --extra-index https://download.pytorch.org/whl/cpu/ + uv pip install -e /workspace/vllm-ascend/ --extra-index-url https://download.pytorch.org/whl/cpu/ --extra-index-url https://mirrors.huaweicloud.com/ascend/repos/pypi --quiet --index-strategy unsafe-best-match ENV VLLM_WORKER_MULTIPROC_METHOD=spawn ENV VLLM_USE_MODELSCOPE=True