Skip to content

borealis: keep render-dependent tiled workgroups at their launch size - #1304

Merged
RyanTheTide merged 1 commit into
aurora-wipfrom
perf/borealis-hal200-render-dependent-wg
Nov 29, 2026
Merged

RyanTheTide merged 1 commit into
aurora-wipfrom
perf/borealis-hal200-render-dependent-wg

Conversation

@DjDeveloperr

Copy link
Copy Markdown

What

Keep the original workgroup size for multi-row HAL200 compute dispatches with a recorded render dependency. J700’s 1080p rt.scene composite dispatch grew from 8×8 to 32×8 after workgroup coalescing landed. That reduced the compute interval and increased the time before the next render completed. Independent dispatches continue to use the existing coalescing policy. Mesa #936

Tested

MacBook Neo J700, G17P B1, stock 7.3.0-41.fc44.aurora.aarch64, SLC enabled. Same-boot ABBA/BAAB compared Fedora aarch64 builds of 702dd0165bd and bd0c677f1b1. GPU fault and AVC deltas were zero and the stock snapshots matched.

Workload Baseline Patch CRC
rt.scene raster 1080p, d=2 145.20 fps 147.95 fps (+1.89%) 96c503ec
rt.scene raster 1080p, d=1 130.20 fps 130.55 fps 96c503ec
rt.scene raster alpha off, d=2 147.35 fps 149.95 fps (+1.76%) d9464b12
Standalone pure-global WG32 2442.05 µs 2434.29 µs (−0.32%) 87b78092
Standalone pure-global WG64 2429.98 µs 2436.02 µs (+0.25%) 87b78092

The light ray-query control matched b500519b across eight runs. The compute-end to next render-end interval fell from 6018.2 to 5876.4 µs. The standalone controls used 16,777,216 invocations per dispatch and checked every output word on the CPU.

  • Targeted Vulkan CTS completed 1,801 cases with 1,557 Pass, 244 NotSupported, and zero failures.
  • Fedora 44 Mesa asahi suite passed 222/222 in both the normal and -Db_ndebug=false configurations.
Benchmark command and per-run medians
gpubench-rt-vk --test rt.scene --param preset=raster --depths 2 \
  --warmup-ms 1500 --runs 5 --run-ms 1000 --timestamps off
Baseline A1 A2 A3 A4  145.4  145.2  145.1  145.2 fps
Patch    B1 B2 B3 B4  148.3  147.9  148.0  146.5 fps

gpubench 8679dd1 · Original workgroup benchmark harness

Risk

The condition uses the recorded render dependency on the compute stream and applies only to multi-row HAL200 dispatches eligible for coalescing.

On HAL200, coalescing tiled compute after a render shortens the compute interval in rt.scene but lengthens the interval before the next render completes. Preserve the launch granularity when the stream records a dependency on a render and the workgroup spans multiple rows. Independent dispatches still use the original coalescing policy.

Fixes: 887b5bd ("borealis: coalesce small pure-global compute workgroups on AGX3")
Signed-off-by: DjDeveloperr <hey@djdev.me>
@DjDeveloperr
DjDeveloperr requested review from a team as code owners November 28, 2026 13:46

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: MERGE at bd0c677f

Blockers: none

Checked:

  • src/asahi/vulkan/hk_cmd_dispatch.c (dispatch_grid_shader): verified render_dependent = agx_chip_native_hal200(dev->dev.chip) && local_size.y > 1 && cs->sync.dep[HK_SYNC_VDM].cut cleanly gates only hk_coalesce_workgroup_size_ex(), leaving hk_split_workgroup_size_ex(), 1D dispatches (local_size.y == 1), independent dispatches (dep[HK_SYNC_VDM].cut == NULL), and non-HAL200 chips completely unchanged.
  • Verified exact-head MacBook Neo (J700, G17P B1) same-boot ABBA/BAAB (702dd0165bd vs bd0c677f1b1, stock 7.3.0-41, SLC enabled): rt.scene raster 1080p d=2 +1.89% (4/4 pairs, 145.20 -> 147.95 fps), alpha-off d=2 +1.76%, standalone pure-global WG32/WG64 controls neutral (-0.32% / +0.25%), all CRCs and ray-query control b500519b identical, 0 GPU faults, 0 AVCs.
  • Verified 1,801 targeted Vulkan CTS cases (1,557 Pass, 244 NotSupported, 0 fail) and Fedora 44 Mesa asahi suite 222/222 in both release and -Db_ndebug=false.
Evidence
  • Diff reviewed at bd0c677f (+11/-4 in src/asahi/vulkan/hk_cmd_dispatch.c).
  • Minor body nit (non-blocking): ## Risk describes the scope clearly, though explicitly tagging two-way · MacBook Neo (HAL200 / G17P) Vulkan makes the rollback posture immediately scannable.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Verdict — HOLD at bd0c677f1b177c552b1ef5a239d6b3da4afb888b

Blocker — second-generation hardware row. M4 Pro (T6040) and M4 Max (T6041) use the G17P profile on the G17 runtime, so both reach the changed coalescing branch. J700 covers A18 Pro. Before merge, run a same-boot baseline/head comparison on a T6040 or T6041 with tiled raster d=2 and the pure-global controls. Chip mapping

Checked — clean merge tree against aurora-wip at 702dd0165bd, matching DCO, provenance, and Fedora 44 Asahi 222/222 with b_ndebug=true and b_ndebug=false.

Evidence
  • The launch decision reads the compute stream's local VDM cut after barrier tracking. Reset clears that state, and secondary buffers replay into the primary. Render suspension/resumption and submit packing retain the existing sync machinery. Cross-buffer history and semaphore waits still resolve at submit. Shader binaries are independent of this launch decision.
  • The focused CPU check passed 13/13. Reverting the change produced 32×8 instead of 8×8 for the render-dependent case on all three G17P-profile identities. Independent 2D, 1D, small-grid splitting and the G15G, G16G and M5 controls passed in both versions.
  • Raw J700 ABBA/BAAB logs support the reported +1.89% raster d=2 and +1.76% with alpha off. CRCs matched and standalone WG32/WG64 timings stayed within 0.32%. Targeted CTS recorded 1,557 Pass, 244 NotSupported and 0 Fail.

@RyanTheTide

Copy link
Copy Markdown

@DjDeveloperr, code-owner heads-up: App approval at bd0c677f1b17 from a different lane. This PR goes into the merge train's next combined A/B (aurora-wip 06e34eca + #526 #935 #1304 #1313 #1316 #1324 #1327 #1329 #1330 #1332) on M1 Pro G13S + M4 G16G. If that row is clean, I plan to land it via --admin under the 6-point rule no earlier than one hour from now, unless you post a hold.

@RyanTheTide

Copy link
Copy Markdown

Merge-train landing at bd0c677f1b17.

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

@RyanTheTide
RyanTheTide merged commit bf15e59 into aurora-wip Nov 29, 2026
@RyanTheTide
RyanTheTide deleted the perf/borealis-hal200-render-dependent-wg branch November 29, 2026 08:35
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.

2 participants