[PR #2488] [CLOSED] sycl/A770: faster hyper-connection read on Arc A-series (gr_bench 88/123/151 -> 62/83/100 us at 1/4/6 tokens) #4072

Closed
opened 2026-11-07 15:32:59 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/2488
Author: @aslater3
Created: 10/14/2026
Status: ❌ Closed

Base: main ← Head: a770/up-gr-read


📝 Commits (2)

  • f6b5657 sycl/A770: faster hyper-connection read
  • 607f211 sycl/A770: the hc read's norm-folded down kernel at 256-column slices (STRATA_GR_DOWN_COLS, Alchemist default); gr_bench GR_BENCH_LAYERS

📊 Changes

2 files changed (+467 additions, -15 deletions)

View changed files

📝 sycl/src/kernels/cuda/fused_gr.dp.cpp (+444 -8)
📝 sycl/src/kernels/gr_bench.cpp (+23 -7)

📄 Description

Title

sycl/A770: faster hyper-connection read on Arc A-series (gr_bench 88 / 123 / 151 -> 62 / 83 / 100 us at 1 / 4 / 6 tokens)

Summary

fused_gr_read_multi on Alchemist, the gr_more_groups path. This is the decode window's per-layer hc read, run twice per layer, and it sits on the stepped window's critical path. There are five changes, each with an env switch and each the default on Alchemist only. Every other device runs the same kernels as before.

Three are bit-identical (gr_bench checksums unchanged):

  1. The down reduce is folded into the sliced down kernel: each row block's last slice to finish sums the 80 slice partials, in the same order (STRATA_GR_FUSED_REDUCE). That is one launch fewer.
  2. The up kernel runs at 4 columns per block (640 blocks), up from 8 (STRATA_GR_UP_MORE_COLS).
  3. The up kernel reads the lo values the fused reduce computed once, instead of every block recomputing them (STRATA_GR_LO_READY).

Two change the fp32 summation order. The output sums agree to about 1e-7 relative, and the output was quality-checked:

  1. The norm is folded into the down kernel (STRATA_GR_NORM_FOLD). The slices stage the pending-updated residual × w_norm unscaled, together with its sums of squares. The reduce then applies each stream's rs to that stream's partial dots. This removes the norm launch and the xn write and re-read.
  2. The up projection runs one row per lane (STRATA_GR_UP_V5). The old kernel re-read all of lo from local memory for every row and every token, about 160 KB per block, and was local-memory bound on the A770. Now all lanes read the same lo value at once, as a broadcast.

STRATA_GR_NORM_FOLD=0 STRATA_GR_UP_V5=0 gives back the old bits exactly.

What changed

  • sycl/src/kernels/cuda/fused_gr.dp.cpp:
    • gr_down_sliced_kernel gains the FUSED / NF epilogues.
    • New gr_up_v5_kernel.
    • launch_gr_down_more / launch_gr_up_more choose between them.
    • New switches: gr_fused_reduce, gr_norm_fold, gr_up_more_cols, gr_lo_ready, gr_up_v5.
    • New scratch: slice counters and slice sums of squares.

Extra Notes

Arc A770 16 GB, xe, compute runtime 26.05, oneAPI 2026.1. gr_bench, in µs:

tokens before 1-3 (bitwise) + 4 + 5
1 88.4 74.6 62.2 63.8
4 123.1 104.9 90.3 83.3
6 150.8 133.2 115.4 100.5

Decode (Coder IQ1_M, --resident-experts, spec 4):

  • 1-3: 33.64 / 33.41 → 34.80 / 34.84 tok/s with the expert large-GRF PR, ids identical.
  • 4-5: GPU wait per round 39.2-39.9 → 38.1-39.2 ms at 8K / 32K / 2K. Decode is within run-to-run noise (about +1%). The generated text is equivalent, and the 2K ids are identical.
  • Rejected along the way: 8 lanes per row for the up kernel (slower), an all-80-in-flight reduce (spills), and 2 / 16 / 32 columns.

Not tested: A750 / A580, i915, Windows.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/2488 **Author:** [@aslater3](https://github.com/aslater3) **Created:** 10/14/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `a770/up-gr-read` --- ### 📝 Commits (2) - [`f6b5657`](https://github.com/Niko1221/Strata/commit/f6b565749dc02b7d29c2558fa59655cce2026f02) sycl/A770: faster hyper-connection read - [`607f211`](https://github.com/Niko1221/Strata/commit/607f211cebcd6c0f35f2f46740707ea04579af15) sycl/A770: the hc read's norm-folded down kernel at 256-column slices (STRATA_GR_DOWN_COLS, Alchemist default); gr_bench GR_BENCH_LAYERS ### 📊 Changes **2 files changed** (+467 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `sycl/src/kernels/cuda/fused_gr.dp.cpp` (+444 -8) 📝 `sycl/src/kernels/gr_bench.cpp` (+23 -7) </details> ### 📄 Description ## Title sycl/A770: faster hyper-connection read on Arc A-series (gr_bench 88 / 123 / 151 -> 62 / 83 / 100 us at 1 / 4 / 6 tokens) ## Summary `fused_gr_read_multi` on Alchemist, the `gr_more_groups` path. This is the decode window's per-layer hc read, run twice per layer, and it sits on the stepped window's critical path. There are five changes, each with an env switch and each the default on Alchemist only. Every other device runs the same kernels as before. Three are **bit-identical** (`gr_bench` checksums unchanged): 1. The down reduce is folded into the sliced down kernel: each row block's last slice to finish sums the 80 slice partials, in the same order (`STRATA_GR_FUSED_REDUCE`). That is one launch fewer. 2. The up kernel runs at 4 columns per block (640 blocks), up from 8 (`STRATA_GR_UP_MORE_COLS`). 3. The up kernel reads the `lo` values the fused reduce computed once, instead of every block recomputing them (`STRATA_GR_LO_READY`). Two change the **fp32 summation order**. The output sums agree to about 1e-7 relative, and the output was quality-checked: 4. The norm is folded into the down kernel (`STRATA_GR_NORM_FOLD`). The slices stage the pending-updated residual × `w_norm` unscaled, together with its sums of squares. The reduce then applies each stream's `rs` to that stream's partial dots. This removes the norm launch and the `xn` write and re-read. 5. The up projection runs one row per lane (`STRATA_GR_UP_V5`). The old kernel re-read all of `lo` from local memory for every row and every token, about 160 KB per block, and was local-memory bound on the A770. Now all lanes read the same `lo` value at once, as a broadcast. `STRATA_GR_NORM_FOLD=0 STRATA_GR_UP_V5=0` gives back the old bits exactly. ## What changed - `sycl/src/kernels/cuda/fused_gr.dp.cpp`: - `gr_down_sliced_kernel` gains the `FUSED` / `NF` epilogues. - New `gr_up_v5_kernel`. - `launch_gr_down_more` / `launch_gr_up_more` choose between them. - New switches: `gr_fused_reduce`, `gr_norm_fold`, `gr_up_more_cols`, `gr_lo_ready`, `gr_up_v5`. - New scratch: slice counters and slice sums of squares. ## Extra Notes Arc A770 16 GB, xe, compute runtime 26.05, oneAPI 2026.1. `gr_bench`, in µs: | tokens | before | 1-3 (bitwise) | + 4 | + 5 | |---|---|---|---|---| | 1 | 88.4 | 74.6 | 62.2 | 63.8 | | 4 | 123.1 | 104.9 | 90.3 | 83.3 | | 6 | 150.8 | 133.2 | 115.4 | 100.5 | **Decode** (Coder IQ1_M, `--resident-experts`, spec 4): - **1-3:** 33.64 / 33.41 → 34.80 / 34.84 tok/s with the expert large-GRF PR, ids identical. - **4-5:** GPU wait per round 39.2-39.9 → 38.1-39.2 ms at 8K / 32K / 2K. Decode is within run-to-run noise (about +1%). The generated text is equivalent, and the 2K ids are identical. - **Rejected along the way:** 8 lanes per row for the up kernel (slower), an all-80-in-flight reduce (spills), and 2 / 16 / 32 columns. Not tested: A750 / A580, i915, Windows. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:32:59 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4072
No description provided.