Skip to content

agx: enable AGX_CAP_COMPUTE_SMART_WAITS on G13G - #1297

Merged
RyanTheTide merged 1 commit into
aurora-silicon:aurora-wipfrom
joshuaswarren:w8B/g13g-smart-waits
Nov 28, 2026
Merged

RyanTheTide merged 1 commit into
aurora-silicon:aurora-wipfrom
joshuaswarren:w8B/g13g-smart-waits

Conversation

@joshuaswarren

Copy link
Copy Markdown

What

Follow-up to #1224, rebased onto aurora-wip (e0990ec5397c) at head 88a3579d2bb4: enable the existing AGX_CAP_COMPUTE_SMART_WAITS (1u << 28) capability on G13G in src/asahi/lib/agx_chip_caps.h, and update src/asahi/lib/tests/test-chip-caps.c and src/asahi/compiler/test/test-insert-waits.cpp.

Only AGX_CAP_COMPUTE_SMART_WAITS is enabled on G13G. AGX_CAP_COMPUTE_HOIST_LOAD_ADDRS (1u << 29) stays off on G13G because adding load-address hoisting atop #1219 + smart_waits regressed G13G 2B decode relative to #1219 + smart_waits alone (see details below).

Tested

  • On head 88a3579d2bb4 (parent aurora-wip e0990ec5397c, -Db_ndebug=false):
    • asahi-agx-chip-caps: PASS (covers every AGX_CHIPS row, verifying AGX_CAP_COMPUTE_SMART_WAITS on G13G and G14X only, and AGX_CAP_COMPUTE_HOIST_LOAD_ADDRS on G14X only).
    • agx_tests: PASS (1,775 passed, 1 pre-existing skip NativeFMA.ExactDyadicOracle, 0 failed), including updated InsertWaits.SmartWaitsAvoidsMidBurstOverflowOnG14X verifying G13G compute matches G14X compute while G13X, G14G, and fragment shaders keep stock behavior.
    • Full mesa:asahi suite merged onto aurora-wip (7617c835cd8b): 214 passed, 1 failed; the lone failure (hk_sync_stamps, 8/896 cases) reproduces identically on untouched aurora-wip 7617c835cd8b.
  • Live G13G Vulkan CTS (dEQP-VK.synchronization.*, dEQP-VK.synchronization2.*, dEQP-VK.memory_model.*, 16,421 cases): 5,175 passed, 0 failed, 11,246 not supported (0 regressions vs baseline).

Hardware A/B (MacBook Pro 13-inch M1, G13G)

Same-machine interleaved 5-pair ABBA (3 inner trials per leg, isolated shader cache per arm, deferral disabled, greedy decode 64 tokens, 100% bit-exact token IDs across every pair; baseline aurora-wip b200715b4841):

Target lever: AGX_CAP_COMPUTE_SMART_WAITS (standalone)

Workload Baseline decode Candidate decode Delta Wins Prefill (base -> cand, delta, wins) Bit-exact
Qwen3.8-2B-4bit ctx512 43.27 tok/s 44.18 tok/s +2.12% 5/5 334.4 -> 334.2 (-0.06%, 3/5) yes
Qwen3.8-2B-4bit ctx2048 42.82 tok/s 43.70 tok/s +2.05% 4/5 411.9 -> 411.0 (-0.21%, 3/5) yes
Qwen3-4B-4bit ctx512 23.85 tok/s 23.87 tok/s +0.11% 4/5 135.8 -> 135.6 (-0.17%, 1/5) yes
Qwen3-4B-4bit ctx2048 21.02 tok/s 21.21 tok/s +0.89% 2/5 144.9 -> 144.9 (+0.03%, 2/5) yes

Stacked with #1219 (AGX_CAP_CDM_DEFER_FLUSH, already merged on aurora-wip)

Workload Baseline decode Stacked decode Delta Wins Prefill (base -> cand, delta, wins) Bit-exact
#1219 alone, 2B ctx512 43.19 tok/s 43.54 tok/s +0.80% 4/5 335.1 -> 337.0 (+0.58%, 5/5) yes
#1219 alone, 2B ctx2048 42.79 tok/s 42.79 tok/s +0.01% 3/5 411.4 -> 411.7 (+0.07%, 3/5) yes
#1219 + smart_waits, 2B ctx512 43.38 tok/s 44.43 tok/s +2.42% 5/5 333.3 -> 336.9 (+1.06%, 5/5) yes
#1219 + smart_waits, 2B ctx2048 42.83 tok/s 43.77 tok/s +2.19% 5/5 411.2 -> 412.0 (+0.17%, 4/5) yes
Rejected / not-enabled G13G variants (same screening pass)

Every other G13G compiler lever measured in the same 5-pair ABBA screening pass is recorded here and intentionally left disabled on G13G:

Variant / Workload Baseline decode Candidate decode Delta Wins Prefill (base -> cand, delta, wins) Bit-exact
hoist_loads_addr alone, 2B ctx512 43.31 tok/s 43.42 tok/s +0.25% 4/5 335.0 -> 335.1 (+0.04%, 3/5) yes
hoist_loads_addr alone, 2B ctx2048 42.46 tok/s 42.83 tok/s +0.86% 4/5 411.9 -> 411.6 (-0.08%, 3/5) yes
#1219 + smart_waits + hoist_loads_addr, 2B ctx512 43.38 tok/s 44.02 tok/s +1.48% 5/5 334.8 -> 338.4 (+1.06%, 5/5) yes
#1219 + smart_waits + hoist_loads_addr, 2B ctx2048 42.80 tok/s 43.60 tok/s +1.85% 5/5 412.6 -> 411.7 (-0.21%, 0/5) yes
mod3_reg_bank_ra, 2B ctx512 (rejected) 43.22 tok/s 42.98 tok/s -0.57% 0/5 334.3 -> 333.7 (-0.18%, 2/5) yes
mod3_reg_bank_ra, 2B ctx2048 (rejected) 42.77 tok/s 42.50 tok/s -0.63% 2/5 412.1 -> 407.9 (-1.01%, 0/5) yes
wide_flat load window, 2B ctx512 (rejected) 43.40 tok/s 43.30 tok/s -0.25% 2/5 334.3 -> 334.2 (-0.03%, 2/5) yes
wide_flat load window, 2B ctx2048 (rejected) 42.79 tok/s 42.77 tok/s -0.04% 2/5 411.4 -> 412.1 (+0.17%, 3/5) yes

hoist_loads_addr (AGX_CAP_COMPUTE_HOIST_LOAD_ADDRS) conflicts with smart_waits on G13G (stacking it atop #1219 + smart_waits drops decode from +2.42% to +1.48% at ctx512 and from +2.19% to +1.85% at ctx2048, and turns ctx2048 prefill to -0.21% 0/5). AGX_CAP_MOD3_REG_BANK_RA and wide_flat regressed G13G 2B decode and remain off.

Risk

Only G13G compute shader wait insertion (agx_insert_waits) changes; all non-compute stages on G13G and every other chip row keep stock behavior. Back-out is a single-commit revert dropping AGX_CAP_COMPUTE_SMART_WAITS from the G13G row in src/asahi/lib/agx_chip_caps.h.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
@joshuaswarren
joshuaswarren requested review from a team and DjDeveloperr as code owners November 28, 2026 10:39
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-28T10:39:55.133396Z
We couldn’t complete this review. Comment @codex review to try again.
88a3579 PR opened
🔒 Security Review ❌ Failed 2026-11-28T10:40:04.539646Z
We couldn’t complete this review. Comment @codex security review to try again.
88a3579 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector

Copy link
Copy Markdown

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.

@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 88a3579d

Blockers: none (ready for lab regression overlay and merge).

Checked:

  • src/asahi/lib/agx_chip_caps.h, test-chip-caps.c, test-insert-waits.cpp: cleanly enables AGX_CAP_COMPUTE_SMART_WAITS (1u << 28) on G13G while intentionally leaving AGX_CAP_COMPUTE_HOIST_LOAD_ADDRS (1u << 29) off after 5-pair ABBA screening showed hoisting regresses G13G decode.
  • Tests & hardware rows on G13G: asahi-agx-chip-caps PASS, agx_tests 1,775/1,775 PASS, mesa:asahi 214/215 (lone hk_sync_stamps failure pre-existing on base), live G13G Vulkan CTS (synchronization* + memory_model, 16,421 cases: 5,175 pass, 0 fail, 0 regressions), and 5-pair ABBA 100% bit-exact greedy decode wins (+2.42%/+2.19%).
  • Checked for Apple material, tool attribution, private serials, and Borealis naming: clean; MERGEABLE on aurora-wip; human Signed-off-by present.
Evidence
  • Head: 88a3579d2bb4 (base: aurora-wip, mergeable: MERGEABLE, +20/-9 across 3 files).

@RyanTheTide

Copy link
Copy Markdown

@DjDeveloperr, code-owner heads-up: App approval at 88a3579d2bb4 from a different lane. It was in the combined comb7 A/B (aurora-wip 702dd016 + #1130 + #1297 + #1132): 0 status changes on M1 Pro G13S and M4 G16G over 26,595 VK + 8,153 GL each, 0 GPU firmware crashes, host 318/344 (the base harness set). 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 88a3579d2bb4.

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

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