Skip to content

Add: host_build_graph copies of the paged_attention examples - #1667

Open
noabauma wants to merge 1 commit into
hw-native-sys:mainfrom
huawei-csl:hbg_pa
Open

Add: host_build_graph copies of the paged_attention examples#1667
noabauma wants to merge 1 commit into
hw-native-sys:mainfrom
huawei-csl:hbg_pa

Conversation

@noabauma

@noabauma noabauma commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

paged_attention and paged_attention_manual_scope existed only for tensormap_and_ringbuffer. pto_orchestration_api.h is byte-identical between the two runtimes and compile_orchestration() selects the include dirs of whichever runtime @scene_test names, so the kernels and orchestration C++ are unchanged copies; the delta is the runtime= decorator, the class name, and ring sizing.

host_build_graph builds the whole graph before the device schedules anything, so nothing is reclaimed mid-orchestration and the entire graph must be resident. Case1 (65792 tasks) and Case2 (32832) therefore carry ring_task_window/ring_heap in their own CASES[]["config"]["runtime_env"], needing no PTO2_RING_ env var.

Case3 (head_dim 256) is omitted: it fails on both runtimes, giving max_diff=nan here and max_diff=0.1255 on the unmodified tensormap_and_ringbuffer example, with a normal 16 ms device_wall and no allocator fatal. That is a pre-existing kernel numerics defect at head_dim > 128, not a property of this runtime.

Validated on a2a3 with golden checking: 12/12 cases pass across both examples.

paged_attention and paged_attention_manual_scope existed only for
tensormap_and_ringbuffer. pto_orchestration_api.h is byte-identical between the
two runtimes and compile_orchestration() selects the include dirs of whichever
runtime @scene_test names, so the kernels and orchestration C++ are unchanged
copies; the delta is the runtime= decorator, the class name, and ring sizing.

host_build_graph builds the whole graph before the device schedules anything, so
nothing is reclaimed mid-orchestration and the entire graph must be resident.
Case1 (65792 tasks) and Case2 (32832) therefore carry ring_task_window/ring_heap
in their own CASES[*]["config"]["runtime_env"], needing no PTO2_RING_* env var.

Case3 (head_dim 256) is omitted: it fails on both runtimes, giving max_diff=nan
here and max_diff=0.1255 on the unmodified tensormap_and_ringbuffer example, with
a normal 16 ms device_wall and no allocator fatal. That is a pre-existing kernel
numerics defect at head_dim > 128, not a property of this runtime.

Validated on a2a3 with golden checking: 12/12 cases pass across both examples.
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@noabauma, 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: 4718a891-a228-430c-902e-9db9f9fc8684

📥 Commits

Reviewing files that changed from the base of the PR and between b5261a7 and bf4a58d.

📒 Files selected for processing (14)
  • examples/a2a3/host_build_graph/paged_attention/README.md
  • examples/a2a3/host_build_graph/paged_attention/kernels/aic/aic_pv_matmul.cpp
  • examples/a2a3/host_build_graph/paged_attention/kernels/aic/aic_qk_matmul.cpp
  • examples/a2a3/host_build_graph/paged_attention/kernels/aiv/aiv_online_update.cpp
  • examples/a2a3/host_build_graph/paged_attention/kernels/aiv/aiv_softmax_prepare.cpp
  • examples/a2a3/host_build_graph/paged_attention/kernels/orchestration/paged_attention_orch.cpp
  • examples/a2a3/host_build_graph/paged_attention/test_paged_attention.py
  • examples/a2a3/host_build_graph/paged_attention_manual_scope/README.md
  • examples/a2a3/host_build_graph/paged_attention_manual_scope/kernels/aic/aic_pv_matmul.cpp
  • examples/a2a3/host_build_graph/paged_attention_manual_scope/kernels/aic/aic_qk_matmul.cpp
  • examples/a2a3/host_build_graph/paged_attention_manual_scope/kernels/aiv/aiv_online_update.cpp
  • examples/a2a3/host_build_graph/paged_attention_manual_scope/kernels/aiv/aiv_softmax_prepare.cpp
  • examples/a2a3/host_build_graph/paged_attention_manual_scope/kernels/orchestration/paged_attention_orch.cpp
  • examples/a2a3/host_build_graph/paged_attention_manual_scope/test_paged_attention_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.

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