Skip to content

CI: build only job-targeted runtime platforms - #1781

Merged
ChaoZheng109 merged 2 commits into
hw-native-sys:mainfrom
doraemonmj:ci/issue-1772-job-wall-time
Aug 12, 2026
Merged

ChaoZheng109 merged 2 commits into
hw-native-sys:mainfrom
doraemonmj:ci/issue-1772-job-wall-time

Conversation

@doraemonmj

@doraemonmj doraemonmj commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add one non-cached aggregate CMake target per CI platform so CMake can build the binding and selected runtimes in one dependency graph.
  • Make sim, onboard, pod, pre-commit, profiling, and sanitizer installs omit runtime platforms they do not consume, without splitting jobs or changing test selection.
  • Remove the repeated pre-commit runtime build and ineffective CMake cache, and stabilize pip cache keys across source-only changes.
  • Provision cmake>=3.15 for every --no-build-isolation path and add a targeted-install to default-install packaging regression.

Ordinary package installs still use the default ALL target and auto-detect every available platform. Target selection is not stored in the CMake cache.

Performance

Local cold-wheel measurements show the single-platform build path reducing fixed Package/CMake time by about 40-47% with four CPUs and 11-12% on the high-core host. A recent pre-commit run spent 92 seconds in the now-removed second runtime build.

The aggregate-target Ninja log confirms the binding and runtime dependency windows overlap; scikit-build-core receives one target and therefore performs one project build rather than serially iterating a target list. Final Job p50/p90 still needs validation on matching GitHub-hosted and self-hosted runner tiers.

Testing

  • Targeted a2a3sim wheel followed by a default wheel in the same build directory; the default build adds a5sim and no platform selection remains in CMake cache
  • Four-CPU cold aggregate-target builds for the combined sim target and single-platform target
  • Ninja log inspection confirms binding/runtime overlap
  • pre-commit run --from-ref upstream/main --to-ref HEAD
  • YAML parse, bash -n tools/verify_packaging.sh, and git diff --check
  • Full GitHub-hosted and self-hosted CI

No NPU execution was needed for the local build validation.

Refs #1772

@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 909f951c-b43d-4f8c-a669-53223ef9b797

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The change adds platform-specific CMake package targets, updates reusable environment setup and CI workflows to use them, propagates pod platform selection, verifies targeted packaging, and makes pip cache keys architecture-aware.

Changes

Targeted platform build CI

Layer / File(s) Summary
Platform build target graph
CMakeLists.txt, tools/verify_packaging.sh, docs/ci.md
CMake adds platform-specific and combined runtime/package targets. Packaging verification tests targeted and default installations. CI documentation describes the target selection.
Reusable environment and workflow setup
.github/actions/setup-venv/action.yml, .github/workflows/_pre-commit.yml, .github/workflows/_profiling-flags-smoke.yml, .github/workflows/_st-*.yml, .github/workflows/_ut-*.yml, .github/workflows/sanitizers.yml
The shared environment action installs build packages before project packages. CI workflows select platform-specific targets and invoke tests through .venv/bin/python.
Pod platform propagation
.github/actions/pod-stage/action.yml, .github/workflows/_st-pod.yml
Pod staging validates the platform input and selects the matching package target. The pod workflow passes its platform to the staging action.
Architecture-aware caching
.github/actions/cache-pip/action.yml, docs/ci.md
Pip cache keys include runner architecture and hash pyproject.toml instead of all Python files.

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

Possibly related issues

Possibly related PRs

Poem

A rabbit hops through targets bright,
Builds the right platform day and night.
Caches spin with arches in tune,
Tests run from the venv moon.
“a2a3” and “a5” now know the way—
Binky-built CI saves the day!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly summarizes the main change: CI builds only the runtime platforms required by each job.
Description check ✅ Passed The description accurately covers targeted CMake builds, CI workflow updates, cache changes, performance results, and testing.

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.

@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.

Actionable comments posted: 2

🤖 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.

Inline comments:
In @.github/workflows/_st-npu-a5.yml:
- Around line 62-66: Update the DEVICE_LIST construction in the “Run pytest
scene tests (a5)” step to invoke the virtual-environment interpreter at
.venv/bin/python instead of the unqualified python command, while preserving the
existing device-range parsing and task-submit arguments.

In `@tools/verify_packaging.sh`:
- Around line 105-109: Update the packaging workflow’s setup-venv dependency
specification to pin CMake as cmake>=3.15, matching pyproject.toml, and apply
the same version-bound CMake requirement to the remaining no-build-isolation
setup command(s) in the packaging flow.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 21a20263-1204-48c2-b923-99055015dad1

📥 Commits

Reviewing files that changed from the base of the PR and between 7b3a975 and 6721d03.

📒 Files selected for processing (16)
  • .github/actions/cache-pip/action.yml
  • .github/actions/pod-stage/action.yml
  • .github/actions/setup-venv/action.yml
  • .github/workflows/_pre-commit.yml
  • .github/workflows/_profiling-flags-smoke.yml
  • .github/workflows/_st-npu-a2a3.yml
  • .github/workflows/_st-npu-a5.yml
  • .github/workflows/_st-pod.yml
  • .github/workflows/_st-sim-a2a3.yml
  • .github/workflows/_st-sim-a5.yml
  • .github/workflows/_ut-npu-a2a3.yml
  • .github/workflows/_ut-npu-a5.yml
  • .github/workflows/sanitizers.yml
  • CMakeLists.txt
  • docs/ci.md
  • tools/verify_packaging.sh

Comment thread .github/workflows/_st-npu-a5.yml Outdated
Comment thread tools/verify_packaging.sh
@doraemonmj
doraemonmj force-pushed the ci/issue-1772-job-wall-time branch 2 times, most recently from 13baf71 to b6268d6 Compare August 11, 2026 09:04
- Select one non-cached aggregate CMake target per job so CMake
  schedules binding and runtime dependencies in parallel while later
  default installs remain unchanged.
- Avoid unused or duplicate runtime builds in sim, onboard, pod,
  profiling, pre-commit, and sanitizer jobs.
- Provision versioned no-build-isolation requirements and cover
  targeted-to-default package builds in the packaging matrix.
- Drop the ineffective pre-commit CMake cache and reuse pip caches across
  source-only changes without changing coverage or job topology.
@doraemonmj
doraemonmj force-pushed the ci/issue-1772-job-wall-time branch from b6268d6 to cf71b7d Compare August 11, 2026 10:49
Comment thread .github/workflows/_st-npu-a5.yml
@ChaoZheng109
ChaoZheng109 merged commit daf581c into hw-native-sys:main Aug 12, 2026
19 checks passed
@doraemonmj
doraemonmj deleted the ci/issue-1772-job-wall-time branch August 19, 2026 02:05
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.

2 participants