Skip to content

Fix: drop the stale N_UNROLL value from the unroll orchestration headers - #1572

Merged
ChaoWao merged 1 commit into
hw-native-sys:mainfrom
ChaoWao:fix/n-unroll-stale-header-comment
Jul 29, 2026
Merged

Fix: drop the stale N_UNROLL value from the unroll orchestration headers#1572
ChaoWao merged 1 commit into
hw-native-sys:mainfrom
ChaoWao:fix/n-unroll-stale-header-comment

Conversation

@ChaoWao

@ChaoWao ChaoWao commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Four copies of the unroll paged-attention orchestration open with

 * Paged Attention Orchestration Function V2 - N_UNROLL=8, 4 Tasks Per Group

while #define N_UNROLL 64 sits twenty lines below. The comment has been wrong since the constant was raised, and it is the first line a reader sees.

The value is dropped rather than corrected to 64. The next line already reads "Batches up to N_UNROLL blocks per group" with no number, and the #define is the only place the value belongs — restating it in prose is exactly what let the two drift apart. Per .claude/rules/comments.md, a comment should state a fact that survives on its own.

All four copies land in one commit:

  • examples/a2a3/tensormap_and_ringbuffer/paged_attention_unroll_manual_scope/
  • examples/a5/tensormap_and_ringbuffer/paged_attention_unroll_manual_scope/
  • tests/st/a2a3/tensormap_and_ringbuffer/paged_attention_unroll/
  • tests/st/a5/tensormap_and_ringbuffer/paged_attention_unroll/

The paged_attention_unroll_manual_scope README (added in #1571) called out the discrepancy; that sentence goes with it, so the docs do not describe a state that no longer exists.

Found by scanning examples/, tests/, and src/ for #define NAME <int> whose value disagrees with a NAME = <int> mention elsewhere in the same file. These four were the only true positives.

Testing

  • grep -rn "N_UNROLL=8" returns nothing repo-wide
  • #define N_UNROLL 64 unchanged in all four files
  • clang-format --output-replacements-xml clean on all four .cpp
  • Comment-only — no compiled token changes

Note for rebasing: #1475 touches two of these files and #1521 touches five paths under paged_attention_unroll*. The overlap here is a single comment line in each.

Four copies of the unroll paged-attention orchestration open with
"Paged Attention Orchestration Function V2 - N_UNROLL=8, 4 Tasks Per Group"
while `#define N_UNROLL 64` sits twenty lines below. The comment has been
wrong since the constant was raised, and it is the first line a reader sees.

The value is dropped rather than corrected to 64. The line below already says
"Batches up to N_UNROLL blocks per group" without a number, and the `#define`
is the only place the value belongs — restating it in prose is what let the
two drift apart.

All four copies land together: `examples/{a2a3,a5}/.../
paged_attention_unroll_manual_scope/` and `tests/st/{a2a3,a5}/.../
paged_attention_unroll/`. `grep -rn "N_UNROLL=8"` now returns nothing.

The `paged_attention_unroll_manual_scope` README noted the discrepancy; that
sentence goes with it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2c2dfb3a-302a-4858-a686-b2c04d5bf3bd

📥 Commits

Reviewing files that changed from the base of the PR and between 7e66f46 and f4e5e48.

📒 Files selected for processing (5)
  • examples/a2a3/tensormap_and_ringbuffer/paged_attention_unroll_manual_scope/README.md
  • examples/a2a3/tensormap_and_ringbuffer/paged_attention_unroll_manual_scope/kernels/orchestration/paged_attention_orch.cpp
  • examples/a5/tensormap_and_ringbuffer/paged_attention_unroll_manual_scope/kernels/orchestration/paged_attention_orch.cpp
  • tests/st/a2a3/tensormap_and_ringbuffer/paged_attention_unroll/kernels/orchestration/paged_attention_orch.cpp
  • tests/st/a5/tensormap_and_ringbuffer/paged_attention_unroll/kernels/orchestration/paged_attention_orch.cpp

📝 Walkthrough

Walkthrough

The changes align paged attention orchestration comments and README text with the current unroll configuration. Executable code, interfaces, control flow, and runtime behavior remain unchanged.

Changes

Paged attention documentation alignment

Layer / File(s) Summary
Align unroll configuration documentation
examples/.../paged_attention_unroll_manual_scope/README.md, examples/.../kernels/orchestration/paged_attention_orch.cpp, tests/st/.../paged_attention_unroll/kernels/orchestration/paged_attention_orch.cpp
Comments remove obsolete N_UNROLL=8 wording, and the README and A5 test comment identify the effective N_UNROLL=64 configuration.
Estimated code review effort: 1 (Trivial) ~2 minutes

Poem

I’m a rabbit with a tidy pen,
Aligning notes from eight to ten—
Well, sixty-four beneath the hood,
Four tasks grouped as they should.
No code hopped; the docs look good!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: removing the stale N_UNROLL value from orchestration headers.
Description check ✅ Passed The description directly matches the patch and explains the comment-only cleanup across the affected files.
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.

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.

@ChaoWao
ChaoWao merged commit 823d0bc into hw-native-sys:main Jul 29, 2026
18 checks passed
@ChaoWao
ChaoWao deleted the fix/n-unroll-stale-header-comment branch July 29, 2026 08:20
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