Skip to content

Update: select A5 cluster ownership from trusted topology - #2183

Open
yanghaoran29 wants to merge 1 commit into
hw-native-sys:mainfrom
yanghaoran29:feat/a5-topology-cluster-partition
Open

Update: select A5 cluster ownership from trusted topology#2183
yanghaoran29 wants to merge 1 commit into
hw-native-sys:mainfrom
yanghaoran29:feat/a5-topology-cluster-partition

Conversation

@yanghaoran29

Copy link
Copy Markdown
Contributor

Summary

  • Select balanced contiguous AICore cluster ownership when live CPU_TOPO or a verified JSON fallback fully matches the device OCCUPY pool.
  • Preserve round-robin ownership for incomplete, unavailable, or unmatched topology.
  • Carry the internal mode through both A5 runtimes and cover topology selection and partition boundaries.

Testing

  • test_a5_aicpu_topology_fallback
  • Syntax checks for both A5 scheduler cold paths
  • clang-format --dry-run --Werror and git diff --check
  • Onboard hardware validation (not run)

@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Review Change StackReview 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: Advanced

Run ID: ca273bed-ab09-4482-9f0a-0508e78a5252

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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: ac01272d-e998-4d58-ab72-958c733a420a

📥 Commits

Reviewing files that changed from the base of the PR and between a1aa7fd and 8de8fed.

📒 Files selected for processing (14)
  • src/a5/docs/hardware.md
  • src/a5/platform/include/common/scheduler_cluster_partition.h
  • src/a5/platform/onboard/host/aicpu_topology_probe.cpp
  • src/a5/platform/onboard/host/aicpu_topology_probe.h
  • src/a5/platform/onboard/host/device_runner.cpp
  • src/a5/runtime/host_build_graph/runtime/scheduler/scheduler_cold_path.cpp
  • src/a5/runtime/host_build_graph/runtime/scheduler/scheduler_context.h
  • src/a5/runtime/tensormap_and_ringbuffer/runtime/runtime.h
  • src/a5/runtime/tensormap_and_ringbuffer/runtime/scheduler/scheduler_cold_path.cpp
  • src/a5/runtime/tensormap_and_ringbuffer/runtime/scheduler/scheduler_context.h
  • src/a5/runtime/tensormap_and_ringbuffer/runtime/shared/runtime.cpp
  • src/common/host_build_graph/runtime.h
  • src/common/host_build_graph/shared/runtime.cpp
  • tests/ut/cpp/a5/test_aicpu_topology_fallback.cpp

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change adds topology-aware scheduler cluster assignment. Validated topology selects contiguous ownership. Other topology states retain round-robin ownership. Runtime state, scheduler paths, diagnostics, tests, and hardware documentation now support both modes.

Changes

Scheduler cluster assignment

Layer / File(s) Summary
Partition policy contract
src/a5/platform/include/common/scheduler_cluster_partition.h
Defines round-robin and contiguous assignment modes, cluster ranges, ownership helpers, and invalid-input behavior.
Topology validation and selection
src/a5/platform/onboard/host/aicpu_topology_probe.*, src/a5/platform/onboard/host/device_runner.cpp, tests/ut/cpp/a5/test_aicpu_topology_fallback.cpp, src/a5/docs/hardware.md
Validates topology coverage, selects contiguous or round-robin assignment, publishes the result to runtime, logs the mode, and tests the selection rules.
Runtime assignment propagation
src/a5/runtime/tensormap_and_ringbuffer/runtime/*, src/common/host_build_graph/runtime.*
Adds runtime storage, launch-descriptor state, default initialization, and assignment accessors.
Scheduler ownership integration
src/a5/runtime/host_build_graph/runtime/scheduler/*, src/a5/runtime/tensormap_and_ringbuffer/runtime/scheduler/*
Uses the configured assignment for ownership, ranges, handshaking, diagnostics, cluster traversal, and assignment logging.

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

Merge Risk: ⚪ Minimal · up to 8de8f

A5 scheduler ownership now uses balanced contiguous cluster ranges only for validated topology and preserves round-robin ownership for invalid or incomplete topology. The current change is ready to merge.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 35.56% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 45 functions across 13 files. (1 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: selecting A5 cluster ownership from trusted topology.
Description check ✅ Passed The description directly explains topology-based contiguous assignment, round-robin fallback behavior, runtime propagation, and testing.
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 35.56% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 45 functions across 13 files. (1 skipped: 1 unsupported.)


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

I twitch my nose at clusters bright
Contiguous hops now land just right
Round-robin guards the uncertain trail
Runtime carries the chosen tale
Tiny tests confirm each rail

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

@yanghaoran29
yanghaoran29 force-pushed the feat/a5-topology-cluster-partition branch from 8de8fed to 9c16fc0 Compare September 10, 2026 03:37
Use balanced contiguous cluster ranges when CPU_TOPO or a verified JSON fallback exactly matches OCCUPY.

Preserve round-robin ownership for incomplete or unmatched topology, carry the internal mode through both A5 runtimes, and keep the shared host-build-graph type visible to all platform builds.
@yanghaoran29
yanghaoran29 force-pushed the feat/a5-topology-cluster-partition branch from 9c16fc0 to ade4b4f Compare September 10, 2026 06:17
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