From 570b3536e74b25f438a636f51f4f6ac5368f6951 Mon Sep 17 00:00:00 2001 From: shen-shanshan <467638484@qq.com> Date: Tue, 27 Jan 2026 07:10:09 +0000 Subject: [PATCH 1/8] main2main Signed-off-by: shen-shanshan <467638484@qq.com> --- .github/workflows/bot_pr_create.yaml | 2 +- .github/workflows/dockerfiles/Dockerfile.lint | 2 +- .github/workflows/pr_test_full.yaml | 2 +- .github/workflows/pr_test_light.yaml | 6 +++--- .github/workflows/schedule_codecov_refresh.yaml | 2 +- docs/source/community/versioning_policy.md | 2 +- vllm_ascend/ops/mm_encoder_attention.py | 2 -- 7 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/bot_pr_create.yaml b/.github/workflows/bot_pr_create.yaml index 1dea09f844d..961b2361a5c 100644 --- a/.github/workflows/bot_pr_create.yaml +++ b/.github/workflows/bot_pr_create.yaml @@ -37,7 +37,7 @@ jobs: steps: - name: Get vLLM version run: | - VLLM_COMMIT=dc917cceb877dfd13f98c538c4c96158047d98bd + VLLM_COMMIT=cf1167e50b809f18efd21fb3418dd75d2805b14f echo "VLLM_COMMIT=https://github.com/vllm-project/vllm/commit/$VLLM_COMMIT" >> $GITHUB_ENV - name: Checkout repository diff --git a/.github/workflows/dockerfiles/Dockerfile.lint b/.github/workflows/dockerfiles/Dockerfile.lint index 9bb2a5b8aa5..1abfbbe08d0 100644 --- a/.github/workflows/dockerfiles/Dockerfile.lint +++ b/.github/workflows/dockerfiles/Dockerfile.lint @@ -27,7 +27,7 @@ RUN apt-get update -y && \ ARG VLLM_REPO=https://github.com/vllm-project/vllm.git # For lint purpose, actually we need make a main2main matching. -ARG VLLM_COMMIT=dc917cceb877dfd13f98c538c4c96158047d98bd +ARG VLLM_COMMIT=cf1167e50b809f18efd21fb3418dd75d2805b14f RUN git clone $VLLM_REPO /vllm-workspace/vllm && \ cd /vllm-workspace/vllm && \ git checkout $VLLM_COMMIT diff --git a/.github/workflows/pr_test_full.yaml b/.github/workflows/pr_test_full.yaml index 740d2cb1245..2d61361775d 100644 --- a/.github/workflows/pr_test_full.yaml +++ b/.github/workflows/pr_test_full.yaml @@ -75,7 +75,7 @@ jobs: name: e2e-full strategy: matrix: - vllm_version: [dc917cceb877dfd13f98c538c4c96158047d98bd, v0.14.1] + vllm_version: [cf1167e50b809f18efd21fb3418dd75d2805b14f, v0.14.1] needs: [changes] if: ${{ needs.changes.outputs.e2e_tracker == 'true' || needs.changes.outputs.e2e_tracker == true }} uses: ./.github/workflows/_e2e_test.yaml diff --git a/.github/workflows/pr_test_light.yaml b/.github/workflows/pr_test_light.yaml index a698639b277..ce34ba1d7af 100644 --- a/.github/workflows/pr_test_light.yaml +++ b/.github/workflows/pr_test_light.yaml @@ -41,7 +41,7 @@ jobs: lint: uses: ./.github/workflows/_pre_commit.yml with: - vllm: dc917cceb877dfd13f98c538c4c96158047d98bd + vllm: cf1167e50b809f18efd21fb3418dd75d2805b14f changes: runs-on: linux-aarch64-a2-0 outputs: @@ -87,7 +87,7 @@ jobs: if: ${{ needs.lint.result == 'success' && (needs.changes.outputs.e2e_tracker == 'true' || needs.changes.outputs.ut_tracker == 'true') }} strategy: matrix: - vllm_version: [dc917cceb877dfd13f98c538c4c96158047d98bd, v0.14.1] + vllm_version: [cf1167e50b809f18efd21fb3418dd75d2805b14f, v0.14.1] uses: ./.github/workflows/_unit_test.yaml with: vllm: ${{ matrix.vllm_version }} @@ -99,7 +99,7 @@ jobs: name: e2e-light strategy: matrix: - vllm_version: [dc917cceb877dfd13f98c538c4c96158047d98bd, v0.14.1] + vllm_version: [cf1167e50b809f18efd21fb3418dd75d2805b14f, v0.14.1] # Note (yikun): If CI resource are limited we can split job into two chain jobs needs: [lint, changes] # only trigger e2e test after lint passed and the change is e2e related with pull request. diff --git a/.github/workflows/schedule_codecov_refresh.yaml b/.github/workflows/schedule_codecov_refresh.yaml index 98f862918a3..af0c278dcb5 100644 --- a/.github/workflows/schedule_codecov_refresh.yaml +++ b/.github/workflows/schedule_codecov_refresh.yaml @@ -33,7 +33,7 @@ jobs: name: refresh codecov strategy: matrix: - vllm_version: [dc917cceb877dfd13f98c538c4c96158047d98bd] + vllm_version: [cf1167e50b809f18efd21fb3418dd75d2805b14f] uses: ./.github/workflows/_unit_test.yaml with: vllm: ${{ matrix.vllm_version }} diff --git a/docs/source/community/versioning_policy.md b/docs/source/community/versioning_policy.md index 801c8a2a08c..33f7ba5456b 100644 --- a/docs/source/community/versioning_policy.md +++ b/docs/source/community/versioning_policy.md @@ -55,7 +55,7 @@ For main branch of vLLM Ascend, we usually make it compatible with the latest vL | vLLM Ascend | vLLM | Python | Stable CANN | PyTorch/torch_npu | |-------------|--------------|------------------|-------------|--------------------| -| main | dc917cceb877dfd13f98c538c4c96158047d98bd, v0.14.1 tag | >= 3.10, < 3.12 | 8.5.0 | 2.9.0 / 2.9.0 | +| main | cf1167e50b809f18efd21fb3418dd75d2805b14f, v0.14.1 tag | >= 3.10, < 3.12 | 8.5.0 | 2.9.0 / 2.9.0 | ## Release cadence diff --git a/vllm_ascend/ops/mm_encoder_attention.py b/vllm_ascend/ops/mm_encoder_attention.py index 19f44066761..aa9a07374bf 100644 --- a/vllm_ascend/ops/mm_encoder_attention.py +++ b/vllm_ascend/ops/mm_encoder_attention.py @@ -38,7 +38,6 @@ def __init__( scale: float | None = None, num_kv_heads: int | None = None, prefix: str = "", - multimodal_config: MultiModalConfig | None = None, ) -> None: """ Args: @@ -56,7 +55,6 @@ def __init__( scale=scale, num_kv_heads=num_kv_heads, prefix=prefix, - multimodal_config=multimodal_config, ) def reshape_qkv_to_3d( From 39a37c53a7570dab22abacb899c8df7ef5313b53 Mon Sep 17 00:00:00 2001 From: shen-shanshan <467638484@qq.com> Date: Tue, 27 Jan 2026 08:12:27 +0000 Subject: [PATCH 2/8] update Signed-off-by: shen-shanshan <467638484@qq.com> --- .github/workflows/_e2e_nightly_multi_node.yaml | 2 +- .github/workflows/pr_test_full.yaml | 2 +- .github/workflows/pr_test_light.yaml | 4 ++-- .github/workflows/schedule_nightly_test_a2.yaml | 3 ++- .github/workflows/schedule_nightly_test_a3.yaml | 2 ++ .github/workflows/schedule_test_benchmarks.yaml | 2 +- Dockerfile | 2 +- Dockerfile.310p | 2 +- Dockerfile.310p.openEuler | 2 +- Dockerfile.a3 | 2 +- Dockerfile.a3.openEuler | 2 +- Dockerfile.openEuler | 2 +- docs/source/community/versioning_policy.md | 4 ++-- docs/source/conf.py | 4 ++-- vllm_ascend/ascend_forward_context.py | 4 +--- vllm_ascend/attention/mla_v1.py | 7 ++----- vllm_ascend/attention/sfa_v1.py | 7 ++----- vllm_ascend/patch/platform/patch_multiproc_executor.py | 5 +---- 18 files changed, 25 insertions(+), 33 deletions(-) diff --git a/.github/workflows/_e2e_nightly_multi_node.yaml b/.github/workflows/_e2e_nightly_multi_node.yaml index fa3659e5600..1b1758a26e4 100644 --- a/.github/workflows/_e2e_nightly_multi_node.yaml +++ b/.github/workflows/_e2e_nightly_multi_node.yaml @@ -32,7 +32,7 @@ on: description: how many pods will be pulled up via lws.yaml, indicates number of nodes we need vllm_version: required: false - default: "v0.14.1" + default: "releases/v0.15.0" type: string description: vllm version to use vllm_ascend_remote_url: diff --git a/.github/workflows/pr_test_full.yaml b/.github/workflows/pr_test_full.yaml index 2d61361775d..34cbea34413 100644 --- a/.github/workflows/pr_test_full.yaml +++ b/.github/workflows/pr_test_full.yaml @@ -75,7 +75,7 @@ jobs: name: e2e-full strategy: matrix: - vllm_version: [cf1167e50b809f18efd21fb3418dd75d2805b14f, v0.14.1] + vllm_version: [cf1167e50b809f18efd21fb3418dd75d2805b14f, releases/v0.15.0] needs: [changes] if: ${{ needs.changes.outputs.e2e_tracker == 'true' || needs.changes.outputs.e2e_tracker == true }} uses: ./.github/workflows/_e2e_test.yaml diff --git a/.github/workflows/pr_test_light.yaml b/.github/workflows/pr_test_light.yaml index ce34ba1d7af..257f5c7b5b5 100644 --- a/.github/workflows/pr_test_light.yaml +++ b/.github/workflows/pr_test_light.yaml @@ -87,7 +87,7 @@ jobs: if: ${{ needs.lint.result == 'success' && (needs.changes.outputs.e2e_tracker == 'true' || needs.changes.outputs.ut_tracker == 'true') }} strategy: matrix: - vllm_version: [cf1167e50b809f18efd21fb3418dd75d2805b14f, v0.14.1] + vllm_version: [cf1167e50b809f18efd21fb3418dd75d2805b14f, releases/v0.15.0] uses: ./.github/workflows/_unit_test.yaml with: vllm: ${{ matrix.vllm_version }} @@ -99,7 +99,7 @@ jobs: name: e2e-light strategy: matrix: - vllm_version: [cf1167e50b809f18efd21fb3418dd75d2805b14f, v0.14.1] + vllm_version: [cf1167e50b809f18efd21fb3418dd75d2805b14f, releases/v0.15.0] # Note (yikun): If CI resource are limited we can split job into two chain jobs needs: [lint, changes] # only trigger e2e test after lint passed and the change is e2e related with pull request. diff --git a/.github/workflows/schedule_nightly_test_a2.yaml b/.github/workflows/schedule_nightly_test_a2.yaml index d25ffd58c66..fb6d2d8797b 100644 --- a/.github/workflows/schedule_nightly_test_a2.yaml +++ b/.github/workflows/schedule_nightly_test_a2.yaml @@ -66,6 +66,7 @@ jobs: tests: tests/e2e/nightly/single_node/ops/multicard_ops_a2/ uses: ./.github/workflows/_e2e_nightly_single_node.yaml with: + vllm: releases/v0.15.0 runner: ${{ matrix.test_config.os }} tests: ${{ matrix.test_config.tests }} name: ${{ matrix.test_config.name }} @@ -133,7 +134,7 @@ jobs: - Qwen3-Omni-30B-A3B-Instruct uses: ./.github/workflows/_e2e_nightly_single_node_models.yaml with: - vllm: v0.14.1 + vllm: releases/v0.15.0 runner: ${{ matrix.test_config.os }} model_list: ${{ toJson(matrix.test_config.model_list) }} image: 'swr.cn-southwest-2.myhuaweicloud.com/base_image/ascend-ci/cann:8.5.0-910b-ubuntu22.04-py3.11' diff --git a/.github/workflows/schedule_nightly_test_a3.yaml b/.github/workflows/schedule_nightly_test_a3.yaml index ed0b4383616..043d7b94022 100644 --- a/.github/workflows/schedule_nightly_test_a3.yaml +++ b/.github/workflows/schedule_nightly_test_a3.yaml @@ -161,6 +161,7 @@ jobs: tests: tests/e2e/nightly/single_node/models/test_deepseek_v3_2_w8a8.py uses: ./.github/workflows/_e2e_nightly_single_node.yaml with: + vllm: releases/v0.15.0 runner: ${{ matrix.test_config.os }} image: 'swr.cn-southwest-2.myhuaweicloud.com/base_image/ascend-ci/vllm-ascend:nightly-a3' tests: ${{ matrix.test_config.tests }} @@ -180,6 +181,7 @@ jobs: uses: ./.github/workflows/_e2e_nightly_single_node.yaml with: runner: ${{ matrix.test_config.os }} + vllm: releases/v0.15.0 image: 'swr.cn-southwest-2.myhuaweicloud.com/base_image/ascend-ci/vllm-ascend:nightly-a3' tests: ${{ matrix.test_config.tests }} name: ${{ matrix.test_config.name }} diff --git a/.github/workflows/schedule_test_benchmarks.yaml b/.github/workflows/schedule_test_benchmarks.yaml index 8585670ddd7..af694b4d647 100644 --- a/.github/workflows/schedule_test_benchmarks.yaml +++ b/.github/workflows/schedule_test_benchmarks.yaml @@ -51,7 +51,7 @@ jobs: strategy: matrix: include: - - vllm_branch: v0.14.1 + - vllm_branch: releases/v0.15.0 vllm_ascend_branch: main max-parallel: 1 container: diff --git a/Dockerfile b/Dockerfile index 02e2820969a..5ee932c1231 100644 --- a/Dockerfile +++ b/Dockerfile @@ -48,7 +48,7 @@ RUN pip config set global.index-url ${PIP_INDEX_URL} # Install vLLM ARG VLLM_REPO=https://github.com/vllm-project/vllm.git -ARG VLLM_TAG=v0.14.1 +ARG VLLM_TAG=releases/v0.15.0 RUN git clone --depth 1 $VLLM_REPO --branch $VLLM_TAG /vllm-workspace/vllm # In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it. RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -v -e /vllm-workspace/vllm/[audio] --extra-index https://download.pytorch.org/whl/cpu/ && \ diff --git a/Dockerfile.310p b/Dockerfile.310p index 07b97bc1ca3..a7b2ffdc942 100644 --- a/Dockerfile.310p +++ b/Dockerfile.310p @@ -40,7 +40,7 @@ RUN pip config set global.index-url ${PIP_INDEX_URL} # Install vLLM ARG VLLM_REPO=https://github.com/vllm-project/vllm.git -ARG VLLM_TAG=v0.14.1 +ARG VLLM_TAG=releases/v0.15.0 RUN git clone --depth 1 $VLLM_REPO --branch $VLLM_TAG /vllm-workspace/vllm # In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it. RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -v -e /vllm-workspace/vllm/[audio] --extra-index https://download.pytorch.org/whl/cpu/ && \ diff --git a/Dockerfile.310p.openEuler b/Dockerfile.310p.openEuler index abf70a8812c..29370a9517d 100644 --- a/Dockerfile.310p.openEuler +++ b/Dockerfile.310p.openEuler @@ -36,7 +36,7 @@ COPY . /vllm-workspace/vllm-ascend/ # Install vLLM ARG VLLM_REPO=https://github.com/vllm-project/vllm.git -ARG VLLM_TAG=v0.14.1 +ARG VLLM_TAG=releases/v0.15.0 RUN git clone --depth 1 $VLLM_REPO --branch $VLLM_TAG /vllm-workspace/vllm # In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it. RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] --extra-index https://download.pytorch.org/whl/cpu/ && \ diff --git a/Dockerfile.a3 b/Dockerfile.a3 index 7688c14d6a8..c9ce41110b4 100644 --- a/Dockerfile.a3 +++ b/Dockerfile.a3 @@ -47,7 +47,7 @@ RUN apt-get update -y && \ # Install vLLM ARG VLLM_REPO=https://github.com/vllm-project/vllm.git -ARG VLLM_TAG=v0.14.1 +ARG VLLM_TAG=releases/v0.15.0 RUN git clone --depth 1 $VLLM_REPO --branch $VLLM_TAG /vllm-workspace/vllm # In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it. RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -v -e /vllm-workspace/vllm/[audio] --extra-index https://download.pytorch.org/whl/cpu/ && \ diff --git a/Dockerfile.a3.openEuler b/Dockerfile.a3.openEuler index 6129adc7982..d5b74c6ba79 100644 --- a/Dockerfile.a3.openEuler +++ b/Dockerfile.a3.openEuler @@ -50,7 +50,7 @@ RUN yum update -y && \ # Install vLLM ARG VLLM_REPO=https://github.com/vllm-project/vllm.git -ARG VLLM_TAG=v0.14.1 +ARG VLLM_TAG=releases/v0.15.0 RUN git clone --depth 1 $VLLM_REPO --branch $VLLM_TAG /vllm-workspace/vllm # In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it. RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] --extra-index https://download.pytorch.org/whl/cpu/ && \ diff --git a/Dockerfile.openEuler b/Dockerfile.openEuler index 7603372f6af..12ce32a5ffb 100644 --- a/Dockerfile.openEuler +++ b/Dockerfile.openEuler @@ -50,7 +50,7 @@ RUN yum update -y && \ # Install vLLM ARG VLLM_REPO=https://github.com/vllm-project/vllm.git -ARG VLLM_TAG=v0.14.1 +ARG VLLM_TAG=releases/v0.15.0 RUN git clone --depth 1 $VLLM_REPO --branch $VLLM_TAG /vllm-workspace/vllm # In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it. RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] --extra-index https://download.pytorch.org/whl/cpu/ && \ diff --git a/docs/source/community/versioning_policy.md b/docs/source/community/versioning_policy.md index 33f7ba5456b..01ecb86c22c 100644 --- a/docs/source/community/versioning_policy.md +++ b/docs/source/community/versioning_policy.md @@ -23,7 +23,7 @@ The table below is the release compatibility matrix for vLLM Ascend release. | vLLM Ascend | vLLM | Python | Stable CANN | PyTorch/torch_npu | Triton Ascend | |-------------|-------------------|-----------------|-------------|---------------------------------|---------------| -| v0.14.0rc1 | v0.14.0/v0.14.1 | >= 3.10, < 3.12 | 8.5.0 | 2.9.0 / 2.9.0 | 3.2.0 | +| v0.14.0rc1 | v0.14.0/releases/v0.15.0 | >= 3.10, < 3.12 | 8.5.0 | 2.9.0 / 2.9.0 | 3.2.0 | | v0.13.0rc2 | v0.13.0 | >= 3.10, < 3.12 | 8.5.0 | 2.8.0 / 2.8.0.post1 | 3.2.0 | | v0.13.0rc1 | v0.13.0 | >= 3.10, < 3.12 | 8.3.RC2 | 2.8.0 / 2.8.0 | | | v0.11.0 | v0.11.0 | >= 3.9 , < 3.12 | 8.3.RC2 | 2.7.1 / 2.7.1.post1 | | @@ -55,7 +55,7 @@ For main branch of vLLM Ascend, we usually make it compatible with the latest vL | vLLM Ascend | vLLM | Python | Stable CANN | PyTorch/torch_npu | |-------------|--------------|------------------|-------------|--------------------| -| main | cf1167e50b809f18efd21fb3418dd75d2805b14f, v0.14.1 tag | >= 3.10, < 3.12 | 8.5.0 | 2.9.0 / 2.9.0 | +| main | cf1167e50b809f18efd21fb3418dd75d2805b14f, releases/v0.15.0 tag | >= 3.10, < 3.12 | 8.5.0 | 2.9.0 / 2.9.0 | ## Release cadence diff --git a/docs/source/conf.py b/docs/source/conf.py index 47ebcec8a09..3e09a63e6eb 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -65,7 +65,7 @@ # the branch of vllm, used in vllm clone # - main branch: 'main' # - vX.Y.Z branch: 'vX.Y.Z' - "vllm_version": "v0.14.1", + "vllm_version": "releases/v0.15.0", # the branch of vllm-ascend, used in vllm-ascend clone and image tag # - main branch: 'main' # - vX.Y.Z branch: latest vllm-ascend release tag @@ -77,7 +77,7 @@ # CANN image tag "cann_image_tag": "8.5.0-910b-ubuntu22.04-py3.11", # vllm version in ci - "ci_vllm_version": "v0.14.1", + "ci_vllm_version": "releases/v0.15.0", } # For cross-file header anchors diff --git a/vllm_ascend/ascend_forward_context.py b/vllm_ascend/ascend_forward_context.py index faa11d2d43d..61c09afb5ff 100644 --- a/vllm_ascend/ascend_forward_context.py +++ b/vllm_ascend/ascend_forward_context.py @@ -19,7 +19,6 @@ is_drafter_moe_model, is_moe_model, speculative_enable_dispatch_gmm_combine_decode, - vllm_version_is, ) @@ -59,8 +58,7 @@ def set_ascend_forward_context( "batch_descriptor": batch_descriptor, } - if not vllm_version_is("0.14.1"): - forward_context_kwargs["skip_compiled"] = skip_compiled + forward_context_kwargs["skip_compiled"] = skip_compiled with set_forward_context(**forward_context_kwargs): forward_context = get_forward_context() diff --git a/vllm_ascend/attention/mla_v1.py b/vllm_ascend/attention/mla_v1.py index 03834212bdf..5c12b8153d4 100644 --- a/vllm_ascend/attention/mla_v1.py +++ b/vllm_ascend/attention/mla_v1.py @@ -44,17 +44,14 @@ from vllm_ascend.ops.rotary_embedding import get_cos_and_sin_mla from vllm_ascend.ops.weight_prefetch import maybe_npu_prefetch from vllm_ascend.quantization.methods import AscendW8A8LinearMethod -from vllm_ascend.utils import ACL_FORMAT_FRACTAL_ND, maybe_trans_nz, vllm_version_is, weak_ref_tensors +from vllm_ascend.utils import ACL_FORMAT_FRACTAL_ND, maybe_trans_nz, weak_ref_tensors from vllm_ascend.worker.npu_input_batch import NPUInputBatch if TYPE_CHECKING: from vllm.v1.core.sched.output import SchedulerOutput # isort: off -if vllm_version_is("0.14.1"): - from vllm.v1.attention.backends.mla.common import MLACommonMetadataBuilder # type: ignore -else: - from vllm.model_executor.layers.attention.mla_attention import MLACommonMetadataBuilder +from vllm.model_executor.layers.attention.mla_attention import MLACommonMetadataBuilder # isort: on MAX_O_PROJ_PREFETCH_SIZE = 16 * 1024 * 1024 diff --git a/vllm_ascend/attention/sfa_v1.py b/vllm_ascend/attention/sfa_v1.py index 6f283429d27..6d2bb1f859d 100644 --- a/vllm_ascend/attention/sfa_v1.py +++ b/vllm_ascend/attention/sfa_v1.py @@ -45,16 +45,13 @@ enable_dsa_cp, enable_dsa_cp_with_layer_shard, maybe_trans_nz, - vllm_version_is, ) from vllm_ascend.worker.npu_input_batch import NPUInputBatch if TYPE_CHECKING: from vllm.v1.core.sched.output import SchedulerOutput -if vllm_version_is("0.14.1"): - from vllm.v1.attention.backends.mla.common import MLACommonMetadataBuilder # type: ignore -else: - from vllm.model_executor.layers.attention.mla_attention import MLACommonMetadataBuilder +from vllm.model_executor.layers.attention.mla_attention import MLACommonMetadataBuilder + # isort: on # token count limits within bmm_transpose operator diff --git a/vllm_ascend/patch/platform/patch_multiproc_executor.py b/vllm_ascend/patch/platform/patch_multiproc_executor.py index abc955e578c..98cc545c9de 100644 --- a/vllm_ascend/patch/platform/patch_multiproc_executor.py +++ b/vllm_ascend/patch/platform/patch_multiproc_executor.py @@ -19,8 +19,6 @@ set_multiprocessing_worker_envs, ) -from vllm_ascend.utils import vllm_version_is - class AscendMultiprocExecutor(MultiprocExecutor): def _init_executor(self) -> None: @@ -178,8 +176,7 @@ def make_worker_process( "death_pipe": death_reader, "shared_worker_lock": shared_worker_lock, } - if not vllm_version_is("0.14.1"): - process_kwargs["is_driver_worker"] = is_driver_worker + process_kwargs["is_driver_worker"] = is_driver_worker # Run EngineCore busy loop in background process. proc = context.Process( target=WorkerProc.worker_main, From 7d71da618ca5a8621f60e8ba2442b887660df6ba Mon Sep 17 00:00:00 2001 From: shen-shanshan <467638484@qq.com> Date: Tue, 27 Jan 2026 09:22:31 +0000 Subject: [PATCH 3/8] update Signed-off-by: shen-shanshan <467638484@qq.com> --- .github/workflows/_e2e_nightly_multi_node.yaml | 2 +- .github/workflows/pr_test_full.yaml | 2 +- .github/workflows/pr_test_light.yaml | 4 ++-- .github/workflows/schedule_nightly_test_a2.yaml | 4 ++-- .github/workflows/schedule_nightly_test_a3.yaml | 4 ++-- .github/workflows/schedule_test_benchmarks.yaml | 2 +- Dockerfile | 2 +- Dockerfile.310p | 2 +- Dockerfile.310p.openEuler | 2 +- Dockerfile.a3 | 2 +- Dockerfile.a3.openEuler | 2 +- Dockerfile.openEuler | 2 +- docs/source/community/versioning_policy.md | 4 ++-- docs/source/conf.py | 4 ++-- 14 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/_e2e_nightly_multi_node.yaml b/.github/workflows/_e2e_nightly_multi_node.yaml index 1b1758a26e4..84593c57e0f 100644 --- a/.github/workflows/_e2e_nightly_multi_node.yaml +++ b/.github/workflows/_e2e_nightly_multi_node.yaml @@ -32,7 +32,7 @@ on: description: how many pods will be pulled up via lws.yaml, indicates number of nodes we need vllm_version: required: false - default: "releases/v0.15.0" + default: "v0.15.0rc0" type: string description: vllm version to use vllm_ascend_remote_url: diff --git a/.github/workflows/pr_test_full.yaml b/.github/workflows/pr_test_full.yaml index 34cbea34413..8cdb4496fa7 100644 --- a/.github/workflows/pr_test_full.yaml +++ b/.github/workflows/pr_test_full.yaml @@ -75,7 +75,7 @@ jobs: name: e2e-full strategy: matrix: - vllm_version: [cf1167e50b809f18efd21fb3418dd75d2805b14f, releases/v0.15.0] + vllm_version: [cf1167e50b809f18efd21fb3418dd75d2805b14f, v0.15.0rc0] needs: [changes] if: ${{ needs.changes.outputs.e2e_tracker == 'true' || needs.changes.outputs.e2e_tracker == true }} uses: ./.github/workflows/_e2e_test.yaml diff --git a/.github/workflows/pr_test_light.yaml b/.github/workflows/pr_test_light.yaml index 257f5c7b5b5..b0a389909c9 100644 --- a/.github/workflows/pr_test_light.yaml +++ b/.github/workflows/pr_test_light.yaml @@ -87,7 +87,7 @@ jobs: if: ${{ needs.lint.result == 'success' && (needs.changes.outputs.e2e_tracker == 'true' || needs.changes.outputs.ut_tracker == 'true') }} strategy: matrix: - vllm_version: [cf1167e50b809f18efd21fb3418dd75d2805b14f, releases/v0.15.0] + vllm_version: [cf1167e50b809f18efd21fb3418dd75d2805b14f, v0.15.0rc0] uses: ./.github/workflows/_unit_test.yaml with: vllm: ${{ matrix.vllm_version }} @@ -99,7 +99,7 @@ jobs: name: e2e-light strategy: matrix: - vllm_version: [cf1167e50b809f18efd21fb3418dd75d2805b14f, releases/v0.15.0] + vllm_version: [cf1167e50b809f18efd21fb3418dd75d2805b14f, v0.15.0rc0] # Note (yikun): If CI resource are limited we can split job into two chain jobs needs: [lint, changes] # only trigger e2e test after lint passed and the change is e2e related with pull request. diff --git a/.github/workflows/schedule_nightly_test_a2.yaml b/.github/workflows/schedule_nightly_test_a2.yaml index fb6d2d8797b..ab3fe4684c7 100644 --- a/.github/workflows/schedule_nightly_test_a2.yaml +++ b/.github/workflows/schedule_nightly_test_a2.yaml @@ -66,7 +66,7 @@ jobs: tests: tests/e2e/nightly/single_node/ops/multicard_ops_a2/ uses: ./.github/workflows/_e2e_nightly_single_node.yaml with: - vllm: releases/v0.15.0 + vllm: v0.15.0rc0 runner: ${{ matrix.test_config.os }} tests: ${{ matrix.test_config.tests }} name: ${{ matrix.test_config.name }} @@ -134,7 +134,7 @@ jobs: - Qwen3-Omni-30B-A3B-Instruct uses: ./.github/workflows/_e2e_nightly_single_node_models.yaml with: - vllm: releases/v0.15.0 + vllm: v0.15.0rc0 runner: ${{ matrix.test_config.os }} model_list: ${{ toJson(matrix.test_config.model_list) }} image: 'swr.cn-southwest-2.myhuaweicloud.com/base_image/ascend-ci/cann:8.5.0-910b-ubuntu22.04-py3.11' diff --git a/.github/workflows/schedule_nightly_test_a3.yaml b/.github/workflows/schedule_nightly_test_a3.yaml index 043d7b94022..be84cf96607 100644 --- a/.github/workflows/schedule_nightly_test_a3.yaml +++ b/.github/workflows/schedule_nightly_test_a3.yaml @@ -161,7 +161,7 @@ jobs: tests: tests/e2e/nightly/single_node/models/test_deepseek_v3_2_w8a8.py uses: ./.github/workflows/_e2e_nightly_single_node.yaml with: - vllm: releases/v0.15.0 + vllm: v0.15.0rc0 runner: ${{ matrix.test_config.os }} image: 'swr.cn-southwest-2.myhuaweicloud.com/base_image/ascend-ci/vllm-ascend:nightly-a3' tests: ${{ matrix.test_config.tests }} @@ -181,7 +181,7 @@ jobs: uses: ./.github/workflows/_e2e_nightly_single_node.yaml with: runner: ${{ matrix.test_config.os }} - vllm: releases/v0.15.0 + vllm: v0.15.0rc0 image: 'swr.cn-southwest-2.myhuaweicloud.com/base_image/ascend-ci/vllm-ascend:nightly-a3' tests: ${{ matrix.test_config.tests }} name: ${{ matrix.test_config.name }} diff --git a/.github/workflows/schedule_test_benchmarks.yaml b/.github/workflows/schedule_test_benchmarks.yaml index af694b4d647..904bee0a84a 100644 --- a/.github/workflows/schedule_test_benchmarks.yaml +++ b/.github/workflows/schedule_test_benchmarks.yaml @@ -51,7 +51,7 @@ jobs: strategy: matrix: include: - - vllm_branch: releases/v0.15.0 + - vllm_branch: v0.15.0rc0 vllm_ascend_branch: main max-parallel: 1 container: diff --git a/Dockerfile b/Dockerfile index 5ee932c1231..75ae6462725 100644 --- a/Dockerfile +++ b/Dockerfile @@ -48,7 +48,7 @@ RUN pip config set global.index-url ${PIP_INDEX_URL} # Install vLLM ARG VLLM_REPO=https://github.com/vllm-project/vllm.git -ARG VLLM_TAG=releases/v0.15.0 +ARG VLLM_TAG=v0.15.0rc0 RUN git clone --depth 1 $VLLM_REPO --branch $VLLM_TAG /vllm-workspace/vllm # In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it. RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -v -e /vllm-workspace/vllm/[audio] --extra-index https://download.pytorch.org/whl/cpu/ && \ diff --git a/Dockerfile.310p b/Dockerfile.310p index a7b2ffdc942..f4f142c8ccd 100644 --- a/Dockerfile.310p +++ b/Dockerfile.310p @@ -40,7 +40,7 @@ RUN pip config set global.index-url ${PIP_INDEX_URL} # Install vLLM ARG VLLM_REPO=https://github.com/vllm-project/vllm.git -ARG VLLM_TAG=releases/v0.15.0 +ARG VLLM_TAG=v0.15.0rc0 RUN git clone --depth 1 $VLLM_REPO --branch $VLLM_TAG /vllm-workspace/vllm # In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it. RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -v -e /vllm-workspace/vllm/[audio] --extra-index https://download.pytorch.org/whl/cpu/ && \ diff --git a/Dockerfile.310p.openEuler b/Dockerfile.310p.openEuler index 29370a9517d..b07fbb83e90 100644 --- a/Dockerfile.310p.openEuler +++ b/Dockerfile.310p.openEuler @@ -36,7 +36,7 @@ COPY . /vllm-workspace/vllm-ascend/ # Install vLLM ARG VLLM_REPO=https://github.com/vllm-project/vllm.git -ARG VLLM_TAG=releases/v0.15.0 +ARG VLLM_TAG=v0.15.0rc0 RUN git clone --depth 1 $VLLM_REPO --branch $VLLM_TAG /vllm-workspace/vllm # In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it. RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] --extra-index https://download.pytorch.org/whl/cpu/ && \ diff --git a/Dockerfile.a3 b/Dockerfile.a3 index c9ce41110b4..94b40bc16f1 100644 --- a/Dockerfile.a3 +++ b/Dockerfile.a3 @@ -47,7 +47,7 @@ RUN apt-get update -y && \ # Install vLLM ARG VLLM_REPO=https://github.com/vllm-project/vllm.git -ARG VLLM_TAG=releases/v0.15.0 +ARG VLLM_TAG=v0.15.0rc0 RUN git clone --depth 1 $VLLM_REPO --branch $VLLM_TAG /vllm-workspace/vllm # In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it. RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -v -e /vllm-workspace/vllm/[audio] --extra-index https://download.pytorch.org/whl/cpu/ && \ diff --git a/Dockerfile.a3.openEuler b/Dockerfile.a3.openEuler index d5b74c6ba79..65de41960dc 100644 --- a/Dockerfile.a3.openEuler +++ b/Dockerfile.a3.openEuler @@ -50,7 +50,7 @@ RUN yum update -y && \ # Install vLLM ARG VLLM_REPO=https://github.com/vllm-project/vllm.git -ARG VLLM_TAG=releases/v0.15.0 +ARG VLLM_TAG=v0.15.0rc0 RUN git clone --depth 1 $VLLM_REPO --branch $VLLM_TAG /vllm-workspace/vllm # In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it. RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] --extra-index https://download.pytorch.org/whl/cpu/ && \ diff --git a/Dockerfile.openEuler b/Dockerfile.openEuler index 12ce32a5ffb..269e4d7a15f 100644 --- a/Dockerfile.openEuler +++ b/Dockerfile.openEuler @@ -50,7 +50,7 @@ RUN yum update -y && \ # Install vLLM ARG VLLM_REPO=https://github.com/vllm-project/vllm.git -ARG VLLM_TAG=releases/v0.15.0 +ARG VLLM_TAG=v0.15.0rc0 RUN git clone --depth 1 $VLLM_REPO --branch $VLLM_TAG /vllm-workspace/vllm # In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it. RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] --extra-index https://download.pytorch.org/whl/cpu/ && \ diff --git a/docs/source/community/versioning_policy.md b/docs/source/community/versioning_policy.md index 01ecb86c22c..73dbb53a65e 100644 --- a/docs/source/community/versioning_policy.md +++ b/docs/source/community/versioning_policy.md @@ -23,7 +23,7 @@ The table below is the release compatibility matrix for vLLM Ascend release. | vLLM Ascend | vLLM | Python | Stable CANN | PyTorch/torch_npu | Triton Ascend | |-------------|-------------------|-----------------|-------------|---------------------------------|---------------| -| v0.14.0rc1 | v0.14.0/releases/v0.15.0 | >= 3.10, < 3.12 | 8.5.0 | 2.9.0 / 2.9.0 | 3.2.0 | +| v0.14.0rc1 | v0.14.0/v0.15.0rc0 | >= 3.10, < 3.12 | 8.5.0 | 2.9.0 / 2.9.0 | 3.2.0 | | v0.13.0rc2 | v0.13.0 | >= 3.10, < 3.12 | 8.5.0 | 2.8.0 / 2.8.0.post1 | 3.2.0 | | v0.13.0rc1 | v0.13.0 | >= 3.10, < 3.12 | 8.3.RC2 | 2.8.0 / 2.8.0 | | | v0.11.0 | v0.11.0 | >= 3.9 , < 3.12 | 8.3.RC2 | 2.7.1 / 2.7.1.post1 | | @@ -55,7 +55,7 @@ For main branch of vLLM Ascend, we usually make it compatible with the latest vL | vLLM Ascend | vLLM | Python | Stable CANN | PyTorch/torch_npu | |-------------|--------------|------------------|-------------|--------------------| -| main | cf1167e50b809f18efd21fb3418dd75d2805b14f, releases/v0.15.0 tag | >= 3.10, < 3.12 | 8.5.0 | 2.9.0 / 2.9.0 | +| main | cf1167e50b809f18efd21fb3418dd75d2805b14f, v0.15.0rc0 tag | >= 3.10, < 3.12 | 8.5.0 | 2.9.0 / 2.9.0 | ## Release cadence diff --git a/docs/source/conf.py b/docs/source/conf.py index 3e09a63e6eb..a00bccc5d56 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -65,7 +65,7 @@ # the branch of vllm, used in vllm clone # - main branch: 'main' # - vX.Y.Z branch: 'vX.Y.Z' - "vllm_version": "releases/v0.15.0", + "vllm_version": "v0.15.0rc0", # the branch of vllm-ascend, used in vllm-ascend clone and image tag # - main branch: 'main' # - vX.Y.Z branch: latest vllm-ascend release tag @@ -77,7 +77,7 @@ # CANN image tag "cann_image_tag": "8.5.0-910b-ubuntu22.04-py3.11", # vllm version in ci - "ci_vllm_version": "releases/v0.15.0", + "ci_vllm_version": "v0.15.0rc0", } # For cross-file header anchors From 46d18d38946f10c326b588d43f8b73f2930920f8 Mon Sep 17 00:00:00 2001 From: shen-shanshan <467638484@qq.com> Date: Wed, 28 Jan 2026 06:30:33 +0000 Subject: [PATCH 4/8] update Signed-off-by: shen-shanshan <467638484@qq.com> --- docs/source/community/versioning_policy.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/community/versioning_policy.md b/docs/source/community/versioning_policy.md index 73dbb53a65e..3637d89cc5f 100644 --- a/docs/source/community/versioning_policy.md +++ b/docs/source/community/versioning_policy.md @@ -23,7 +23,7 @@ The table below is the release compatibility matrix for vLLM Ascend release. | vLLM Ascend | vLLM | Python | Stable CANN | PyTorch/torch_npu | Triton Ascend | |-------------|-------------------|-----------------|-------------|---------------------------------|---------------| -| v0.14.0rc1 | v0.14.0/v0.15.0rc0 | >= 3.10, < 3.12 | 8.5.0 | 2.9.0 / 2.9.0 | 3.2.0 | +| v0.14.0rc1 | v0.14.0/v0.14.1 | >= 3.10, < 3.12 | 8.5.0 | 2.9.0 / 2.9.0 | 3.2.0 | | v0.13.0rc2 | v0.13.0 | >= 3.10, < 3.12 | 8.5.0 | 2.8.0 / 2.8.0.post1 | 3.2.0 | | v0.13.0rc1 | v0.13.0 | >= 3.10, < 3.12 | 8.3.RC2 | 2.8.0 / 2.8.0 | | | v0.11.0 | v0.11.0 | >= 3.9 , < 3.12 | 8.3.RC2 | 2.7.1 / 2.7.1.post1 | | From 516c1702f66935862c8904ee5d448db24a366425 Mon Sep 17 00:00:00 2001 From: shen-shanshan <467638484@qq.com> Date: Thu, 29 Jan 2026 07:40:42 +0000 Subject: [PATCH 5/8] split attn forward and kv_cache update Signed-off-by: shen-shanshan <467638484@qq.com> --- vllm_ascend/attention/attention_v1.py | 12 +++-- vllm_ascend/ops/kv_cache.py | 78 +++++++++++++++++++++++++++ 2 files changed, 85 insertions(+), 5 deletions(-) create mode 100644 vllm_ascend/ops/kv_cache.py diff --git a/vllm_ascend/attention/attention_v1.py b/vllm_ascend/attention/attention_v1.py index 768b908224a..66e34feadd8 100644 --- a/vllm_ascend/attention/attention_v1.py +++ b/vllm_ascend/attention/attention_v1.py @@ -854,13 +854,13 @@ def _forward_encoder_attention( actual_seq_kvlen=attn_metadata.actual_seq_lengths_q, )[0] - def reshape_and_cache( + def do_kv_cache_update( self, key: torch.Tensor, value: torch.Tensor, - kv_cache: tuple[torch.Tensor], + kv_cache: torch.Tensor, attn_metadata: AscendMetadata, - ): + ) -> None: if len(kv_cache) > 1: if self.is_kv_producer: attn_metadata.reshape_cache_event = torch.npu.Event() @@ -932,8 +932,10 @@ def forward( num_tokens = query.shape[0] if attn_metadata is None: return output.fill_(0) - if key is not None and value is not None: - key, value = self.reshape_and_cache(key, value, kv_cache, attn_metadata) + + if len(kv_cache) > 1 and self.key_cache is None: + self.key_cache, self.value_cache = kv_cache[0], kv_cache[1] + # pooling model branch if attn_metadata.model_runner_type == "pooling": attn_output = self._forward_encoder_attention(query, key, value, attn_metadata, output) diff --git a/vllm_ascend/ops/kv_cache.py b/vllm_ascend/ops/kv_cache.py new file mode 100644 index 00000000000..cf66349f542 --- /dev/null +++ b/vllm_ascend/ops/kv_cache.py @@ -0,0 +1,78 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2025 Huawei Technologies Co., Ltd. All Rights Reserved. +# Copyright 2023 The vLLM team. +# Copyright 2023 DeepSeek-AI and the HuggingFace Inc. team. All rights reserved. +# +# This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX +# and OPT implementations in this library. It has been modified from its +# original forms to accommodate minor architectural differences compared +# to GPT-NeoX and OPT used by the Meta AI team that trained the model. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import torch +from vllm.forward_context import get_forward_context +from vllm.utils.torch_utils import ( + direct_register_custom_op, +) + + +def _unified_kv_cache_update_impl( + key: torch.Tensor, + value: torch.Tensor, + layer_name: str, +) -> torch.Tensor: + """ + Returns a dummy that is passed to unified_attention to signal a side effect and + the data dependency between them to ensure torch.compile preserves ordering. + """ + forward_context = get_forward_context() + attn_layer = forward_context.no_compile_layers[layer_name] + kv_cache = attn_layer.kv_cache[forward_context.virtual_engine] + attn_metadata = forward_context.attn_metadata + + slot_mapping = forward_context.slot_mapping + assert isinstance(slot_mapping, dict), f"Expected slot_mapping to be a dict, got {type(slot_mapping)}. " + layer_slot_mapping = slot_mapping.get(layer_name) + + if layer_slot_mapping is not None and key is not None and value is not None: + assert hasattr(attn_layer.impl, "do_kv_cache_update"), ( + f"{attn_layer.impl.__class__.__name__} does not support kv cache update" + ) + + attn_layer.impl.do_kv_cache_update( + key, + value, + kv_cache, + attn_metadata, + ) + + return torch.empty(0, device=kv_cache.device, dtype=kv_cache.dtype) + + +def _unified_kv_cache_update_impl_fake( + key: torch.Tensor, + value: torch.Tensor, + layer_name: str, +) -> torch.Tensor: + return torch.empty(0, device=key.device, dtype=key.dtype) + + +direct_register_custom_op( + op_name="unified_kv_cache_update", + op_func=_unified_kv_cache_update_impl, + fake_impl=_unified_kv_cache_update_impl_fake, + mutates_args=[], + dispatch_key="PrivateUse1", +) From b110014b2d728913643580aa2966d1ec61c02ef6 Mon Sep 17 00:00:00 2001 From: shen-shanshan <467638484@qq.com> Date: Fri, 30 Jan 2026 03:38:22 +0000 Subject: [PATCH 6/8] fix none shared experts case Signed-off-by: shen-shanshan <467638484@qq.com> --- vllm_ascend/ops/fused_moe/fused_moe.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/vllm_ascend/ops/fused_moe/fused_moe.py b/vllm_ascend/ops/fused_moe/fused_moe.py index 50618ae8152..7e1bde15483 100644 --- a/vllm_ascend/ops/fused_moe/fused_moe.py +++ b/vllm_ascend/ops/fused_moe/fused_moe.py @@ -512,6 +512,15 @@ def forward( hidden_states: torch.Tensor, router_logits: torch.Tensor, ) -> tuple[torch.Tensor, torch.Tensor]: + if self._shared_experts is None: + fused_out = AscendFusedMoE.forward( + self, + hidden_states=hidden_states, + router_logits=router_logits, + ) + shared_out = None + return shared_out, fused_out + shared_out, fused_out = AscendFusedMoE.forward( self, hidden_states=hidden_states, @@ -571,6 +580,9 @@ def forward_impl( # type: ignore[override] ) routed_out = fused_moe_results.routed_out + if self._shared_experts is None: + return routed_out + if self.multistream_overlap_gate: fc3_context = get_flash_common3_context() assert fc3_context is not None From 850c6d6bd724d81341a4a1862cca0b812c36f5c3 Mon Sep 17 00:00:00 2001 From: shen-shanshan <467638484@qq.com> Date: Mon, 2 Feb 2026 03:04:36 +0000 Subject: [PATCH 7/8] fix Signed-off-by: shen-shanshan <467638484@qq.com> --- vllm_ascend/attention/attention_v1.py | 15 +++-- vllm_ascend/ops/kv_cache.py | 78 ------------------------- vllm_ascend/ops/mm_encoder_attention.py | 14 ++--- 3 files changed, 16 insertions(+), 91 deletions(-) delete mode 100644 vllm_ascend/ops/kv_cache.py diff --git a/vllm_ascend/attention/attention_v1.py b/vllm_ascend/attention/attention_v1.py index 66e34feadd8..d174cabc598 100644 --- a/vllm_ascend/attention/attention_v1.py +++ b/vllm_ascend/attention/attention_v1.py @@ -66,6 +66,8 @@ class AscendAttentionBackend(AttentionBackend): accept_output_buffer: bool = True + forward_includes_kv_cache_update: bool = True + @staticmethod def get_name() -> str: # HACK(Ronald1995): vllm `initialize_kv_cache` method in model runner v2 make @@ -854,13 +856,13 @@ def _forward_encoder_attention( actual_seq_kvlen=attn_metadata.actual_seq_lengths_q, )[0] - def do_kv_cache_update( + def reshape_and_cache( self, key: torch.Tensor, value: torch.Tensor, - kv_cache: torch.Tensor, + kv_cache: tuple[torch.Tensor], attn_metadata: AscendMetadata, - ) -> None: + ): if len(kv_cache) > 1: if self.is_kv_producer: attn_metadata.reshape_cache_event = torch.npu.Event() @@ -868,6 +870,9 @@ def do_kv_cache_update( self.key_cache, self.value_cache = kv_cache[0], kv_cache[1] slots = attn_metadata.slot_mapping encoder_decoder = self.attn_type == AttentionType.ENCODER_DECODER + + slots = slots.to(torch.int32) + DeviceOperator.reshape_and_cache( key=key[: attn_metadata.num_actual_tokens] if not encoder_decoder else key, value=value[: attn_metadata.num_actual_tokens] if not encoder_decoder else value, @@ -933,8 +938,8 @@ def forward( if attn_metadata is None: return output.fill_(0) - if len(kv_cache) > 1 and self.key_cache is None: - self.key_cache, self.value_cache = kv_cache[0], kv_cache[1] + if key is not None and value is not None: + key, value = self.reshape_and_cache(key, value, kv_cache, attn_metadata) # pooling model branch if attn_metadata.model_runner_type == "pooling": diff --git a/vllm_ascend/ops/kv_cache.py b/vllm_ascend/ops/kv_cache.py deleted file mode 100644 index cf66349f542..00000000000 --- a/vllm_ascend/ops/kv_cache.py +++ /dev/null @@ -1,78 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2025 Huawei Technologies Co., Ltd. All Rights Reserved. -# Copyright 2023 The vLLM team. -# Copyright 2023 DeepSeek-AI and the HuggingFace Inc. team. All rights reserved. -# -# This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX -# and OPT implementations in this library. It has been modified from its -# original forms to accommodate minor architectural differences compared -# to GPT-NeoX and OPT used by the Meta AI team that trained the model. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import torch -from vllm.forward_context import get_forward_context -from vllm.utils.torch_utils import ( - direct_register_custom_op, -) - - -def _unified_kv_cache_update_impl( - key: torch.Tensor, - value: torch.Tensor, - layer_name: str, -) -> torch.Tensor: - """ - Returns a dummy that is passed to unified_attention to signal a side effect and - the data dependency between them to ensure torch.compile preserves ordering. - """ - forward_context = get_forward_context() - attn_layer = forward_context.no_compile_layers[layer_name] - kv_cache = attn_layer.kv_cache[forward_context.virtual_engine] - attn_metadata = forward_context.attn_metadata - - slot_mapping = forward_context.slot_mapping - assert isinstance(slot_mapping, dict), f"Expected slot_mapping to be a dict, got {type(slot_mapping)}. " - layer_slot_mapping = slot_mapping.get(layer_name) - - if layer_slot_mapping is not None and key is not None and value is not None: - assert hasattr(attn_layer.impl, "do_kv_cache_update"), ( - f"{attn_layer.impl.__class__.__name__} does not support kv cache update" - ) - - attn_layer.impl.do_kv_cache_update( - key, - value, - kv_cache, - attn_metadata, - ) - - return torch.empty(0, device=kv_cache.device, dtype=kv_cache.dtype) - - -def _unified_kv_cache_update_impl_fake( - key: torch.Tensor, - value: torch.Tensor, - layer_name: str, -) -> torch.Tensor: - return torch.empty(0, device=key.device, dtype=key.dtype) - - -direct_register_custom_op( - op_name="unified_kv_cache_update", - op_func=_unified_kv_cache_update_impl, - fake_impl=_unified_kv_cache_update_impl_fake, - mutates_args=[], - dispatch_key="PrivateUse1", -) diff --git a/vllm_ascend/ops/mm_encoder_attention.py b/vllm_ascend/ops/mm_encoder_attention.py index aa9a07374bf..5ef46cd9c42 100644 --- a/vllm_ascend/ops/mm_encoder_attention.py +++ b/vllm_ascend/ops/mm_encoder_attention.py @@ -47,7 +47,6 @@ def __init__( num_kv_heads: number of kv heads. prefix: This has no effect, it is only here to make it easier to swap between Attention and MMEncoderAttention. - multimodal_config: configs for multi-modal. """ super().__init__( num_heads=num_heads, @@ -82,13 +81,12 @@ def reshape_qkv_to_3d( return query, key, value def forward_oot( - self, - query: torch.Tensor, - key: torch.Tensor, - value: torch.Tensor, - cu_seqlens: torch.Tensor | None = None, - max_seqlen: torch.Tensor - | None = None, # Only used for Flash Attention + self, + query: torch.Tensor, + key: torch.Tensor, + value: torch.Tensor, + cu_seqlens: torch.Tensor | None = None, + max_seqlen: torch.Tensor | None = None, # Only used for Flash Attention ): bsz, q_len = query.size()[:2] kv_len = key.size(1) From 1fe1c542cb023173a947acc3796dccece6fabf15 Mon Sep 17 00:00:00 2001 From: shen-shanshan <467638484@qq.com> Date: Mon, 2 Feb 2026 03:22:44 +0000 Subject: [PATCH 8/8] fix lint Signed-off-by: shen-shanshan <467638484@qq.com> --- .github/workflows/schedule_nightly_test_a2.yaml | 1 - .github/workflows/schedule_nightly_test_a3.yaml | 2 -- 2 files changed, 3 deletions(-) diff --git a/.github/workflows/schedule_nightly_test_a2.yaml b/.github/workflows/schedule_nightly_test_a2.yaml index ab3fe4684c7..9577d0e4120 100644 --- a/.github/workflows/schedule_nightly_test_a2.yaml +++ b/.github/workflows/schedule_nightly_test_a2.yaml @@ -66,7 +66,6 @@ jobs: tests: tests/e2e/nightly/single_node/ops/multicard_ops_a2/ uses: ./.github/workflows/_e2e_nightly_single_node.yaml with: - vllm: v0.15.0rc0 runner: ${{ matrix.test_config.os }} tests: ${{ matrix.test_config.tests }} name: ${{ matrix.test_config.name }} diff --git a/.github/workflows/schedule_nightly_test_a3.yaml b/.github/workflows/schedule_nightly_test_a3.yaml index be84cf96607..ed0b4383616 100644 --- a/.github/workflows/schedule_nightly_test_a3.yaml +++ b/.github/workflows/schedule_nightly_test_a3.yaml @@ -161,7 +161,6 @@ jobs: tests: tests/e2e/nightly/single_node/models/test_deepseek_v3_2_w8a8.py uses: ./.github/workflows/_e2e_nightly_single_node.yaml with: - vllm: v0.15.0rc0 runner: ${{ matrix.test_config.os }} image: 'swr.cn-southwest-2.myhuaweicloud.com/base_image/ascend-ci/vllm-ascend:nightly-a3' tests: ${{ matrix.test_config.tests }} @@ -181,7 +180,6 @@ jobs: uses: ./.github/workflows/_e2e_nightly_single_node.yaml with: runner: ${{ matrix.test_config.os }} - vllm: v0.15.0rc0 image: 'swr.cn-southwest-2.myhuaweicloud.com/base_image/ascend-ci/vllm-ascend:nightly-a3' tests: ${{ matrix.test_config.tests }} name: ${{ matrix.test_config.name }}