Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
8a59de2
Add run-all-cpu-ut job to CI workflow
xqchen7 Sep 2, 2026
feb8e4e
Add workflow for selected CPU tests
xqchen7 Sep 2, 2026
cf04f77
Refactor GitHub Actions workflow for selected tests
xqchen7 Sep 2, 2026
f4d9b96
Update pr_test.yaml
xqchen7 Sep 2, 2026
dad66a9
Fix formatting issues in selected_tests.yaml
xqchen7 Sep 2, 2026
fac2d51
Add base_sha parameter to selected_tests_cpu.yaml
xqchen7 Sep 2, 2026
9d376c2
Update pr_test.yaml
xqchen7 Sep 2, 2026
21dfa14
Inherit secrets in PR test workflow
xqchen7 Sep 2, 2026
3cc0345
Add OBS access key secrets to selected tests workflow
xqchen7 Sep 2, 2026
7f2575e
Update _selected_tests.yaml
xqchen7 Sep 2, 2026
7a0e3dd
Inherit secrets in run-selected-tests-upstream job
xqchen7 Sep 2, 2026
158d061
Refactor E2E workflow in pr_test.yaml
xqchen7 Sep 2, 2026
fbaa79f
Update _selected_tests_cpu.yaml
xqchen7 Sep 2, 2026
78de8dd
Modify Selected Tests workflow inputs
xqchen7 Sep 2, 2026
2ff64c8
Add Python dependencies installation step
xqchen7 Sep 2, 2026
7a4f66c
chore: trigger pr sync to refresh base_sha
Sep 2, 2026
87848bd
Merge branch 'main' into cpu_ut_902
xqchen7 Sep 2, 2026
34eed31
Fetch latest main branch SHA in PR workflow
xqchen7 Sep 2, 2026
aa0f416
Update fetching main branch commit hash in workflow
xqchen7 Sep 2, 2026
eeb115a
Update _selected_tests.yaml
xqchen7 Sep 2, 2026
d52f90b
Update _selected_tests.yaml
xqchen7 Sep 2, 2026
4c09b17
Update _selected_tests.yaml
xqchen7 Sep 2, 2026
6dda93a
Update _selected_tests.yaml
xqchen7 Sep 2, 2026
396baf0
Update _selected_tests.yaml
xqchen7 Sep 2, 2026
44e5c93
Update pr_test.yaml
xqchen7 Sep 2, 2026
f23cdc8
Update pr_test.yaml
xqchen7 Sep 2, 2026
06615a0
Update pr_test.yaml
xqchen7 Sep 2, 2026
8f51f70
Update pr_test.yaml
xqchen7 Sep 2, 2026
f144883
Update _selected_tests.yaml
xqchen7 Sep 2, 2026
3e98b99
Update _selected_tests.yaml
xqchen7 Sep 2, 2026
eeab70f
Update pr_test.yaml
xqchen7 Sep 2, 2026
574a31f
Update pr_test.yaml
xqchen7 Sep 2, 2026
c67bb55
Refactor test group dependencies in PR workflow
xqchen7 Sep 2, 2026
cb94d8f
Update pr_test.yaml
xqchen7 Sep 2, 2026
36482e1
Update pr_test.yaml
xqchen7 Sep 2, 2026
35f8cb1
Update pr_test.yaml
xqchen7 Sep 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 2 additions & 36 deletions .github/workflows/_selected_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ jobs:
UV_SYSTEM_PYTHON: 1
steps:
- name: Check NPU availability
if: ${{ matrix.group.npu_type != 'cpu' }}
run: |
npu-smi info

Expand Down Expand Up @@ -160,7 +159,6 @@ jobs:

- name: Get csrc hash
id: get_csrc_hash
if: ${{ matrix.group.npu_type != 'cpu' }}
run: |
# Fail closed so a git error cannot be converted into sha256(empty)
# and then appear to be a legitimate cache miss.
Expand All @@ -180,7 +178,6 @@ jobs:

- name: Get architecture
id: get_arch
if: ${{ matrix.group.npu_type != 'cpu' }}
run: |
ARCH=$(uname -m)
case "$ARCH" in
Expand All @@ -191,7 +188,6 @@ jobs:

- name: Restore vllm-ascend csrc cache
id: cache-csrc
if: ${{ matrix.group.npu_type != 'cpu' }}
uses: runs-on/cache/restore@v5
with:
path: |
Expand All @@ -206,7 +202,6 @@ jobs:
fail-on-cache-miss: false

- name: Install Mooncake wheel
if: ${{ matrix.group.npu_type != 'cpu' }}
run: |
set -euxo pipefail

Expand All @@ -224,7 +219,6 @@ jobs:
pip show mooncake-transfer-engine-npu || true

- name: Install vllm-project/vllm-ascend with device
if: ${{ matrix.group.npu_type != 'cpu' }}
env:
CSRC_CACHE_HIT: ${{ steps.cache-csrc.outputs.cache-hit }}
run: |
Expand Down Expand Up @@ -258,23 +252,12 @@ jobs:
[n for n in ("chunk_gated_delta_rule_fwd_h", "chunk_fwd_o") if hasattr(ops, n)])
PY

- name: Install vllm-project/vllm-ascend no device
if: ${{ matrix.group.npu_type == 'cpu' }}
env:
SOC_VERSION: ascend910b1
COMPILE_CUSTOM_KERNELS: 0
run: |
pip install uc-manager
uv pip install -r requirements-dev.txt
uv pip install -e .

- name: Uninstall Triton for 310P tests
if: ${{ matrix.group.npu_type != 'cpu' && matrix.group.npu_type == '310p' }}
if: ${{ matrix.group.npu_type == '310p' }}
run: |
pip uninstall -y triton-ascend triton

- name: Run selected tests with device
if: ${{ matrix.group.npu_type != 'cpu' }}
continue-on-error: ${{ inputs.continue_on_error }}
env:
VLLM_WORKER_MULTIPROC_METHOD: spawn
Expand All @@ -295,25 +278,8 @@ jobs:
${TIMING_FLAG} \
${{ matrix.group.tests }}

- name: Run selected tests without device
if: ${{ matrix.group.npu_type == 'cpu' }}
continue-on-error: ${{ inputs.continue_on_error }}
env:
VLLM_WORKER_MULTIPROC_METHOD: spawn
TORCH_DEVICE_BACKEND_AUTOLOAD: 0
ENABLE_COVERAGE: ${{ inputs.enable-coverage}}
run: |
if [ "${{ inputs.enable-coverage }}" = "true" ]; then
export ENABLE_COVERAGE=true
fi
.github/workflows/scripts/run_selected_tests.sh \
"${{ matrix.group.npu_type }}" \
"${{ matrix.group.num_npus }}" \
"without-device" \
${{ matrix.group.tests }}

- name: Upload timing data
if: ${{ inputs.upload_timing && matrix.group.npu_type != 'cpu' }}
if: ${{ inputs.upload_timing }}
continue-on-error: true
uses: actions/upload-artifact@v7
with:
Expand Down
101 changes: 101 additions & 0 deletions .github/workflows/_selected_tests_cpu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Selected CPU Tests

on:
workflow_call:
inputs:
vllm:
description: vllm version string
required: true
type: string
ref:
description: PR head sha
required: true
type: string
base_ref:
description: target base branch name e.g. main
required: true
type: string
# -------- fix start --------
base_sha:
description: base commit sha, optional. empty skip rebase
required: false
default: ""
type: string
# -------- fix end --------
test_groups:
description: json test groups
required: true
type: string
outputs:
coverage_artifact_name:
value: ${{ jobs.run_tests.outputs.coverage_artifact_name }}

jobs:
run_tests:
name: cpu‑ut‑run
runs-on: ${{ fromJson(inputs.test_groups)[0].runner_label }}
outputs:
coverage_artifact_name: cpu‑coverage‑report
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
fetch-depth: 0

- name: Install python dependencies
run: |
set -euo pipefail
python3 -m ensurepip --upgrade
python3 -m pip install --upgrade pip
python3 -m pip install pytest pytest-cov

- name: Resolve source snapshot (optional rebase)
run: |
set -euo pipefail
BASE_SHA="${{ inputs.base_sha }}"
if [ -n "${BASE_SHA}" ]; then
git config user.name "ci‑runner"
git config user.email "ci@runner.local"
git rebase "${BASE_SHA}"
else
echo "INFO: base_sha is empty, skip rebase, use HEAD directly"
fi

- name: Parse test groups
id: parse_groups
run: |
set -euo pipefail
python3 - <<'PY'
import json
import os
groups = json.loads(os.environ["TEST_GROUPS"])
paths = []
for g in groups:
paths.extend(g["test_paths"])
out_paths = " ".join(paths)
with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf‑8") as f:
f.write(f"test_paths={out_paths}\n")
PY
env:
TEST_GROUPS: ${{ inputs.test_groups }}

- name: Setup python & dependencies
run: |
set -euo pipefail
python3 -m pip install --upgrade pip
python3 -m pip install pytest pytest‑cov

- name: Run pytest with coverage
run: |
set -euo pipefail
TEST_PATHS="${{ steps.parse_groups.outputs.test_paths }}"
echo "Running tests: ${TEST_PATHS}"
python3 -m pytest -v --cov=./ --cov‑report=xml:coverage.xml ${TEST_PATHS}

- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: cpu‑coverage‑report
path: coverage.xml
retention-days: 7
143 changes: 134 additions & 9 deletions .github/workflows/pr_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,67 @@ jobs:
echo "============================"
done

run-selected-tests-cpu:
needs: pre-commit
strategy:
fail-fast: false
matrix:
vllm_version:
- ${{ needs.pre-commit.outputs.main_commit }}
uses: ./.github/workflows/_selected_tests_cpu.yaml
with:
vllm: ${{ matrix.vllm_version }}
ref: ${{ github.event.pull_request.head.sha }}
base_ref: ${{ github.base_ref }}
test_groups: |
[
{
"npu_type":"cpu",
"runner_label":"linux-amd64-cpu-8-hk",
"test_paths":[
"tests/ut/_310p",
"tests/ut/_fake_weight",
"tests/ut/_tools",
"tests/ut/attention",
"tests/ut/compilation",
"tests/ut/core",
"tests/ut/device",
"tests/ut/device_allocator",
"tests/ut/distributed",
"tests/ut/eplb",
"tests/ut/helpers",
"tests/ut/kv_offload",
"tests/ut/lora",
"tests/ut/model_executor",
"tests/ut/model_loader",
"tests/ut/models",
"tests/ut/observability",
"tests/ut/ops",
"tests/ut/patch",
"tests/ut/profiler",
"tests/ut/quantization",
"tests/ut/sample",
"tests/ut/simple_kv_offload",
"tests/ut/spec_decode",
"tests/ut/tools",
"tests/ut/worker",
"tests/ut/xlite",
"tests/ut/test_ascend_config.py",
"tests/ut/test_ascend_forward_context.py",
"tests/ut/test_batch_invariant.py",
"tests/ut/test_compressed_prefix_cache.py",
"tests/ut/test_cpu_binding.py",
"tests/ut/test_dependency_documentation.py",
"tests/ut/test_envs.py",
"tests/ut/test_logger.py",
"tests/ut/test_meta_registration.py",
"tests/ut/test_platform.py",
"tests/ut/test_profiling_config.py",
"tests/ut/test_utils.py"
]
}
]

recommend-tests-from-coverage:
name: Recommend tests from coverage
needs: pre-commit
Expand Down Expand Up @@ -494,13 +555,44 @@ jobs:
base_ref: ${{ github.base_ref }}
base_sha: ${{ needs.select-tests.outputs.base_sha }}

run-selected-tests:
get_latest_real_base_sha:
runs-on: ubuntu-latest
outputs:
real_base_sha: ${{ steps.fetch_main_sha.outputs.sha }}
steps:
- name: Fetch main branch latest commit hash remotely
id: fetch_main_sha
run: |
MAIN_SHA=$(git ls-remote --heads https://github.com/vllm-project/vllm-ascend.git main | awk '{print $1}')
echo "sha=${MAIN_SHA}" >> "$GITHUB_OUTPUT"

filter-test-groups:
needs: [select-tests]
if: ${{ !cancelled() && needs.select-tests.result == 'success' }}
runs-on: linux-amd64-cpu-8-hk
container:
image: quay.io/ascend/lint-base:latest
outputs:
npu_test_groups: ${{ steps.filter.outputs.npu_test_groups }}
cpu_test_groups: ${{ steps.filter.outputs.cpu_test_groups }}
steps:
- name: Filter test groups split cpu / npu
id: filter
run: |
set -euo pipefail
RAW=${{ needs.select-tests.outputs.test_groups }}
NPU_GROUPS=$(echo "${RAW}" | jq -c '[ .[] | select(.npu_type != "cpu") ]')
CPU_GROUPS=$(echo "${RAW}" | jq -c '[ .[] | select(.npu_type == "cpu") ]')
echo "npu_test_groups=${NPU_GROUPS}" >> "${GITHUB_OUTPUT}"
echo "cpu_test_groups=${CPU_GROUPS}" >> "${GITHUB_OUTPUT}"

run-selected-npu-tests:
needs:
- get_latest_real_base_sha
- pre-commit
- select-tests
- ensure-csrc-cache
# !cancelled() overrides transitive skip-propagation from recommend-tests-from-coverage
# (skipped under ready-all) through select-tests, without running after workflow cancel.
- filter-test-groups
if: >-
${{
!cancelled() &&
Expand All @@ -522,8 +614,40 @@ jobs:
vllm: ${{ matrix.vllm_version }}
ref: ${{ github.event.pull_request.head.sha }}
base_ref: ${{ github.base_ref }}
base_sha: ${{ needs.select-tests.outputs.base_sha }}
test_groups: ${{ needs.select-tests.outputs.test_groups }}
base_sha: ${{ needs.get_latest_real_base_sha.outputs.real_base_sha }}
test_groups: ${{ needs.filter-test-groups.outputs.npu_test_groups }}
secrets: inherit

run-selected-dynamic-cpu-tests:
needs:
- get_latest_real_base_sha
- pre-commit
- select-tests
- ensure-csrc-cache
- filter-test-groups
if: >-
${{
!cancelled() &&
needs.pre-commit.result == 'success' &&
needs.ensure-csrc-cache.result == 'success' &&
(
contains(github.event.pull_request.labels.*.name, 'ready-precise') ||
contains(github.event.pull_request.labels.*.name, 'ready-all')
) &&
needs.select-tests.outputs.has_tests == 'true'
}}
strategy:
fail-fast: false
matrix:
vllm_version:
- ${{ needs.pre-commit.outputs.main_commit }}
uses: ./.github/workflows/_selected_tests_cpu.yaml
with:
vllm: ${{ matrix.vllm_version }}
ref: ${{ github.event.pull_request.head.sha }}
base_ref: ${{ github.base_ref }}
test_groups: ${{ needs.filter-test-groups.outputs.cpu_test_groups }}
secrets: inherit

run-selected-tests-upstream:
needs:
Expand Down Expand Up @@ -551,11 +675,10 @@ jobs:
base_ref: ${{ github.base_ref }}
base_sha: ${{ needs.select-tests.outputs.base_sha }}
test_groups: ${{ needs.select-tests.outputs.test_groups }}
secrets: inherit

run-selected-tests-a5:
needs: [pre-commit, select-tests]
# !cancelled() overrides transitive skip-propagation from recommend-tests-from-coverage
# (skipped under ready-all) through select-tests, without running after workflow cancel.
if: >-
${{
!cancelled() &&
Expand All @@ -573,12 +696,14 @@ jobs:
vllm: ${{ matrix.vllm_version }}
ref: ${{ github.event.pull_request.head.sha }}
base_ref: ${{ github.base_ref }}
base_sha: ${{ needs.select-tests.outputs.base_sha }}
test_groups: ${{ needs.select-tests.outputs.test_groups_a5 }}
secrets: inherit

# Summary gate job — use this single, stable name as the required status check
# in GitHub branch protection rules instead of tracking individual matrix job names.
ci-gate:
needs: [pre-commit, select-tests, run-selected-tests, run-selected-tests-a5]
needs: [pre-commit, select-tests, filter-test-groups, run-selected-npu-tests, run-selected-dynamic-cpu-tests, run-selected-tests-a5]
if: ${{ !cancelled() }}
runs-on: linux-amd64-cpu-2-hk
steps:
Expand Down Expand Up @@ -624,7 +749,7 @@ jobs:
fi

if [ "${HAS_TESTS}" = "true" ]; then
TESTS_RESULT="${{ needs.run-selected-tests.result }}"
TESTS_RESULT="${{ needs.run-selected-npu-tests.result }}"
echo "run-selected-tests: ${TESTS_RESULT}"
if [ "${HAS_READY_LABEL}" != "true" ] && [ "${HAS_READY_ALL_LABEL}" != "true" ]; then
echo "::error::Selected tests are required; add the ready-precise or ready-all label"
Expand Down
Loading