Skip to content

Fix: parallelize A5 dummy task resolution - #1679

Open
yanghaoran29 wants to merge 1 commit into
hw-native-sys:mainfrom
yanghaoran29:fix/parallelize-a5-dummy-task-resolution
Open

Fix: parallelize A5 dummy task resolution#1679
yanghaoran29 wants to merge 1 commit into
hw-native-sys:mainfrom
yanghaoran29:fix/parallelize-a5-dummy-task-resolution

Conversation

@yanghaoran29

@yanghaoran29 yanghaoran29 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • let all four default A5 scheduler threads drain dependency-only tasks
  • reduce the per-thread dummy batch from 16 to 8 to distribute queue work
  • rely on the MPMC ready queue and per-slot atomic fanout path for safe concurrent resolution

Performance

Measured sequentially on the same Ascend950PR device through task-submit; both variants use batch 8, default aicpu_thread_num=5, independent worktrees/venvs, and 100 rounds per workload.

Workload Metric 1 scheduler 4 schedulers Change
4096 dummy, shared producer Effective 4369.7 us 4254.3 us -2.64%
4096 dummy, shared producer Sched 4363.7 us 4247.0 us -2.67%
4096 immediately-ready dummy Effective 4558.5 us 4533.4 us -0.55%
4096 immediately-ready dummy Sched 4551.6 us 4526.4 us -0.55%

The shared-producer workload shows a modest improvement. The immediately-ready result is within the +/-2% noise margin; shared queue and per-slot atomic contention limit scaling.

Testing

  • targeted pre-commit on scheduler_dispatch.cpp: passed
  • A5Sim dummy scene test after rebasing to latest main: passed
  • Ascend950PR onboard dummy scene test through task-submit: passed
  • two 4096-dummy hardware benchmarks, 100 rounds per single/four-scheduler variant

Addresses A3 of #1582.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The scheduler now drains dummy dependency-only tasks on scheduler threads 0–3 in batches of eight. The dummy-task test matrix removes per-case AICPU thread settings and adds a dense fanout/fanin case.

Changes

Dummy-task scheduler execution

Layer / File(s) Summary
Scheduler ready-queue draining
src/a5/runtime/tensormap_and_ringbuffer/runtime/scheduler/scheduler_dispatch.cpp
Dummy dependency-only tasks are drained on scheduler threads 0–3. The per-iteration batch size changes from 16 to 8.
Dummy-task test coverage
tests/st/a5/tensormap_and_ringbuffer/dummy_task/test_dummy_task.py
Existing cases remove per-case aicpu_thread_num settings. Case 4 adds DenseFanoutFanin.

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

Possibly related PRs

Poem

A rabbit watched four schedulers run,
While eight-task batches moved as one.
Dense fanout joined the queue,
With fanin waiting neatly too.
“Hop!” said Bunny, “the tests are done.”

🚥 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 and concisely describes the main change: parallelizing A5 dummy task resolution.
Description check ✅ Passed The description directly explains the scheduler changes, queue behavior, benchmarks, and tests.

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 fix/parallelize-a5-dummy-task-resolution branch 2 times, most recently from aaa9270 to 3bb95af Compare August 4, 2026 11:27
Allow all four default A5 scheduler threads to share dependency-only
task resolution through the MPMC ready queue and per-slot atomic fanout
path. Use smaller batches to distribute work across schedulers.
@yanghaoran29
yanghaoran29 force-pushed the fix/parallelize-a5-dummy-task-resolution branch from 3bb95af to ddeb769 Compare August 5, 2026 03:55
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