Skip to content

Add: partial-good-aware AICPU thread resolution (a2a3/a5) - #1521

Open
yanghaoran29 wants to merge 1 commit into
hw-native-sys:mainfrom
yanghaoran29:aicpu-pg-a2a3-a5
Open

Add: partial-good-aware AICPU thread resolution (a2a3/a5)#1521
yanghaoran29 wants to merge 1 commit into
hw-native-sys:mainfrom
yanghaoran29:aicpu-pg-a2a3-a5

Conversation

@yanghaoran29

Copy link
Copy Markdown
Contributor

aicpu_thread_num is now derived from the probed AICPU usable count and an arch-default topology instead of a fixed user value that must stay <= usable:

  • 0 (the new CallConfig/scene_test default) = auto -> PLATFORM_DEFAULT_AICPU_THREAD_NUM (a2a3: 1 orch + 3 sched = 4; a5: 1 orch + 4 sched = 5).
  • DeviceRunner clamps it to the probed usable pool (PG/OS cores are absent from the AICPU OCCUPY bitmap), running 1 orch + fewer schedulers on a die with fewer usable AICPU, and errors if usable < 2 (need >=1 orch + 1 sched).
  • orch is always 1 (last thread), sched = total-1 (existing executor split).

validate_launch_aicpu_num allows 0 (auto). Sim resolves 0 -> arch default (no real OCCUPY/PG); onboard clamps via DeviceRunnerBase::resolve_aicpu_thread_num. hardware.md (a2a3/a5) documents the policy and aligns the "user-accessible 6" note with the active cap (4 a2a3 / 7 a5).

a5 host/device OCCUPY alignment (host 0x1fe=8 vs device 0x1f8=6) is deferred: the new a5 default 5 <= 6 device-usable covers the common case; deeper PG-degraded tolerance needs a5 onboard verification.

@coderabbitai

coderabbitai Bot commented Jul 27, 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: b2d36057-f6c0-4fe4-891b-e3c7833b7221

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

AICPU thread configuration now uses 0 as an auto sentinel, resolves platform defaults against probed usable cores, and writes the effective count back to runtime state. Examples and tests remove fixed aicpu_thread_num: 4 overrides, while documentation and default-value assertions are updated.

Changes

AICPU auto-resolution

Layer / File(s) Summary
Auto configuration contract
src/common/task_interface/call_config.h, src/common/platform/..., simpler_setup/scene_test.py
aicpu_thread_num=0 is accepted as auto, resolved against usable AICPU capacity, and validated with the updated range and failure rules.
Platform launch integration
src/a2a3/platform/..., src/a5/platform/..., src/*/docs/hardware.md
A2A3 and A5 define platform defaults, probe and clamp usable AICPU counts, recalculate scheduler counts, update runtime state, and document the resulting behavior.
Test and example migration
examples/*, tests/st/*, tests/ut/py/*, tests/task_timing/*
Fixed per-case and worker-level aicpu_thread_num: 4 overrides are removed while workload parameters, test flows, and validations remain unchanged.

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

Sequence Diagram(s)

sequenceDiagram
  participant TestCase
  participant DeviceRunner
  participant TopologyProbe
  participant Runtime
  TestCase->>DeviceRunner: submit config with aicpu_thread_num=0
  DeviceRunner->>TopologyProbe: probe usable AICPU cores
  TopologyProbe-->>DeviceRunner: return usable count
  DeviceRunner->>Runtime: write resolved thread count
  Runtime-->>TestCase: launch with resolved configuration
Loading

Possibly related PRs

Poem

A bunny hopped through cores so bright,
Let zero choose the threads just right.
Fixed fours now fade from every test,
Probed pools clamp the launch request.
“Auto!” the rabbit cheered with glee—
Runtime threads now grow with me.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 18.18% which is insufficient. The required threshold is 80.00%. 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 accurately summarizes the main change: partial-good-aware AICPU thread resolution for a2a3 and a5.
Description check ✅ Passed The description matches the changeset and clearly explains the new auto/default and clamping behavior.
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.

@yanghaoran29
yanghaoran29 force-pushed the aicpu-pg-a2a3-a5 branch 3 times, most recently from 3a46dec to 0f7adad Compare July 27, 2026 07:11

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

🤖 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 `@src/a2a3/platform/onboard/host/device_runner.cpp`:
- Around line 330-337: Keep the resolved AICPU count consistent across runtime
and launch/setup state: in src/a2a3/platform/onboard/host/device_runner.cpp
lines 330-337, propagate resolved_aicpu to launch_aicpu_num or use the updated
Runtime getter for subsequent calls; in
src/a2a3/platform/sim/host/device_runner.cpp lines 234-239 and
src/a5/platform/sim/host/device_runner.cpp lines 217-222, write each resolved
fallback value back via runtime.set_aicpu_thread_num(...).

In `@src/a2a3/platform/sim/host/device_runner.cpp`:
- Around line 234-239: After resolving the zero-value fallback in the launch
flow, write the resulting launch_aicpu_num back to the Runtime object before it
is passed to AICPU execution and setup. Update the existing runtime thread-count
state used by get_aicpu_thread_num(), while preserving configured nonzero values
and the PLATFORM_DEFAULT_AICPU_THREAD_NUM fallback.

In `@src/a5/platform/onboard/host/device_runner.cpp`:
- Around line 159-163: Update the launch_aicpu_num normalization in the device
runner to treat only aicpu_thread_num equal to zero as auto; preserve negative
values so validate_launch_aicpu_num() rejects them instead of converting them to
PLATFORM_DEFAULT_AICPU_THREAD_NUM.
- Around line 159-163: After the AICPU resolution logic that computes
resolved_aicpu, update Runtime unconditionally via
runtime.set_aicpu_thread_num(resolved_aicpu). Place this after the allowed-CPU
clamping path so both configured and auto modes publish the effective active
count, including when no adjustment branch is taken.

In `@src/a5/platform/sim/host/device_runner.cpp`:
- Around line 217-222: After resolving the platform default in the launch setup,
write the resulting launch_aicpu_num back through the Runtime setter so
runtime.get_aicpu_thread_num() matches the count used by init_l2_swimlane and
AICPU execution. Keep the existing explicit-count behavior unchanged.

In `@src/common/platform/onboard/host/device_runner_base.cpp`:
- Around line 1168-1174: Update the clamp warning in the thread-count
calculation to log desired instead of requested, so auto mode reports the
architecture default selected by the desired calculation. Preserve the existing
warning text, usable count, and scheduler count.
🪄 Autofix (Beta)

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: 8a54c647-7f3b-42da-ab4b-d4cd2bea8eac

📥 Commits

Reviewing files that changed from the base of the PR and between ae29a2c and 0f7adad.

📒 Files selected for processing (92)
  • examples/a2a3/tensormap_and_ringbuffer/benchmark_bgemm/test_benchmark_bgemm.py
  • examples/a2a3/tensormap_and_ringbuffer/merge_pipeline_barrier/test_merge_pipeline_barrier.py
  • examples/a2a3/tensormap_and_ringbuffer/paged_attention/test_paged_attention.py
  • examples/a2a3/tensormap_and_ringbuffer/paged_attention_manual_scope/test_paged_attention.py
  • examples/a2a3/tensormap_and_ringbuffer/paged_attention_ringbuffer/test_paged_attention_ringbuffer.py
  • examples/a2a3/tensormap_and_ringbuffer/paged_attention_unroll_manual_scope/test_paged_attention_unroll.py
  • examples/a2a3/tensormap_and_ringbuffer/qwen3_14b_decode/test_qwen3_14b_decode.py
  • examples/a2a3/tensormap_and_ringbuffer/scalar_data_test/test_scalar_data.py
  • examples/a2a3/tensormap_and_ringbuffer/vector_example/test_vector_example.py
  • examples/a5/tensormap_and_ringbuffer/bgemm/test_bgemm.py
  • examples/a5/tensormap_and_ringbuffer/paged_attention/test_paged_attention.py
  • examples/a5/tensormap_and_ringbuffer/paged_attention_manual_scope/test_paged_attention.py
  • examples/a5/tensormap_and_ringbuffer/paged_attention_unroll_manual_scope/test_paged_attention_unroll.py
  • examples/a5/tensormap_and_ringbuffer/vector_example/test_vector_example.py
  • python/simpler/task_interface.py
  • simpler_setup/scene_test.py
  • src/a2a3/docs/hardware.md
  • src/a2a3/platform/include/common/platform_config.h
  • src/a2a3/platform/onboard/host/device_runner.cpp
  • src/a2a3/platform/sim/host/device_runner.cpp
  • src/a5/docs/hardware.md
  • src/a5/platform/include/common/platform_config.h
  • src/a5/platform/onboard/host/device_runner.cpp
  • src/a5/platform/sim/host/device_runner.cpp
  • src/common/platform/onboard/host/device_runner_base.cpp
  • src/common/platform/onboard/host/device_runner_base.h
  • src/common/platform/sim/host/device_runner_base.cpp
  • src/common/task_interface/call_config.h
  • tests/st/a2a3/host_build_graph/available_aicore_counts/test_available_aicore_counts.py
  • tests/st/a2a3/host_build_graph/bgemm/test_bgemm.py
  • tests/st/a2a3/host_build_graph/dfx/dep_gen/test_dep_gen.py
  • tests/st/a2a3/host_build_graph/dump_args/test_dump_args_example.py
  • tests/st/a2a3/host_build_graph/matmul/test_matmul.py
  • tests/st/a2a3/host_build_graph/paged_attention/test_paged_attention.py
  • tests/st/a2a3/host_build_graph/prepared_callable/test_prepared_callable.py
  • tests/st/a2a3/host_build_graph/run_stream_reuse/test_run_stream_reuse.py
  • tests/st/a2a3/host_build_graph/vector_example/test_vector_example.py
  • tests/st/a2a3/tensormap_and_ringbuffer/alternating_matmul_add/test_alternating_matmul_add.py
  • tests/st/a2a3/tensormap_and_ringbuffer/available_aicore_counts/test_available_aicore_counts.py
  • tests/st/a2a3/tensormap_and_ringbuffer/batch_paged_attention/test_batch_paged_attention.py
  • tests/st/a2a3/tensormap_and_ringbuffer/dfx/args_dump/test_args_dump.py
  • tests/st/a2a3/tensormap_and_ringbuffer/dfx/dep_gen/test_dep_gen.py
  • tests/st/a2a3/tensormap_and_ringbuffer/dfx/l2_swimlane/test_l2_swimlane.py
  • tests/st/a2a3/tensormap_and_ringbuffer/dfx/l2_swimlane/test_l2_swimlane_mixed.py
  • tests/st/a2a3/tensormap_and_ringbuffer/dfx/pmu/test_pmu.py
  • tests/st/a2a3/tensormap_and_ringbuffer/dfx/scope_stats/test_scope_stats.py
  • tests/st/a2a3/tensormap_and_ringbuffer/dynamic_register/test_dynamic_register.py
  • tests/st/a2a3/tensormap_and_ringbuffer/fanin_lookup_perf/test_fanin_lookup_perf.py
  • tests/st/a2a3/tensormap_and_ringbuffer/mixed_example/test_mixed_example.py
  • tests/st/a2a3/tensormap_and_ringbuffer/multi_round_paged_attention/test_multi_round_paged_attention.py
  • tests/st/a2a3/tensormap_and_ringbuffer/orch_so_cache/test_orch_so_cache.py
  • tests/st/a2a3/tensormap_and_ringbuffer/paged_attention_unroll/test_paged_attention_unroll.py
  • tests/st/a2a3/tensormap_and_ringbuffer/paged_attention_unroll_4dims/test_paged_attention_unroll_4dims.py
  • tests/st/a2a3/tensormap_and_ringbuffer/prepared_callable/test_prepared_callable.py
  • tests/st/a2a3/tensormap_and_ringbuffer/spmd_basic/test_spmd_basic.py
  • tests/st/a2a3/tensormap_and_ringbuffer/spmd_batch_dispatch_oob/test_spmd_batch_dispatch_oob.py
  • tests/st/a2a3/tensormap_and_ringbuffer/spmd_multiblock_aiv/test_spmd_multiblock_aiv.py
  • tests/st/a2a3/tensormap_and_ringbuffer/spmd_multiblock_mix/test_spmd_multiblock_mix.py
  • tests/st/a2a3/tensormap_and_ringbuffer/spmd_paged_attention/test_spmd_paged_attention.py
  • tests/st/a2a3/tensormap_and_ringbuffer/spmd_paged_attention_highperf/test_spmd_paged_attention_highperf.py
  • tests/st/a2a3/tensormap_and_ringbuffer/spmd_starvation/test_spmd_starvation.py
  • tests/st/a2a3/tensormap_and_ringbuffer/spmd_sync_start/test_spmd_sync_start.py
  • tests/st/a2a3/tensormap_and_ringbuffer/spmd_sync_start_aiv/test_spmd_sync_start_aiv.py
  • tests/st/a2a3/tensormap_and_ringbuffer/spmd_sync_start_early_dispatch/test_spmd_sync_start_early_dispatch.py
  • tests/st/a2a3/tensormap_and_ringbuffer/spmd_sync_start_edge/test_spmd_sync_start_edge.py
  • tests/st/a2a3/tensormap_and_ringbuffer/spmd_sync_start_stress/test_spmd_sync_start_stress.py
  • tests/st/a2a3/tensormap_and_ringbuffer/test_l3_dependency.py
  • tests/st/a2a3/tensormap_and_ringbuffer/test_l3_group.py
  • tests/st/a5/tensormap_and_ringbuffer/available_aicore_counts/test_available_aicore_counts.py
  • tests/st/a5/tensormap_and_ringbuffer/dfx/args_dump/test_args_dump.py
  • tests/st/a5/tensormap_and_ringbuffer/dfx/dep_gen/test_dep_gen.py
  • tests/st/a5/tensormap_and_ringbuffer/dfx/l2_swimlane/test_l2_swimlane.py
  • tests/st/a5/tensormap_and_ringbuffer/dfx/l2_swimlane/test_l2_swimlane_mixed.py
  • tests/st/a5/tensormap_and_ringbuffer/dfx/pmu/test_pmu.py
  • tests/st/a5/tensormap_and_ringbuffer/dfx/scope_stats/test_scope_stats.py
  • tests/st/a5/tensormap_and_ringbuffer/mixed_example/test_mixed_example.py
  • tests/st/a5/tensormap_and_ringbuffer/orch_so_cache/test_orch_so_cache.py
  • tests/st/a5/tensormap_and_ringbuffer/paged_attention_unroll/test_paged_attention_unroll.py
  • tests/st/a5/tensormap_and_ringbuffer/prepared_callable/test_prepared_callable.py
  • tests/st/a5/tensormap_and_ringbuffer/simt_basic/test_simt_basic.py
  • tests/st/a5/tensormap_and_ringbuffer/spmd_basic/test_spmd_basic.py
  • tests/st/a5/tensormap_and_ringbuffer/spmd_multiblock_aiv/test_spmd_multiblock_aiv.py
  • tests/st/a5/tensormap_and_ringbuffer/spmd_multiblock_mix/test_spmd_multiblock_mix.py
  • tests/st/a5/tensormap_and_ringbuffer/spmd_starvation/test_spmd_starvation.py
  • tests/st/a5/tensormap_and_ringbuffer/spmd_sync_start/test_spmd_sync_start.py
  • tests/st/a5/tensormap_and_ringbuffer/spmd_sync_start_aiv/test_spmd_sync_start_aiv.py
  • tests/st/a5/tensormap_and_ringbuffer/spmd_sync_start_early_dispatch/test_spmd_sync_start_early_dispatch.py
  • tests/st/a5/tensormap_and_ringbuffer/spmd_sync_start_edge/test_spmd_sync_start_edge.py
  • tests/st/a5/tensormap_and_ringbuffer/spmd_sync_start_mix_spill/test_spmd_sync_start_mix_spill.py
  • tests/st/a5/tensormap_and_ringbuffer/spmd_sync_start_stress/test_spmd_sync_start_stress.py
  • tests/st/task_timing/task_timing_slots/test_task_timing_e2e.py
  • tests/ut/py/test_chip_worker.py
💤 Files with no reviewable changes (72)
  • tests/st/a5/tensormap_and_ringbuffer/spmd_starvation/test_spmd_starvation.py
  • examples/a2a3/tensormap_and_ringbuffer/benchmark_bgemm/test_benchmark_bgemm.py
  • tests/st/a2a3/tensormap_and_ringbuffer/alternating_matmul_add/test_alternating_matmul_add.py
  • examples/a2a3/tensormap_and_ringbuffer/merge_pipeline_barrier/test_merge_pipeline_barrier.py
  • examples/a5/tensormap_and_ringbuffer/vector_example/test_vector_example.py
  • tests/st/a2a3/tensormap_and_ringbuffer/dfx/l2_swimlane/test_l2_swimlane.py
  • tests/st/a5/tensormap_and_ringbuffer/mixed_example/test_mixed_example.py
  • examples/a2a3/tensormap_and_ringbuffer/scalar_data_test/test_scalar_data.py
  • tests/st/a5/tensormap_and_ringbuffer/spmd_sync_start_aiv/test_spmd_sync_start_aiv.py
  • tests/st/a5/tensormap_and_ringbuffer/spmd_multiblock_aiv/test_spmd_multiblock_aiv.py
  • tests/st/a5/tensormap_and_ringbuffer/spmd_sync_start/test_spmd_sync_start.py
  • tests/st/a5/tensormap_and_ringbuffer/available_aicore_counts/test_available_aicore_counts.py
  • tests/st/a5/tensormap_and_ringbuffer/dfx/pmu/test_pmu.py
  • tests/st/a2a3/tensormap_and_ringbuffer/spmd_sync_start/test_spmd_sync_start.py
  • tests/st/a2a3/tensormap_and_ringbuffer/spmd_sync_start_aiv/test_spmd_sync_start_aiv.py
  • tests/st/a2a3/tensormap_and_ringbuffer/available_aicore_counts/test_available_aicore_counts.py
  • tests/st/a5/tensormap_and_ringbuffer/dfx/args_dump/test_args_dump.py
  • tests/st/a5/tensormap_and_ringbuffer/dfx/l2_swimlane/test_l2_swimlane.py
  • examples/a2a3/tensormap_and_ringbuffer/paged_attention_ringbuffer/test_paged_attention_ringbuffer.py
  • tests/st/a2a3/tensormap_and_ringbuffer/spmd_starvation/test_spmd_starvation.py
  • tests/st/a5/tensormap_and_ringbuffer/spmd_basic/test_spmd_basic.py
  • tests/st/a5/tensormap_and_ringbuffer/dfx/l2_swimlane/test_l2_swimlane_mixed.py
  • tests/st/a2a3/tensormap_and_ringbuffer/spmd_multiblock_mix/test_spmd_multiblock_mix.py
  • tests/st/a2a3/host_build_graph/bgemm/test_bgemm.py
  • tests/st/a5/tensormap_and_ringbuffer/prepared_callable/test_prepared_callable.py
  • tests/st/a5/tensormap_and_ringbuffer/spmd_sync_start_early_dispatch/test_spmd_sync_start_early_dispatch.py
  • tests/st/a5/tensormap_and_ringbuffer/dfx/scope_stats/test_scope_stats.py
  • tests/st/a2a3/tensormap_and_ringbuffer/dfx/scope_stats/test_scope_stats.py
  • tests/st/a2a3/host_build_graph/vector_example/test_vector_example.py
  • tests/st/a2a3/tensormap_and_ringbuffer/spmd_sync_start_early_dispatch/test_spmd_sync_start_early_dispatch.py
  • examples/a2a3/tensormap_and_ringbuffer/qwen3_14b_decode/test_qwen3_14b_decode.py
  • tests/st/a5/tensormap_and_ringbuffer/spmd_sync_start_mix_spill/test_spmd_sync_start_mix_spill.py
  • tests/st/a2a3/tensormap_and_ringbuffer/dfx/l2_swimlane/test_l2_swimlane_mixed.py
  • tests/st/a5/tensormap_and_ringbuffer/paged_attention_unroll/test_paged_attention_unroll.py
  • tests/st/a2a3/host_build_graph/matmul/test_matmul.py
  • examples/a2a3/tensormap_and_ringbuffer/vector_example/test_vector_example.py
  • tests/st/a2a3/tensormap_and_ringbuffer/spmd_sync_start_edge/test_spmd_sync_start_edge.py
  • tests/st/a2a3/host_build_graph/available_aicore_counts/test_available_aicore_counts.py
  • tests/st/a2a3/tensormap_and_ringbuffer/dfx/args_dump/test_args_dump.py
  • tests/st/a2a3/tensormap_and_ringbuffer/spmd_sync_start_stress/test_spmd_sync_start_stress.py
  • tests/st/a2a3/tensormap_and_ringbuffer/spmd_batch_dispatch_oob/test_spmd_batch_dispatch_oob.py
  • examples/a2a3/tensormap_and_ringbuffer/paged_attention_unroll_manual_scope/test_paged_attention_unroll.py
  • tests/st/a2a3/tensormap_and_ringbuffer/multi_round_paged_attention/test_multi_round_paged_attention.py
  • tests/st/a2a3/host_build_graph/prepared_callable/test_prepared_callable.py
  • tests/st/a2a3/tensormap_and_ringbuffer/dfx/pmu/test_pmu.py
  • tests/st/a5/tensormap_and_ringbuffer/spmd_sync_start_stress/test_spmd_sync_start_stress.py
  • examples/a5/tensormap_and_ringbuffer/paged_attention_manual_scope/test_paged_attention.py
  • tests/st/a5/tensormap_and_ringbuffer/spmd_multiblock_mix/test_spmd_multiblock_mix.py
  • tests/st/a2a3/host_build_graph/dump_args/test_dump_args_example.py
  • tests/st/a2a3/tensormap_and_ringbuffer/paged_attention_unroll/test_paged_attention_unroll.py
  • examples/a2a3/tensormap_and_ringbuffer/paged_attention/test_paged_attention.py
  • tests/st/a2a3/host_build_graph/paged_attention/test_paged_attention.py
  • tests/st/a2a3/tensormap_and_ringbuffer/dfx/dep_gen/test_dep_gen.py
  • tests/st/a2a3/tensormap_and_ringbuffer/mixed_example/test_mixed_example.py
  • examples/a5/tensormap_and_ringbuffer/bgemm/test_bgemm.py
  • tests/st/a2a3/tensormap_and_ringbuffer/paged_attention_unroll_4dims/test_paged_attention_unroll_4dims.py
  • tests/st/a2a3/tensormap_and_ringbuffer/spmd_basic/test_spmd_basic.py
  • tests/st/a5/tensormap_and_ringbuffer/spmd_sync_start_edge/test_spmd_sync_start_edge.py
  • tests/st/a5/tensormap_and_ringbuffer/orch_so_cache/test_orch_so_cache.py
  • tests/st/a2a3/tensormap_and_ringbuffer/spmd_paged_attention_highperf/test_spmd_paged_attention_highperf.py
  • tests/st/a5/tensormap_and_ringbuffer/dfx/dep_gen/test_dep_gen.py
  • examples/a5/tensormap_and_ringbuffer/paged_attention_unroll_manual_scope/test_paged_attention_unroll.py
  • tests/st/task_timing/task_timing_slots/test_task_timing_e2e.py
  • tests/st/a2a3/host_build_graph/dfx/dep_gen/test_dep_gen.py
  • examples/a5/tensormap_and_ringbuffer/paged_attention/test_paged_attention.py
  • tests/st/a2a3/tensormap_and_ringbuffer/spmd_multiblock_aiv/test_spmd_multiblock_aiv.py
  • tests/st/a2a3/tensormap_and_ringbuffer/orch_so_cache/test_orch_so_cache.py
  • tests/st/a2a3/tensormap_and_ringbuffer/fanin_lookup_perf/test_fanin_lookup_perf.py
  • tests/st/a2a3/tensormap_and_ringbuffer/spmd_paged_attention/test_spmd_paged_attention.py
  • tests/st/a2a3/tensormap_and_ringbuffer/dynamic_register/test_dynamic_register.py
  • tests/st/a2a3/tensormap_and_ringbuffer/batch_paged_attention/test_batch_paged_attention.py
  • tests/st/a2a3/tensormap_and_ringbuffer/prepared_callable/test_prepared_callable.py

Comment thread src/a2a3/platform/onboard/host/device_runner.cpp
Comment thread src/a2a3/platform/sim/host/device_runner.cpp
Comment thread src/a5/platform/onboard/host/device_runner.cpp Outdated
Comment thread src/a5/platform/sim/host/device_runner.cpp
Comment thread src/common/platform/onboard/host/device_runner_base.cpp
@yanghaoran29
yanghaoran29 force-pushed the aicpu-pg-a2a3-a5 branch 3 times, most recently from 561e54d to 4bb36f8 Compare July 27, 2026 11:28
aicpu_thread_num is now derived from the probed AICPU usable count and an
arch-default topology instead of a fixed user value that must stay <= usable:

- 0 (the new CallConfig/scene_test default) = auto ->
  PLATFORM_DEFAULT_AICPU_THREAD_NUM (a2a3: 1 orch + 3 sched = 4; a5: 1 orch +
  4 sched = 5).
- DeviceRunner clamps it to the probed usable pool (PG/OS cores are absent
  from the AICPU OCCUPY bitmap), running 1 orch + fewer schedulers on a die
  with fewer usable AICPU, and errors if usable < 2 (need >=1 orch + 1 sched).
- orch is always 1 (last thread), sched = total-1 (existing executor split).

validate_launch_aicpu_num allows 0 (auto). Sim resolves 0 -> arch default
(no real OCCUPY/PG) and writes the effective count back to Runtime so AICPU
init / DFX match the launch gate; onboard clamps via
DeviceRunnerBase::resolve_aicpu_thread_num and always publishes the resolved
count (a5 auto no longer leaves Runtime at the 0 sentinel). a5 normalizes
only ==0 as auto so negatives still fail validation. Clamp warnings log the
resolved desired count.
prepared_callable ST helpers use case.get("config", {}) after dropping the
fixed aicpu_thread_num override from CASES.
hardware.md (a2a3/a5) documents the policy and aligns the "user-accessible 6"
note with the active cap (4 a2a3 / 7 a5).

a5 host/device OCCUPY alignment (host 0x1fe=8 vs device 0x1f8=6) is deferred:
the new a5 default 5 <= 6 device-usable covers the common case; deeper
PG-degraded tolerance needs a5 onboard verification.
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