Repository navigation
agx: gate agx_hoist_loads on AGX_DBG_NOSCHED and clarify G14X/barrier comments - #1310
Conversation
… comments Follow-up hygiene for #1224: - Gate agx_hoist_loads on !(agx_compiler_debug & AGX_DBG_NOSCHED) in agx_compile_function_nir(), matching agx_pressure_schedule and agx_ilp_schedule so AGX_MESA_DEBUG=nosched disables all scheduling passes. - Document in hoist_can_cross() why non-coherent device_loads may cross AGX_OPCODE_THREADGROUP_BARRIER without inspecting memory_can_reorder (global/device-scope barriers emit AGX_OPCODE_MEMORY_BARRIER first, where hoisting stops). - Clarify AGX_CAP_COMPUTE_SMART_WAITS and AGX_CAP_COMPUTE_HOIST_LOAD_ADDRS comments in agx_chip_caps.h to reflect that AGX_CHIP_G14X covers gen-14 Pro/Max/Ultra (G14S/G14C/G14D), with measurements collected on G14C. Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins. |
There was a problem hiding this comment.
Verdict: MERGE at f04e68ec
Blockers: none
Checked:
src/asahi/compiler/agx_compile.c: verifiedagx_hoist_loadsis gated behindlikely(!(agx_compiler_debug & AGX_DBG_NOSCHED)), preserving default codegen while allowingAGX_MESA_DEBUG=noschedto disable load hoisting.src/asahi/compiler/agx_hoist_loads.candsrc/asahi/lib/agx_chip_caps.h: verified comments accurately explainhoist_can_cross()(AGX_OPCODE_THREADGROUP_BARRIERvsAGX_OPCODE_MEMORY_BARRIER) andAGX_CHIP_G14Xcapabilities.- Commit metadata and PR checklist (
What/Tested/Risktwo-way door, humanSigned-off-by,MERGEABLE).
Evidence
- Head:
f04e68ec(+13/-6across 3 files). - Author verification:
asahi-agx-chip-caps(855/855),agx_tests(1791/1791), and M2 Max (G14C) CTS1,000 Pass / 17 NS / 0 Fail(0diffs default vsnosched) + LLM ABBA PASS.
|
@DjDeveloperr, code-owner heads-up: App approval at |
|
Merge-train landing at
Revert: |
What
Follow-up hygiene for #1224 (branch
joshuaswarren:w88/agx-hoist-hygiene, headf04e68ec4eddatopaurora-wip5b64e3c144d1):src/asahi/compiler/agx_compile.c: gateagx_hoist_loadson!(agx_compiler_debug & AGX_DBG_NOSCHED), matchingagx_pressure_scheduleandagx_ilp_scheduleimmediately above it soAGX_MESA_DEBUG=noscheddisables all scheduling/reordering passes.src/asahi/compiler/agx_pressure_schedule.c: document inhoist_can_cross()why non-coherentdevice_loadinstructions may crossAGX_OPCODE_THREADGROUP_BARRIERwithout checkingP->memory_can_reorder(unlikeagx_insert_waits): any NIR barrier with global/device memory scope emitsAGX_OPCODE_MEMORY_BARRIERfirst, which has a non-NONE schedule class and stops hoisting there; a barethreadgroup_barrierorders only workgroup execution and local memory.src/asahi/lib/agx_chip_caps.h: clarify theAGX_CAP_COMPUTE_SMART_WAITSandAGX_CAP_COMPUTE_HOIST_LOAD_ADDRScomments to reflect thatAGX_CHIP_G14Xcovers gen-14 Pro/Max/Ultra (G14S/G14C/G14D), with measurements collected onG14C(Apple M2 Max).Tested
asahi-agx-chip-caps: 855/855 checks passed (GCC and Clang).agx_tests(Clang): 1791 passed, 1 skipped, 0 failed (HoistLoads.*11/11,InsertWaits.*5/5).aurora-wip5b64e3c144d1+f04e68ec4edd, default vsAGX_MESA_DEBUG=nosched):1,017cases total:1,000 Pass / 17 NotSupported / 0 Fail,0diffs between default andnosched):dEQP-VK.synchronization2.*compute*(synccg.txt):552/552 Pass,0diffs.dEQP-VK.spirv_assembly.instruction.*(8-bit/storage corpus):439 Pass / 1 NotSupported / 0 Fail,0diffs.dEQP-VK.memory_model.message_passing.core11.u32.coherent.fence_fence.atomicwrite.workgroup.*:9 Pass / 16 NotSupported / 0 Fail,0diffs.MLX_OMARCHY_DEFER_TOKENS=0, bit-exact greedy digests,AGX_MESA_DEBUG=nosched-> default):Qwen3-4B ctx=512:101.22 -> 104.35 tok/s(+3.09%,-0.296 ms,3/3disjoint).Qwen3.5-9B ctx=512:58.91 -> 60.16 tok/s(+2.13%,-0.354 ms,3/3disjoint).Qwen3.8-2B ctx=512:179.65 -> 185.43 tok/s(+3.22%,-0.174 ms,3/3disjoint).Risk
Low. Two comment-only edits and one
AGX_DBG_NOSCHEDdebug-flag guard; zero behavior change under default flags.