Skip to content

Add: benchmark batch paged attention on host build graph - #1787

Merged
ChaoZheng109 merged 1 commit into
hw-native-sys:mainfrom
doraemonmj:add/hbg-batch-paged-attention
Aug 11, 2026
Merged

Add: benchmark batch paged attention on host build graph#1787
ChaoZheng109 merged 1 commit into
hw-native-sys:mainfrom
doraemonmj:add/hbg-batch-paged-attention

Conversation

@doraemonmj

Copy link
Copy Markdown
Contributor

Summary

  • Add the host_build_graph counterpart of the seven golden-valid batch_paged_attention cases.
  • Keep the TMR parameters, callable signatures, tolerances, argument generation, and shared golden unchanged.
  • Reuse the existing TMR orchestration and incore kernel sources directly so both runtimes execute the same graph.
  • Give the production-scale Case1 and Case2 graphs a 512 MiB HBG heap.
  • Leave Case3 out because its shared head_dim=256 kernels fail golden on both runtimes.

This is one workload-sized part of #1727.

Performance

Measured on one locked a2a3 NPU through task-submit: eight adjacent TMR/HBG pairs, alternating order, ten rounds per process and case, with each case's first round excluded (72 steady samples per runtime/case).

Case Host total: TMR -> HBG Change Device wall: TMR -> HBG Change
Case1 32.728 -> 48.890 ms +49.38% 4.272 -> 3.518 ms -17.64%
Case2 17.214 -> 21.865 ms +27.02% 7.262 -> 5.222 ms -28.09%

Paired device-wall changes (95% CI): Case1 -17.56% (-21.68% to -13.45%); Case2 -28.09% (-29.09% to -27.09%). HBG device wall and runner time are consistently faster; the host increase comes from bind and validation.

These measurements used simpler base 7b3a9754 and PTO-ISA pin 0cefc9a5a1c24c62655cc345d408559595a8af32. Main later merged #1763, which removes redundant HBG arena initialization and explicitly leaves device time unchanged; the device comparison remains representative, while the host/bind values above are conservative pre-#1763 measurements.

Performance job: task_20260811_005329_223032522760 (NPU 5, exit 0).

Testing

  • Five applicable simulation cases, including manual cases
  • Seven HBG onboard golden cases: task_20260811_005217_201289318187
  • TMR Case3 diagnosis: task_20260811_005052_157499517775 (reproduces the existing golden failure)
  • Eight-pair onboard performance comparison
  • All pre-commit hooks for the changed file

Port the seven golden-valid cases with the same parameters, signatures,
and shared golden as the tensormap-and-ringbuffer scene. Reuse its
orchestration and incore sources so both runtimes execute the same graph.

Give the two production-scale graphs a 512 MiB heap. Case3 remains
excluded because the shared head_dim=256 kernels fail golden on both
runtimes.
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@doraemonmj, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 59 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: aa653720-e58a-4e41-a16f-9813f449e309

📥 Commits

Reviewing files that changed from the base of the PR and between 9a8b9d0 and 299a0ad.

📒 Files selected for processing (1)
  • tests/st/a2a3/host_build_graph/batch_paged_attention/test_batch_paged_attention.py

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.

@ChaoZheng109
ChaoZheng109 merged commit c5a5874 into hw-native-sys:main Aug 11, 2026
16 checks passed
@doraemonmj
doraemonmj deleted the add/hbg-batch-paged-attention branch August 18, 2026 02:48
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