Skip to content

CI: adapt DFX smokes to allocated device count - #1753

Merged
ChaoZheng109 merged 1 commit into
hw-native-sys:mainfrom
doraemonmj:support/adapt-dfx-smokes-to-allocated-device-count
Aug 10, 2026
Merged

ChaoZheng109 merged 1 commit into
hw-native-sys:mainfrom
doraemonmj:support/adapt-dfx-smokes-to-allocated-device-count

Conversation

@doraemonmj

Copy link
Copy Markdown
Contributor

Summary

  • consolidate the a2a3 and a5 onboard DFX smokes in one composite action
  • schedule smokes across the allocated devices while preventing overlap on each device
  • support one through four device allocations and preserve per-smoke logs and exit status
  • document the adaptive scheduling behavior

Testing

  • python -m pytest tests/ut -q (1295 passed, 19 skipped)
  • all pre-commit hooks passed
  • onboard hardware was not run locally because this runner cannot query NPU inventory; CI will exercise the action

@coderabbitai

coderabbitai Bot commented Aug 10, 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: f46a5cb6-e519-4725-b26c-77b6efbc18c3

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

Adds a shared composite action for A2A3 and A5 onboard DFX smokes. The action validates devices, schedules four feature jobs with per-device serialization, captures results, and reports failures. Workflows, CI documentation, and A5 scheduling tests are updated.

Changes

Adaptive DFX smoke orchestration

Layer / File(s) Summary
Action contract and device setup
.github/actions/run-onboard-dfx-smokes/action.yml
The action accepts a2a3 or a5, initializes the required environment, activates the virtual environment, and validates distinct numeric devices.
Job scheduling and smoke selection
.github/actions/run-onboard-dfx-smokes/action.yml
The action schedules platform-specific smoke groups, assigns devices round-robin, serializes jobs per device, captures logs, and retains exit codes.
Platform dispatch and workflow integration
.github/actions/run-onboard-dfx-smokes/action.yml, .github/workflows/_st-npu-a2a3.yml, .github/workflows/_st-npu-a5.yml
Execution uses local or task-submit paths based on platform and architecture. Both workflows replace individual smoke steps with the shared action.
Scheduling validation and CI documentation
tests/ut/py/test_run_onboard_dfx_smokes_action.py, docs/ci.md
The test verifies adaptive A5 scheduling, device coverage, parallelism, and non-overlap. CI documentation describes the new smoke behavior.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Workflow
  participant DFXAction as run-onboard-dfx-smokes
  participant Devices
  participant Pytest
  Workflow->>DFXAction: invoke for a2a3 or a5
  DFXAction->>Devices: validate and assign devices
  DFXAction->>Pytest: run serialized smoke jobs
  Pytest-->>DFXAction: return logs and exit codes
  DFXAction-->>Workflow: report grouped results
Loading

Possibly related PRs

Poem

A rabbit queues four tests in flight,
Each device stays locked just right.
Logs hop neatly into view,
A2A3 and A5 pass through.
Failures wait till all are done—
Then carrots celebrate the run!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adapting DFX smokes to the number of allocated devices.
Description check ✅ Passed The description directly explains the composite action, adaptive scheduling, device serialization, logging, documentation, and testing.
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.

@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: 1

🧹 Nitpick comments (1)
tests/ut/py/test_run_onboard_dfx_smokes_action.py (1)

126-130: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert the documented round-robin distribution.

These assertions prove device coverage, but they do not prove round-robin assignment. For three devices, an assignment of 7, 8, 9, 8 passes but violates the action contract.

Assert the expected invocation count for each device.

Proposed test update
     assert len(invocations) == 4
     for device in range(7, 7 + device_count):
-        assert any(f"--device {device}" in invocation for invocation in invocations)
+        assert sum(f"--device {device}" in invocation for invocation in invocations) == (
+            4 // device_count + (device - 7 < 4 % device_count)
+        )
     assert (state_dir / "parallel").exists() == (device_count > 1)
🤖 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 `@tests/ut/py/test_run_onboard_dfx_smokes_action.py` around lines 126 - 130,
Update the assertions in the onboarding smoke test around invocations to verify
the documented round-robin distribution, not just device coverage: count
occurrences of each device in the invocation list and assert the expected
per-device counts for the configured invocation total and device_count. Preserve
the existing parallel-state assertion and use the test’s existing
invocation/device-count symbols.
🤖 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 `@docs/ci.md`:
- Around line 265-267: Update the DFX smoke allocation documentation to state
that the A5 schedule has four smoke groups, while A2A3 additionally schedules
the dep_gen (host_build_graph) smoke when platform is a2a3. Clarify the capacity
impact of this fifth A2A3-only smoke in the section describing
run-onboard-dfx-smokes.

---

Nitpick comments:
In `@tests/ut/py/test_run_onboard_dfx_smokes_action.py`:
- Around line 126-130: Update the assertions in the onboarding smoke test around
invocations to verify the documented round-robin distribution, not just device
coverage: count occurrences of each device in the invocation list and assert the
expected per-device counts for the configured invocation total and device_count.
Preserve the existing parallel-state assertion and use the test’s existing
invocation/device-count symbols.
🪄 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: 6cc3bd60-acc8-4eb8-a5e4-9b0a68e80f99

📥 Commits

Reviewing files that changed from the base of the PR and between 1f0f006 and e60ac84.

📒 Files selected for processing (5)
  • .github/actions/run-onboard-dfx-smokes/action.yml
  • .github/workflows/_st-npu-a2a3.yml
  • .github/workflows/_st-npu-a5.yml
  • docs/ci.md
  • tests/ut/py/test_run_onboard_dfx_smokes_action.py

Comment thread docs/ci.md
@doraemonmj
doraemonmj force-pushed the support/adapt-dfx-smokes-to-allocated-device-count branch from e60ac84 to 86d61d0 Compare August 10, 2026 03:47
- Share one composite action between a2a3 and a5 onboard workflows.
- Serialize each device lane while independent lanes run concurrently.
- Document the fifth a2a3 smoke and round-robin device reuse.
- Cover one through four allocations and their distribution in a hermetic test.
@doraemonmj

Copy link
Copy Markdown
Contributor Author

@coderabbitai Addressed:

  • Documented the fifth a2a3-only host-build-graph dep_gen smoke and its capacity impact.
  • Strengthened the hermetic test to assert the exact round-robin invocation count per device.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

@doraemonmj Confirmed. The documentation now includes the fifth a2a3-only smoke and its capacity impact. The hermetic test now verifies the exact round-robin count for each device.


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

You are interacting with an AI system.

@ChaoZheng109
ChaoZheng109 merged commit a4801a0 into hw-native-sys:main Aug 10, 2026
19 checks passed
@doraemonmj
doraemonmj deleted the support/adapt-dfx-smokes-to-allocated-device-count branch August 10, 2026 06:33
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