diff --git a/.github/workflows/_st-npu-a2a3.yml b/.github/workflows/_st-npu-a2a3.yml index cfe0f1ca1..38b564561 100644 --- a/.github/workflows/_st-npu-a2a3.yml +++ b/.github/workflows/_st-npu-a2a3.yml @@ -19,11 +19,6 @@ on: required: false default: false type: boolean - a2a3_sdma_mode: - description: marker for main CI, legacy-paths for the CPU emergency lane. - required: false - default: marker - type: string jobs: run: @@ -50,15 +45,7 @@ jobs: system-site-packages: "true" source-cann: "true" - - name: Warn when graphviz is missing - if: inputs.include_dfx_smokes - run: | - if ! command -v dot >/dev/null 2>&1; then - echo "::warning::graphviz 'dot' not found on PATH; deps_viewer tool smoke will skip. Install graphviz on this self-hosted runner to restore coverage." - fi - - name: Run pytest scene tests (a2a3) - if: inputs.a2a3_sdma_mode == 'marker' run: | source /usr/local/Ascend/cann/set_env.sh source .venv/bin/activate @@ -69,21 +56,7 @@ jobs: --run "python -m pytest examples tests/st -m 'not sdma' --platform a2a3 --device \$TASK_DEVICE -v --require-pto-isa --pto-session-timeout 600" fi - - name: Run pytest scene tests (a2a3 legacy SDMA paths) - if: inputs.a2a3_sdma_mode == 'legacy-paths' - run: | - source /usr/local/Ascend/cann/set_env.sh - source .venv/bin/activate - SDMA_IGNORE="--ignore=examples/a2a3/tensormap_and_ringbuffer/prefetch_async_demo --ignore=examples/a2a3/tensormap_and_ringbuffer/sdma_async_completion_demo" - if [ "$(uname -m)" = "x86_64" ]; then - python -m pytest examples tests/st $SDMA_IGNORE --platform a2a3 --device ${DEVICE_RANGE} -v --require-pto-isa --pto-session-timeout 600 - else - task-submit --timeout 1800 --max-time 1800 --device auto --device-num "$DEVICE_NUM" \ - --run "python -m pytest examples tests/st $SDMA_IGNORE --platform a2a3 --device \$TASK_DEVICE -v --require-pto-isa --pto-session-timeout 600" - fi - - name: SDMA pytest (a2a3) - if: inputs.a2a3_sdma_mode == 'marker' run: | source /usr/local/Ascend/cann/set_env.sh source .venv/bin/activate @@ -95,19 +68,6 @@ jobs: --run "python -m pytest $SDMA_TESTS --platform a2a3 --device \$TASK_DEVICE -v --require-pto-isa --pto-session-timeout 600" fi - - name: SDMA pytest (a2a3 legacy paths) - if: inputs.a2a3_sdma_mode == 'legacy-paths' - run: | - source /usr/local/Ascend/cann/set_env.sh - source .venv/bin/activate - SDMA_TESTS="examples/a2a3/tensormap_and_ringbuffer/prefetch_async_demo examples/a2a3/tensormap_and_ringbuffer/sdma_async_completion_demo" - if [ "$(uname -m)" = "x86_64" ]; then - python -m pytest $SDMA_TESTS --platform a2a3 --device ${DEVICE_RANGE} -v --require-pto-isa --pto-session-timeout 600 - else - task-submit --timeout 1800 --max-time 1800 --device auto --device-num 2 \ - --run "python -m pytest $SDMA_TESTS --platform a2a3 --device \$TASK_DEVICE -v --require-pto-isa --pto-session-timeout 600" - fi - - name: dep_gen smoke (a2a3) if: inputs.include_dfx_smokes run: | diff --git a/.github/workflows/ci-self-cpu.yml b/.github/workflows/ci-self-cpu.yml index 5446e6ac1..2a2b770a0 100644 --- a/.github/workflows/ci-self-cpu.yml +++ b/.github/workflows/ci-self-cpu.yml @@ -149,7 +149,6 @@ jobs: ref: ${{ inputs.ref || github.sha }} runs_on: '["self-hosted","a2a3"]' include_dfx_smokes: false - a2a3_sdma_mode: legacy-paths ut-a5: needs: [detect-changes] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 633b62b1e..cfe284d7c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -110,7 +110,6 @@ jobs: with: runs_on: '["self-hosted","a2a3"]' include_dfx_smokes: true - a2a3_sdma_mode: marker # The only job that spans two machines. It is arch-specific and the most # expensive thing in this file, so it gates exactly as st-onboard-a2a3 does — diff --git a/docs/ci.md b/docs/ci.md index a43bd8165..6413da346 100644 --- a/docs/ci.md +++ b/docs/ci.md @@ -32,9 +32,11 @@ shape. The executable job bodies live in reusable workflows: `_st-sim-a5.yml`, `_ut-npu-a2a3.yml`, `_ut-npu-a5.yml`, `_st-npu-a2a3.yml`, `_st-npu-a5.yml`, and `_st-pod.yml`. The scene-test and NPU unit-test bodies are split one workflow per architecture so each job -renders only its own steps. Shared step scaffolding that is safe to run -after checkout lives in composite actions under `.github/actions/` -(`cache-pip`, `setup-venv`, and the three `pod-*` actions). +renders only its own steps. The main CI keeps the onboard NPU DFX smokes in +the base onboard scene-test jobs rather than in separate follow-on jobs. +Shared step scaffolding that is safe to run after checkout lives in composite +actions under `.github/actions/` (`cache-pip`, `setup-venv`, and the three +`pod-*` actions). ```text PullRequest @@ -186,7 +188,7 @@ not need `--max-parallel` manually. - `detect-changes` is implemented once in [`.github/workflows/_detect-changes.yml`](../.github/workflows/_detect-changes.yml) and computes four axes from the PR diff — non-code (`non_code_only`), architecture (`a2a3_changed` / `a5_changed`), test category (`st_affected` / `ut_affected`), and corpus (`examples_only` / `tests_only`) — **all of them derived from one `NON_CODE` set**: `docs/`, `.docs/`, `.claude/`, `mkdocs.yml`, `.github/workflows/docs.yml`, `.gitignore`, `.pre-commit-config.yaml`, and any `*.md` file anywhere. Membership follows a file's *effect*, not its path — `mkdocs.yml` and `docs.yml` are docs tooling that happens to live outside `docs/`. An arch flag is `false` only when every changed file is in the opposite platform's tree (`src/{arch}/`, `examples/{arch}/`, `tests/{st,ut/cpp}/{arch}/`) or in `NON_CODE`. Anything else — shared C++ (`src/common/`), Python (`python/`, `simpler_setup/`), build files (`CMakeLists.txt`, `pyproject.toml`), shared test infra (`tests/ut/py/`, `tests/lint/`), tooling (`tools/`), or any CI implementation workflow (`.github/workflows/ci.yml`, `.github/workflows/ci-self-cpu.yml`, `.github/workflows/_*.yml`) — flips both flags to `true`. CI implementation workflows are deliberately excluded from `NON_CODE`: a change to the gates or reusable job bodies must run everything, including whatever it just switched off. - **Test-category axis:** `ST_ONLY='^(tests/st/|examples/)'` and `UT_ONLY='^tests/ut/'`, applied in the same shape as the arch patterns — a category is unaffected only when *every* changed file is exclusively the other's. `st_affected` gates the four scene-test jobs; `ut_affected` gates `ut`, `ut-a2a3`, `ut-a5`. Anything belonging to neither (root `conftest.py`, `pyproject.toml`, `simpler_setup/`, `tests/lint/`) flips both, so shared infrastructure always runs both suites. - **Corpus axis:** `EXAMPLES_ONLY='^examples/'` and `TESTS_ONLY='^(tests/)'`, same shape again, one per side of the product jobs' payload. `packaging-matrix` and `profiling-flags-smoke` build and install the product and then exercise it with a fixed, tiny payload — one entry-point script (a `tests/st/` file) and one `vector_example` — so neither reads either suite as a corpus, and a diff confined to `examples/` or to `tests/` cannot reach them: `wheel.packages` is `["simpler_setup", "python/simpler"]`, so both partitions are provably absent from the product. A payload file changed under either is still exercised by the scene-test job that reads the same corpus. -- **Gated jobs (scene tests):** `st-sim-{a2a3,a5}`, `st-onboard-{a2a3,a5}` run iff their platform's flag **and** `st_affected` are `true`. +- **Gated jobs (scene tests):** `st-sim-{a2a3,a5}`, `st-onboard-{a2a3,a5}`, and `st-pod-onboard-a2a3` run iff their platform's flag **and** `st_affected` are `true`. - **Platform-independent jobs (all UT + packaging):** `ut`, `ut-a2a3`, `ut-a5`, `packaging-matrix` ignore the *platform* flags — unit tests exercise shared contracts (nanobind bindings, RuntimeBuilder, ring buffers, etc.) and the risk of silently skipping a regression outweighs the CI minutes saved. The `tests/ut/cpp/{arch}/` entry in the gating regex only *attributes* an arch-specific C++ UT change to that platform (so it does not spuriously flip the other arch's scene-test flag); it does not gate the UT jobs themselves. The three UT jobs do respect `ut_affected`, which is a statement about test category rather than silicon. `packaging-matrix` respects the corpus axis, which is a statement about which corpus a job reads: neither `examples/` nor `tests/` is in `wheel.packages`, so a diff confined to either partition cannot change what the packaging job builds. - **`non_code_only` is the same `NON_CODE` set, not a narrower one.** It is `true` when no changed file falls outside it. Nothing in the set can change what the code does, and no workflow consumes any of it beyond its own gate: `pre-commit` is ungated so it always exercises `.pre-commit-config.yaml`, `docs.yml` is unconditional on every PR so it always exercises `mkdocs.yml` / `docs/`, and **no workflow invokes anything under `.claude/`** (`grep -rn '\.claude' .github/workflows/` finds only comments). An **empty diff short-circuits the whole step**: attribution is impossible, so a single guard sets `non_code_only=false`, every arch and category flag `true`, and both corpus flags (`examples_only`, `tests_only`) `false`, then returns — running the full matrix, packaging and the profiling smoke included. That guard is deliberately one place; testing emptiness per flag is what previously left `non_code_only` false while both arch flags also came out false, running UT and packaging but skipping every scene test.