Skip to content

ci(a2a3): run pytest/ctest directly on X64 runners, task-submit on ARM64#1361

Merged
ChaoWao merged 4 commits into
mainfrom
ci/a2a3-x64-runner-no-task-submit
Jul 14, 2026
Merged

ci(a2a3): run pytest/ctest directly on X64 runners, task-submit on ARM64#1361
ChaoWao merged 4 commits into
mainfrom
ci/a2a3-x64-runner-no-task-submit

Conversation

@ChaoWao

@ChaoWao ChaoWao commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Why

The a2a3 self-hosted pool now spans two runner kinds:

Runner Arch task-submit? Cards
runner-dev4-7, runner-dev8-11 ARM64 yes shared host
infra-gpu-npu-021, infra-gpu-npu-021-2 X64 no exclusive to the runner

A single runs-on: [self-hosted, a2a3] job can land on either pool, so the per-device lock can no longer be unconditional — task-submit is not installed on the X64 runners and their cards are already exclusive to the runner.

What

  • Add RUNNER_ARCH: ${{ runner.arch }} to ut-a2a3 and st-onboard-a2a3.
  • Branch every a2a3 NPU-touching step (7 total: UT py + C++, scene tests + 4 DFX smokes) on runner.arch:
    • X64 → run pytest/ctest directly with --device ${DEVICE_RANGE}
    • ARM64 → keep the task-submit --device <list> --run "..." wrapper (shared host)
  • a5 is ARM64-only and unchanged.
  • docs/ci.md "Hardware Classification" paragraph updated: the old "every step runs through task-submit" claim no longer holds for X64.

No runs-on change — both pools stay eligible, which is the point (X64 adds capacity, ARM64 keeps working). Build-only steps (cmake, RuntimeBuilder, the cann-examples smokes) already take no lock and are unchanged.

🤖 Generated with Claude Code

The a2a3 self-hosted pool now spans two runner kinds: the existing ARM64
hosts (shared with interactive users) and new X64 hosts whose cards are
exclusive to the runner and which have no `task-submit` installed. A single
`runs-on: [self-hosted, a2a3]` job can land on either, so the per-device
lock must be conditional.

Branch every a2a3 NPU-touching step on `runner.arch`: X64 runs pytest/ctest
directly with `--device ${DEVICE_RANGE}`; ARM64 keeps the
`task-submit --device ... --run` wrapper. a5 is ARM64-only and unchanged.
docs/ci.md's "every step runs through task-submit" claim is updated to match.

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

a2a3 hardware tests now run directly on x86_64 runners and through task-submit on other architectures. CI documentation records the corresponding device-locking rules for a2a3, a5, build-only steps, and local onboard work.

Changes

a2a3 execution routing

Layer / File(s) Summary
Architecture-conditional hardware test commands
.github/workflows/ci.yml
Python, C++, scene, and DFX smoke tests run directly on x86_64; other architectures use task-submit with the existing device lists and timeouts.
Device-locking guidance
docs/ci.md
Documentation distinguishes ARM64 and X64 a2a3 behavior, states that a5 is ARM64-only, and clarifies lock handling for build-only and local onboard steps.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Poem

A bunny hops where test cards gleam,
Direct on X64, queued on ARM’s stream.
Devices lock, timeouts chime,
Smoke tests race in orderly time.
“Binky!” says the rabbit, “CI is prime!”

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: architecture-based a2a3 CI execution on X64 versus ARM64.
Description check ✅ Passed The description is detailed and directly describes the workflow and docs changes in this pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the CI documentation in docs/ci.md to clarify how self-hosted runners handle device locking, distinguishing between ARM64 a2a3 runners (which use task-submit) and X64 a2a3 runners (which run tests directly). The review feedback suggests improving the phrasing and formatting of the description for X64 a2a3 runners to be more professional and consistent.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread docs/ci.md Outdated
ChaoWao and others added 3 commits July 14, 2026 18:07
`runner.arch` is not available in the `env` context (only github, inputs,
matrix, needs, secrets, strategy, vars), so `RUNNER_ARCH: ${{ runner.arch }}`
failed GitHub's workflow compile with a "workflow file issue". Detect the
host arch in shell with `uname -m` instead — context-independent and it
matches the arch the host .so is actually compiled for (x86_64 vs aarch64).

Co-Authored-By: Claude <noreply@anthropic.com>
The a2a3 step branches on `uname -m`, not the `runner.arch` context
(which isn't available where the original wording implied). Wording only.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@ChaoWao ChaoWao merged commit cddf2b6 into main Jul 14, 2026
2 of 3 checks passed
@ChaoWao ChaoWao deleted the ci/a2a3-x64-runner-no-task-submit branch July 14, 2026 12:30

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)

488-493: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Update the .claude/rules/running-onboard.md reference.

As per the relevant code snippets provided, .claude/rules/running-onboard.md states that "CI always wraps pytest in task-submit". Since this PR introduces an exception for x86_64 runners, consider updating that document to reflect the new architecture-aware execution model so that AI assistants maintain an accurate understanding of the CI contracts.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml around lines 488 - 493, Update the CI execution
guidance in running-onboard.md to document that pytest runs directly on x86_64
runners and uses task-submit on other architectures. Replace the statement that
CI always wraps pytest in task-submit while preserving the existing command and
architecture-specific behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.github/workflows/ci.yml:
- Around line 488-493: Update the CI execution guidance in running-onboard.md to
document that pytest runs directly on x86_64 runners and uses task-submit on
other architectures. Replace the statement that CI always wraps pytest in
task-submit while preserving the existing command and architecture-specific
behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3eeb5441-4d7c-4a6a-83a9-6be8278f4590

📥 Commits

Reviewing files that changed from the base of the PR and between 2cf189b and 1ba83c9.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • docs/ci.md

doraemonmj pushed a commit to doraemonmj/simpler_wc that referenced this pull request Jul 15, 2026
…M64 (hw-native-sys#1361)

The a2a3 self-hosted pool now spans two runner kinds: the existing ARM64
hosts (shared with interactive users) and new X64 hosts whose cards are
exclusive to the runner and which have no `task-submit` installed. A single
`runs-on: [self-hosted, a2a3]` job can land on either, so the per-device
lock must be conditional.

Branch every a2a3 NPU-touching step on `runner.arch`: X64 runs pytest/ctest
directly with `--device ${DEVICE_RANGE}`; ARM64 keeps the
`task-submit --device ... --run` wrapper. a5 is ARM64-only and unchanged.
docs/ci.md's "every step runs through task-submit" claim is updated to match.
ChaoZheng109 added a commit to ChaoZheng109/simpler that referenced this pull request Jul 15, 2026
host_build_graph runs its orchestration .so on the host CPU, so
compile_orchestration() builds it with the bare host g++. The orch
compile unconditionally links the onboard AICPU helpers device_time.cpp
and cache_ops.cpp, whose bodies are aarch64-only inline asm
(mrs cntvct_el0, dc civac/cvac, dsb, isb).

On an ARM64 runner the host g++ targets aarch64, so the asm assembled
and the latent host-arch assumption stayed hidden. hw-native-sys#1361 made
st-onboard-a2a3 eligible for x86_64 runners; there the host g++ feeds
aarch64 asm to the x86 assembler and every host_build_graph L2 test
fails with "Orchestration compilation failed ... no such instruction:
mrs %rax,cntvct_el0".

Gate the asm behind __aarch64__ and add a host-portable else branch:
- device_time: derive the sys-cnt tick from std::chrono::steady_clock,
  scaled to the same PLATFORM_PROF_SYS_CNT_FREQ unit the DFX markers
  decode against. steady_clock (matching device_time_now_ticks() in
  device_time.h) is monotonic; the ticks feed unsigned deltas in the
  orchestrator poll loops (get_sys_cnt_aicpu() - t0), where a backward
  clock jump would underflow into a false timeout.
- cache_ops: no-op. The host orchestrator reaches device memory only
  through driver H2D DMA (cache-coherent on x86), so the AICPU-side
  manual cache maintenance has no host-side referent.

aarch64 (device AICPU and ARM64-host orchestration) is unchanged; only
the x86 host build gains a compilable path.
ChaoZheng109 added a commit to ChaoZheng109/simpler that referenced this pull request Jul 15, 2026
host_build_graph runs its orchestration .so on the host CPU, so
compile_orchestration() builds it with the bare host g++. The orch
compile unconditionally links the onboard AICPU helpers device_time.cpp
and cache_ops.cpp, whose bodies are aarch64-only inline asm
(mrs cntvct_el0, dc civac/cvac, dsb, isb).

On an ARM64 runner the host g++ targets aarch64, so the asm assembled
and the latent host-arch assumption stayed hidden. hw-native-sys#1361 made
st-onboard-a2a3 eligible for x86_64 runners; there the host g++ feeds
aarch64 asm to the x86 assembler and every host_build_graph L2 test
fails with "Orchestration compilation failed ... no such instruction:
mrs %rax,cntvct_el0".

Gate the asm behind __aarch64__ and add a host-portable else branch:
- device_time: get_sys_cnt_aicpu() now delegates the clock read to
  device_time_now_ticks() (monotonic steady_clock off aarch64), then
  rescales ns to the PLATFORM_PROF_SYS_CNT_FREQ unit it reports in, so
  the orchestrator's cycle-based timeouts (get_sys_cnt_aicpu() - t0 >
  ..._CYCLES) and DFX decode stay valid. The prior sim variant used the
  non-monotonic high_resolution_clock; unify both on device_time_now_ticks().
- cache_ops: no-op off aarch64. The host orchestrator reaches device
  memory only through driver H2D DMA (cache-coherent on x86), so the
  AICPU-side manual cache maintenance has no host-side referent.

aarch64 (device AICPU and ARM64-host orchestration) is behaviorally
unchanged; only the x86 host build gains a compilable path.
ChaoZheng109 added a commit that referenced this pull request Jul 15, 2026
host_build_graph runs its orchestration .so on the host CPU, so
compile_orchestration() builds it with the bare host g++. The orch
compile unconditionally links the onboard AICPU helpers device_time.cpp
and cache_ops.cpp, whose bodies are aarch64-only inline asm
(mrs cntvct_el0, dc civac/cvac, dsb, isb).

On an ARM64 runner the host g++ targets aarch64, so the asm assembled
and the latent host-arch assumption stayed hidden. #1361 made
st-onboard-a2a3 eligible for x86_64 runners; there the host g++ feeds
aarch64 asm to the x86 assembler and every host_build_graph L2 test
fails with "Orchestration compilation failed ... no such instruction:
mrs %rax,cntvct_el0".

Gate the asm behind __aarch64__ and add a host-portable else branch:
- device_time: get_sys_cnt_aicpu() now delegates the clock read to
  device_time_now_ticks() (monotonic steady_clock off aarch64), then
  rescales ns to the PLATFORM_PROF_SYS_CNT_FREQ unit it reports in, so
  the orchestrator's cycle-based timeouts (get_sys_cnt_aicpu() - t0 >
  ..._CYCLES) and DFX decode stay valid. The prior sim variant used the
  non-monotonic high_resolution_clock; unify both on device_time_now_ticks().
- cache_ops: no-op off aarch64. The host orchestrator reaches device
  memory only through driver H2D DMA (cache-coherent on x86), so the
  AICPU-side manual cache maintenance has no host-side referent.

aarch64 (device AICPU and ARM64-host orchestration) is behaviorally
unchanged; only the x86 host build gains a compilable path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant