Repository navigation
asahi/compiler: widen AGX3B compute device-load ILP window to {8, 6, 4, 2, 1} - #817
DjDeveloperr wants to merge 1 commit into
Conversation
…4, 2, 1}
AGX3B compute kernels such as unrolled 8-tap vertical filters and FAST
feature extractors have 21-63 halves of register headroom inside the
1024-thread occupancy tier, yet the shared {4, 2, 1} load-hoist window
left their second half of loads interleaved behind the first consumers.
Try {8, 6, 4, 2, 1} on AGX3B compute while keeping M5 (AGX3C) on
{4, 2, 1}, still bounded strictly by the existing occupancy-step
register cap and falling back cleanly on high-pressure shaders.
Signed-off-by: Diljit Singh <hey@djdev.me>
G17S B1 (
|
M4 Hardware Verification (
|
RyanTheTide
left a comment
There was a problem hiding this comment.
Follow-Up at e5f03d1f7f44.
The widened scheduling window is selected for AGX3B compute while the existing occupancy checks still admit each candidate. Please report candidate versus its actual parent as well as the comparison to #805. That isolates the effect of the window change, and a shader at the six/eight-load boundary would confirm the occupancy fallback after register allocation.
Source review. I used the test evidence attached to this PR.
satchlj
left a comment
There was a problem hiding this comment.
Verdict: MERGE
Checked: Code review, -Db_ndebug=false build, meson test --suite asahi, and live Vulkan CTS on Mac Studio M5 Max (J775c, T6050) at e5f03d1f7f44.
Evidence
- Verified
agx_ilp_schedule()insrc/asahi/compiler/agx_pressure_schedule.cwidens the device-load ILP hoist window to{8, 6, 4, 2, 1}exclusively foragx3b_compute, keeping the{4, 2, 1}window unchanged on M5 (AGX3C), while preserving the existing occupancy-step register growth cap (load_growth) and scoreboard checks. - Verified
AGX3VisionOpts.Agx3bComputeDeviceLoadIlpWideWindowcovers all three cases: 8-load hoisting with headroom onAGX3B, high-pressure fallback (extra_live_32 = 45 -> 1), and unchanged{4, 2, 1}behavior onAGX3C. - Native
-Db_ndebug=falsebuild (clang 23.1.4) on Mac Studio M5 Max (J775c, T6050) passedmeson test --suite asahi: 146/146 PASS (0 fail). - Live Vulkan CTS on Mac Studio M5 Max (J775c, T6050, G17C B1,
LD_DEBUG=libsconfirmed builtlibvulkan_asahi.soatgit-e5f03d1f7f):dEQP-VK.compute.pipeline.basic.*80/80 PASS (1 NotSupported, 0 fail), kernel GPU fault delta 0 (complements exact-headG17P,G16G, andG17Sverification rows in the PR).
|
Superseded by standalone PR #1075 ( |
Stacked on #805 (
perf/agx3b-wave8-loop-rotate-unswitch).Summary
src/asahi/compiler/agx_pressure_schedule.c: Widen the AGX3B compute device-load ILP hoist window from{4, 2, 1}to{8, 6, 4, 2, 1}while keeping M5 (AGX3C) on{4, 2, 1}.{4, 2, 1}left the second half of loads interleaved behind the first consumers.8 -> 6 -> 4 -> 2 -> 1) on high-pressure blocks.src/asahi/compiler/test/test-agx3-vision-opts.cpp: AddAGX3VisionOpts.Agx3bComputeDeviceLoadIlpWideWindowverifying 8-load hoisting with headroom onAGX3B, high-pressure fallback (extra_live_32 = 45 -> 1hoisted load), and unchanged{4, 2, 1}behavior onAGX3C(M5).4-Chip Offline Shader-DB (80-SPV Compute Corpus,
e5f03d1f7f44vs #8054afdcb486266)G15G(M3)G16G(M4)G17P(A18 Pro)G17S(M5)Selected
G17PGPR changes (all staying at 1024 threads, 0 spills):1cf53d30(55 -> 63),gauss-v/22a1d0a2(55 -> 61),face-depthwise/720b8163(33 -> 41),e8b3e690(67 -> 71),323926dd(49 -> 59).Verification
fedora-mesaci, exact heade5f03d1f7f44d30b5e10e76781625b955fa3e83a):146/0PASS (0 failures, 0 skipped).-Db_ndebug=falseunit tests (meson test --suite asahi --suite poly):170/170PASS.G17P,e5f03d1f7f44vs agx: rotate binary-tail unrolled loops, elide dominated guards, and unswitch single-arm loop ifs #8054afdcb486266,w2 -> v1 -> v1 -> w2,FAULTS_DELTA=0,AVC_DELTA=0):33.94 -> 33.63 ms(+0.9%,73.5% -> 74.2%Metal; passes33.98 / 33.54 / 33.73 / 33.89 ms; vertical filter1cf53d309.18 -> 8.79 ms, -4.2%)11.77 -> 11.71 ms(+0.5%,118.4% -> 118.9%Metal; passes11.77 / 11.70 / 11.73 / 11.77 ms)23.45 -> 23.38 ms(+0.3%,71.3% -> 71.5%Metal; passes23.44 / 23.39 / 23.38 / 23.45 ms;face-depthwise1.605 -> 1.586 ms, -1.2%)36.10 -> 36.01 ms(+0.2%,46.1% -> 46.2%Metal)26.43 -> 26.39 ms(+0.2%,94.0% -> 94.2%Metal)20.07 -> 20.05 ms(+0.1%,104.2% -> 104.3%Metal)36.19 -> 36.17 ms(+0.1%)gpubench-vkABBA (16/16CRC_OK):compute.uber d1 (kind=ilp):583.26 -> 494.61 us(+17.9%; passes583.35 / 494.71 / 494.52 / 583.17 us)compute.uber d4 (kind=ilp):581.44 -> 494.56 us(+17.6%; passes581.38 / 494.29 / 494.83 / 581.50 us)gpubench-vkcompute kernels (conv2d,edge,stereo,uber_div,uber_uni) have<= 1device_loadper block (unchanged ISA; identical warm-passgpu_us).G17P, exact heade5f03d1f7f44):integer_builtins,subgroups_compute,glsl_loops(624/624),ssbo_std430(4/4),compute_basic(79/79, 2 NS),robustness2(12 NS) — 0 failures.Assisted-by: LLM (Antigravity:Gemini 4 Neon)