Skip to content

Add: benchmark manual-scope paged attention on host build graph - #1786

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

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

Conversation

@doraemonmj

Copy link
Copy Markdown
Contributor

Summary

  • Add the host_build_graph counterpart of paged_attention_unroll_manual_scope Case1 and Case2.
  • Keep the TMR parameters, tolerances, argument generation, golden, and compute graph unchanged while reusing its orchestration and incore sources.
  • Complete the QK and PV callable signatures in both wrappers with the block_table input they actually consume.
  • 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 28.921 -> 44.572 ms +54.11% 1.334 -> 1.266 ms -5.11%
Case2 10.645 -> 16.529 ms +55.27% 0.716 -> 0.666 ms -6.95%

Paired device-wall changes (95% CI): Case1 -5.08% (-7.71% to -2.39%); Case2 -6.94% (-8.96% to -4.88%). HBG is consistently faster on device; the measured host increase is in bind and validation, while runner time is unchanged within noise.

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_005307_2205262883 (NPU 3, exit 0).

Testing

  • HBG and TMR Case1/Case2 onboard golden: task_20260811_004958_11579646241
  • Case3 diagnosis on both runtimes: task_20260811_005131_18023031684 (both reproduce the existing golden failure)
  • Eight-pair onboard performance comparison
  • All pre-commit hooks for the changed files

Port Case1 and Case2 with matching parameters and golden behavior while
reusing the tensormap-and-ringbuffer orchestration and incore sources.

Complete the QK and PV callable signatures with the block-table input so
both runtime wrappers match the graph they execute.

Case3 remains excluded because the shared head-dimension-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: 4d122f18-2790-4385-9f77-883ab6bb609f

📥 Commits

Reviewing files that changed from the base of the PR and between 9a8b9d0 and 2e8cba9.

📒 Files selected for processing (2)
  • examples/a2a3/host_build_graph/paged_attention_unroll_manual_scope/test_paged_attention_unroll_manual_scope.py
  • examples/a2a3/tensormap_and_ringbuffer/paged_attention_unroll_manual_scope/test_paged_attention_unroll_manual_scope.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 0194fde into hw-native-sys:main Aug 11, 2026
16 checks passed
@doraemonmj
doraemonmj deleted the add/hbg-paged-attention-unroll-manual-scope 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