Skip to content

asahi/libagx: use 256-thread workgroups for libagx_fill_uint4 - #1270

Merged
RyanTheTide merged 1 commit into
aurora-wipfrom
perf/libagx-fill-uint4-wg256
Nov 28, 2026
Merged

RyanTheTide merged 1 commit into
aurora-wipfrom
perf/libagx-fill-uint4-wg256

Conversation

@LiamRay11

@LiamRay11 LiamRay11 commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

Summary

Raise libagx_fill_uint4 in src/asahi/libagx/copy.cl from KERNEL(32) to KERNEL(256) to match libagx_copy_uint4, reducing workgroup launch count by 8x for large buffer fills.

Benchmarks

Hardware: Apple M6 (G18G B1) — same-machine A/B using gpubench-vk (warmup_ms=300, runs=5, run_ms=250):

Command:

gpubench-vk --filter '^copy\.bw$' --param kind=fill --warmup-ms 300 --runs 5 --run-ms 250
Case Metric Before After Change
copy.bw kind=fill (D=4) Bandwidth 122.4 GB/s 127.2 GB/s +3.9%
copy.bw kind=fill (D=4) us_per_submit 548.2 us 527.4 us -3.8%

Verification

  • Verified on M6 (G18G B1): dEQP-VK.api.fill_and_update_buffer.suballocation* 24/24 supported PASS (0 failures), vtrun.sh 100% PASS.

libagx_copy_uint4 already uses 256-thread workgroups, while
libagx_fill_uint4 still used 32-thread workgroups (8x more workgroup
launches for large buffer fills).

Raising libagx_fill_uint4 to KERNEL(256) improves gpubench copy.bw
kind=fill at depth 4 on M6 (G18G B1) from 122.4 GB/s (548.2 us/submit)
to 127.2 GB/s (527.4 us/submit, +3.9%).

Signed-off-by: Liam J LiamRay11/LiamRay10 <228416644+LiamRay11@users.noreply.github.com>
@LiamRay11
LiamRay11 requested review from a team and DjDeveloperr as code owners November 28, 2026 00:24
@RyanTheTide

Copy link
Copy Markdown

Exact-head 0df1e19b9174 2-gen Borealis peer rows (J316s + J473): PASS

  • Build: native aarch64 Clang 23.1.4 (-Dbuildtype=release -Db_ndebug=false -Dtools=drm-shim), overlay libvulkan_asahi.so SHA-256 83f846387c38697a0be9e38e71065adb0962364dc8a0fbd3b4356bb7a7afa8b2 via isolated VK_DRIVER_FILES (stock /usr/lib64/libvulkan_asahi.so untouched, verified pre/post on both Macs).
  • J316s (M1 Pro, G13S C0, 7.3.0-aurora-fleet89): meson test --suite asahi 261/261 PASS; Vulkan CTS 80 PASS / 0 FAIL (api.smoke 8/8, api.fill_and_update_buffer.* 72/110 [38 NS]); 0 GPU faults/recoveries, Enforcing, 0 failed units, 0 new AVC.
  • J473 (M2 mini, G14G B0, 7.3.0-aurora-fleet89): Vulkan CTS 80 PASS / 0 FAIL (api.smoke 8/8, api.fill_and_update_buffer.* 72/110 [38 NS]); 0 GPU faults/recoveries, Enforcing, 0 failed units, 0 new AVC.

@satchlj satchlj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed and tested at exact HEAD 0df1e19b9174 on Apple M5 Max (J775c, G17C B1, Borealis, -Db_ndebug=false):

  • Clean 1-line KERNEL(32) -> KERNEL(256) change on libagx_fill_uint4.
  • meson test --suite asahi: 337/337 OK, 0 FAIL.
  • Vulkan CTS dEQP-VK.api.fill_and_update_buffer.suballocation.fill_buffer*: 20/20 supported PASS (0 FAIL, 2 NotSupported, 0 GPU faults).

@RyanTheTide

Copy link
Copy Markdown

Merge-train landing at 0df1e19b9174.

  • Review: satchlj (Satya) APPROVE with exact-head verification (non-author).
  • Feature row: the author's exact-head hardware row on this PR.
  • Regression: combined A/B overlay of aurora-wip plus this PR and the other queued PRs, user space, default kernel command line. M1 Pro (G13S, fleet89): 0 status changes. M4 Pro (G16S, fleet89): 0 regressions. The only flips there are 5 synchronization multi_queue timeouts under 4-job load; all 5 pass 3/3 alone on both arms, and the base arm shows the same flake. Each Mac ran 26,595 dEQP-VK + 8,153 dEQP-GLES cases, with 0 GPU firmware crashes, Enforcing, 0 failed units. Evidence traces/gpu/20261128-mergetrain-mesa.

Revert: git revert -m 1 <merge commit> on aurora-wip. A regression gets reverted first and fixed after.

@RyanTheTide
RyanTheTide merged commit 9d58604 into aurora-wip Nov 28, 2026
@RyanTheTide
RyanTheTide deleted the perf/libagx-fill-uint4-wg256 branch November 28, 2026 05:56
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.

3 participants