From 6664a4e5cec2db5c69b7610a48113c40bfc8b042 Mon Sep 17 00:00:00 2001 From: wangxiyuan Date: Sat, 29 Nov 2025 17:42:16 +0800 Subject: [PATCH] improve soc version (#4522) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make SOC_VERSION be readable for users. Now users can set simply "910b"、“910c”、“310p” - vLLM version: v0.11.2 - vLLM main: https://github.com/vllm-project/vllm/commit/v0.11.2 Signed-off-by: wangxiyuan --- .github/Dockerfile.buildwheel | 2 +- .github/workflows/image_310p_openeuler.yml | 1 - .github/workflows/image_310p_ubuntu.yml | 1 - .github/workflows/image_a3_openeuler.yml | 1 - .github/workflows/image_a3_ubuntu.yml | 1 - .github/workflows/image_openeuler.yml | 1 - .github/workflows/image_ubuntu.yml | 1 - .github/workflows/release_whl.yml | 1 - .github/workflows/vllm_ascend_test_310p.yaml | 1 - Dockerfile | 2 +- Dockerfile.310p | 2 +- Dockerfile.310p.openEuler | 2 +- Dockerfile.a3 | 2 +- Dockerfile.a3.openEuler | 2 +- Dockerfile.openEuler | 2 +- setup.py | 12 +++++++++++- 16 files changed, 18 insertions(+), 16 deletions(-) diff --git a/.github/Dockerfile.buildwheel b/.github/Dockerfile.buildwheel index abfd3b8d..3374e8b9 100644 --- a/.github/Dockerfile.buildwheel +++ b/.github/Dockerfile.buildwheel @@ -18,7 +18,7 @@ ARG PY_VERSION=3.11 FROM quay.io/ascend/manylinux:8.3.rc2-910b-manylinux_2_28-py${PY_VERSION} ARG COMPILE_CUSTOM_KERNELS=1 -ARG SOC_VERSION +ARG SOC_VERSION="ascend910b1" # Define environments ENV DEBIAN_FRONTEND=noninteractive diff --git a/.github/workflows/image_310p_openeuler.yml b/.github/workflows/image_310p_openeuler.yml index 5a34889c..b033cb47 100644 --- a/.github/workflows/image_310p_openeuler.yml +++ b/.github/workflows/image_310p_openeuler.yml @@ -132,5 +132,4 @@ jobs: file: Dockerfile.310p.openEuler build-args: | PIP_INDEX_URL=https://pypi.org/simple - SOC_VERSION=ascend310p1 provenance: false diff --git a/.github/workflows/image_310p_ubuntu.yml b/.github/workflows/image_310p_ubuntu.yml index 56aafcf8..ddac1c1f 100644 --- a/.github/workflows/image_310p_ubuntu.yml +++ b/.github/workflows/image_310p_ubuntu.yml @@ -128,5 +128,4 @@ jobs: tags: ${{ steps.meta.outputs.tags }} build-args: | PIP_INDEX_URL=https://pypi.org/simple - SOC_VERSION=ascend310p1 provenance: false \ No newline at end of file diff --git a/.github/workflows/image_a3_openeuler.yml b/.github/workflows/image_a3_openeuler.yml index b1c57727..6524c9e0 100644 --- a/.github/workflows/image_a3_openeuler.yml +++ b/.github/workflows/image_a3_openeuler.yml @@ -131,6 +131,5 @@ jobs: file: Dockerfile.a3.openEuler build-args: | PIP_INDEX_URL=https://pypi.org/simple - SOC_VERSION=ascend910_9391 provenance: false diff --git a/.github/workflows/image_a3_ubuntu.yml b/.github/workflows/image_a3_ubuntu.yml index 473df8e5..baaab8da 100644 --- a/.github/workflows/image_a3_ubuntu.yml +++ b/.github/workflows/image_a3_ubuntu.yml @@ -127,6 +127,5 @@ jobs: tags: ${{ steps.meta.outputs.tags }} build-args: | PIP_INDEX_URL=https://pypi.org/simple - SOC_VERSION=ascend910_9391 provenance: false diff --git a/.github/workflows/image_openeuler.yml b/.github/workflows/image_openeuler.yml index 29ccb848..ead1467d 100644 --- a/.github/workflows/image_openeuler.yml +++ b/.github/workflows/image_openeuler.yml @@ -131,5 +131,4 @@ jobs: file: Dockerfile.openEuler build-args: | PIP_INDEX_URL=https://pypi.org/simple - SOC_VERSION=ascend910b1 provenance: false diff --git a/.github/workflows/image_ubuntu.yml b/.github/workflows/image_ubuntu.yml index ab321304..15960137 100644 --- a/.github/workflows/image_ubuntu.yml +++ b/.github/workflows/image_ubuntu.yml @@ -128,5 +128,4 @@ jobs: tags: ${{ steps.meta.outputs.tags }} build-args: | PIP_INDEX_URL=https://pypi.org/simple - SOC_VERSION=ascend910b1 provenance: false diff --git a/.github/workflows/release_whl.yml b/.github/workflows/release_whl.yml index b095e696..e23bdad7 100644 --- a/.github/workflows/release_whl.yml +++ b/.github/workflows/release_whl.yml @@ -69,7 +69,6 @@ jobs: ls docker build -f ./.github/Dockerfile.buildwheel \ --build-arg PY_VERSION=${{ matrix.python-version }} \ - --build-arg SOC_VERSION=ascend910b1 \ -t wheel:v1 . docker run --rm \ -u $(id -u):$(id -g) \ diff --git a/.github/workflows/vllm_ascend_test_310p.yaml b/.github/workflows/vllm_ascend_test_310p.yaml index 9e14ddfb..d2a0ff0e 100644 --- a/.github/workflows/vllm_ascend_test_310p.yaml +++ b/.github/workflows/vllm_ascend_test_310p.yaml @@ -100,7 +100,6 @@ jobs: run: | export PIP_EXTRA_INDEX_URL=https://mirrors.huaweicloud.com/ascend/repos/pypi export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/Ascend/ascend-toolkit/latest/x86_64-linux/devlib - export SOC_VERSION=ASCEND310P3 pip install -r requirements-dev.txt pip install -v -e . diff --git a/Dockerfile b/Dockerfile index cc5605ee..2ac67a4b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,7 @@ FROM quay.io/ascend/cann:8.3.rc2-910b-ubuntu22.04-py3.11 ARG PIP_INDEX_URL="https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" ARG COMPILE_CUSTOM_KERNELS=1 ARG MOONCAKE_TAG="v0.3.7.post2" -ARG SOC_VERSION +ARG SOC_VERSION="ascend910b1" # Define environments ENV DEBIAN_FRONTEND=noninteractive diff --git a/Dockerfile.310p b/Dockerfile.310p index 9d203263..8063c8b1 100644 --- a/Dockerfile.310p +++ b/Dockerfile.310p @@ -19,7 +19,7 @@ FROM quay.io/ascend/cann:8.3.rc2-310p-ubuntu22.04-py3.11 ARG PIP_INDEX_URL="https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" ARG COMPILE_CUSTOM_KERNELS=1 -ARG SOC_VERSION +ARG SOC_VERSION="ascend310p1" # Define environments ENV DEBIAN_FRONTEND=noninteractive diff --git a/Dockerfile.310p.openEuler b/Dockerfile.310p.openEuler index 659a56c6..866ae19f 100644 --- a/Dockerfile.310p.openEuler +++ b/Dockerfile.310p.openEuler @@ -19,7 +19,7 @@ FROM quay.io/ascend/cann:8.3.rc2-310p-openeuler24.03-py3.11 ARG PIP_INDEX_URL="https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" ARG COMPILE_CUSTOM_KERNELS=1 -ARG SOC_VERSION +ARG SOC_VERSION="ascend310p1" ENV COMPILE_CUSTOM_KERNELS=${COMPILE_CUSTOM_KERNELS} ENV SOC_VERSION=$SOC_VERSION diff --git a/Dockerfile.a3 b/Dockerfile.a3 index de6f1a5a..dbd83994 100644 --- a/Dockerfile.a3 +++ b/Dockerfile.a3 @@ -20,7 +20,7 @@ FROM quay.io/ascend/cann:8.3.rc2-a3-ubuntu22.04-py3.11 ARG PIP_INDEX_URL="https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" ARG COMPILE_CUSTOM_KERNELS=1 ARG MOONCAKE_TAG=v0.3.7.post2 -ARG SOC_VERSION +ARG SOC_VERSION="ascend910_9391" COPY . /vllm-workspace/vllm-ascend/ # Define environments diff --git a/Dockerfile.a3.openEuler b/Dockerfile.a3.openEuler index 7761f341..d287dc4d 100644 --- a/Dockerfile.a3.openEuler +++ b/Dockerfile.a3.openEuler @@ -20,7 +20,7 @@ FROM quay.io/ascend/cann:8.3.rc2-a3-openeuler24.03-py3.11 ARG PIP_INDEX_URL="https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" ARG COMPILE_CUSTOM_KERNELS=1 ARG MOONCAKE_TAG="v0.3.7.post2" -ARG SOC_VERSION +ARG SOC_VERSION="ascend910_9391" ENV COMPILE_CUSTOM_KERNELS=${COMPILE_CUSTOM_KERNELS} ENV SOC_VERSION=$SOC_VERSION diff --git a/Dockerfile.openEuler b/Dockerfile.openEuler index 9666dee4..c1bd0362 100644 --- a/Dockerfile.openEuler +++ b/Dockerfile.openEuler @@ -20,7 +20,7 @@ FROM quay.io/ascend/cann:8.3.rc2-910b-openeuler24.03-py3.11 ARG PIP_INDEX_URL="https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple" ARG COMPILE_CUSTOM_KERNELS=1 ARG MOONCAKE_TAG="v0.3.7.post2" -ARG SOC_VERSION +ARG SOC_VERSION="ascend910b1" ENV COMPILE_CUSTOM_KERNELS=${COMPILE_CUSTOM_KERNELS} ENV SOC_VERSION=$SOC_VERSION diff --git a/setup.py b/setup.py index 1bf80081..3e88affa 100644 --- a/setup.py +++ b/setup.py @@ -137,6 +137,9 @@ def gen_build_info(): # TODO(zzzzwwjj): Add A5 case soc_to_device = { + "910b": "_910B", + "910c": "_910_93", + "310p": "_310P", "ascend910b1": "_910B", "ascend910b2": "_910B", "ascend910b2c": "_910B", @@ -307,7 +310,14 @@ class cmake_build_ext(build_ext): cmake_args += [f"-DCMAKE_PREFIX_PATH={pybind11_cmake_path}"] - cmake_args += [f"-DSOC_VERSION={envs.SOC_VERSION}"] + soc_version_map = { + "910b": "ascend910b1", + "910c": "ascend910_9392", + "310p": "ascend310p1", + } + CANN_SOC_VERSION = soc_version_map.get(envs.SOC_VERSION, + envs.SOC_VERSION) + cmake_args += [f"-DSOC_VERSION={CANN_SOC_VERSION}"] # Override the base directory for FetchContent downloads to $ROOT/.deps # This allows sharing dependencies between profiles,