From f4e5e489f06a5f75a7543897945b73d1b8f5a229 Mon Sep 17 00:00:00 2001 From: Chao Wang <26245345+ChaoWao@users.noreply.github.com> Date: Wed, 29 Jul 2026 00:42:10 -0700 Subject: [PATCH] Fix: drop the stale N_UNROLL value from the unroll orchestration headers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .../paged_attention_unroll_manual_scope/README.md | 3 +-- .../kernels/orchestration/paged_attention_orch.cpp | 2 +- .../kernels/orchestration/paged_attention_orch.cpp | 2 +- .../kernels/orchestration/paged_attention_orch.cpp | 2 +- .../kernels/orchestration/paged_attention_orch.cpp | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/examples/a2a3/tensormap_and_ringbuffer/paged_attention_unroll_manual_scope/README.md b/examples/a2a3/tensormap_and_ringbuffer/paged_attention_unroll_manual_scope/README.md index 4f896aa6b2..9c2def5681 100644 --- a/examples/a2a3/tensormap_and_ringbuffer/paged_attention_unroll_manual_scope/README.md +++ b/examples/a2a3/tensormap_and_ringbuffer/paged_attention_unroll_manual_scope/README.md @@ -34,8 +34,7 @@ Softmax becomes a two-pass over a wider buffer, which is why that kernel is rewritten rather than adjusted. `N_UNROLL` is a `#define` at the top of the orchestration source, currently -**64**. (The file's header comment still says `N_UNROLL=8`; the `#define` is -what takes effect.) +**64**. Dependencies are declared explicitly inside `PTO2_SCOPE(PTO2ScopeMode::MANUAL)`, using the primitive diff --git a/examples/a2a3/tensormap_and_ringbuffer/paged_attention_unroll_manual_scope/kernels/orchestration/paged_attention_orch.cpp b/examples/a2a3/tensormap_and_ringbuffer/paged_attention_unroll_manual_scope/kernels/orchestration/paged_attention_orch.cpp index 82bc89f374..dbeddf4574 100644 --- a/examples/a2a3/tensormap_and_ringbuffer/paged_attention_unroll_manual_scope/kernels/orchestration/paged_attention_orch.cpp +++ b/examples/a2a3/tensormap_and_ringbuffer/paged_attention_unroll_manual_scope/kernels/orchestration/paged_attention_orch.cpp @@ -9,7 +9,7 @@ * ----------------------------------------------------------------------------------------------------------- */ /** - * Paged Attention Orchestration Function V2 - N_UNROLL=8, 4 Tasks Per Group + * Paged Attention Orchestration Function V2 - 4 Tasks Per Group * * Batches up to N_UNROLL blocks per group. Each group submits exactly 4 tasks: * 1. QK matmul: qi @ K^T for n_blocks → sij_buf (q_tile, n_blocks * block_size) diff --git a/examples/a5/tensormap_and_ringbuffer/paged_attention_unroll_manual_scope/kernels/orchestration/paged_attention_orch.cpp b/examples/a5/tensormap_and_ringbuffer/paged_attention_unroll_manual_scope/kernels/orchestration/paged_attention_orch.cpp index 0db4b6c0d9..524b1f67c3 100644 --- a/examples/a5/tensormap_and_ringbuffer/paged_attention_unroll_manual_scope/kernels/orchestration/paged_attention_orch.cpp +++ b/examples/a5/tensormap_and_ringbuffer/paged_attention_unroll_manual_scope/kernels/orchestration/paged_attention_orch.cpp @@ -9,7 +9,7 @@ * ----------------------------------------------------------------------------------------------------------- */ /** - * Paged Attention Orchestration Function V2 - N_UNROLL=8, 4 Tasks Per Group + * Paged Attention Orchestration Function V2 - 4 Tasks Per Group * * Batches up to N_UNROLL blocks per group. Each group submits exactly 4 tasks: * 1. QK matmul: qi @ K^T for n_blocks -> sij_buf (q_tile, n_blocks * block_size) diff --git a/tests/st/a2a3/tensormap_and_ringbuffer/paged_attention_unroll/kernels/orchestration/paged_attention_orch.cpp b/tests/st/a2a3/tensormap_and_ringbuffer/paged_attention_unroll/kernels/orchestration/paged_attention_orch.cpp index 0978073d96..fb9d0feb69 100644 --- a/tests/st/a2a3/tensormap_and_ringbuffer/paged_attention_unroll/kernels/orchestration/paged_attention_orch.cpp +++ b/tests/st/a2a3/tensormap_and_ringbuffer/paged_attention_unroll/kernels/orchestration/paged_attention_orch.cpp @@ -9,7 +9,7 @@ * ----------------------------------------------------------------------------------------------------------- */ /** - * Paged Attention Orchestration Function V2 - N_UNROLL=8, 4 Tasks Per Group + * Paged Attention Orchestration Function V2 - 4 Tasks Per Group * * Batches up to N_UNROLL blocks per group. Each group submits exactly 4 tasks: * 1. QK matmul: qi @ K^T for n_blocks → sij_buf (q_tile, n_blocks * block_size) diff --git a/tests/st/a5/tensormap_and_ringbuffer/paged_attention_unroll/kernels/orchestration/paged_attention_orch.cpp b/tests/st/a5/tensormap_and_ringbuffer/paged_attention_unroll/kernels/orchestration/paged_attention_orch.cpp index 4fd91db8c9..02f3975fc0 100644 --- a/tests/st/a5/tensormap_and_ringbuffer/paged_attention_unroll/kernels/orchestration/paged_attention_orch.cpp +++ b/tests/st/a5/tensormap_and_ringbuffer/paged_attention_unroll/kernels/orchestration/paged_attention_orch.cpp @@ -9,7 +9,7 @@ * ----------------------------------------------------------------------------------------------------------- */ /** - * Paged Attention Orchestration Function V2 - N_UNROLL=8, 4 Tasks Per Group + * Paged Attention Orchestration Function V2 - 4 Tasks Per Group * * Batches up to N_UNROLL blocks per group. Each group submits exactly 4 tasks: * 1. QK matmul: qi @ K^T for n_blocks → sij_buf (q_tile, n_blocks * block_size)