Skip to content

Borealis,agx: enable AGX2 cooperative matrix and bfloat16 - #954

Merged
DjDeveloperr merged 7 commits into
aurora-wipfrom
feat/agx2-cooperative-matrix
Nov 24, 2026
Merged

DjDeveloperr merged 7 commits into
aurora-wipfrom
feat/agx2-cooperative-matrix

Conversation

@joshuaswarren

@joshuaswarren joshuaswarren commented Nov 24, 2026 •

Copy link
Copy Markdown

What: Port AGX2 (G13/G14) subgroup-scope cooperative matrix and bfloat16 support onto aurora-wip:

  • Add AGX2 simd_matrix_fmadd32/simd_matrix_fmadd16 ISA decoding, opcode packing (bit 63, no saturate or scalar operand folding), register-width validation, and RA non-aliasing guard preventing destination D from overwriting killed A or B inputs (D == C stays permitted).
  • Add widen_bf16_inputs to agx_nir_lower_cmat(), lower cmat_muladd_agx to simd_matrix_fmadd32/16 on AGX2, and run agx_nir_lower_f2bf_rtne + lower_bfloat16_conversions on AGX2 while restoring nir->options unconditionally.
  • Add agx_nir_lower_cmat_sw() as a partial-subgroup software fallback (distributed element ownership, subgroup shuffles, scalar ALU, and exact bf16 arithmetic) for workgroups whose static size is not a multiple of 32 or is variable.
  • Enable AGX_CAP_COOPERATIVE_MATRIX for admitted AGX2 chips (G13G/G13X/G14G/G14X, excluding uncharacterized G15P), advertise f16 accumulation for 8x8x8 shapes in Borealis, and route AGX2 compute shaders between hardware lowering and agx_nir_lower_cmat_sw().
  • Add AGX2Cmat unit tests covering NIR lowering, AGX2 compilation/disassembly across all five 8x8x8 shapes, RA input/output disjointness, and partial-subgroup 64-bit PhysicalStorageBuffer software lowering.

Tested:

  • Native aarch64 --suite asahi at coopmat diff d4eb305ca003 + PR agx: classify helper/stack ops as barriers and serialize stack_adjust #951 (194c2386c1c9): 181/182 binaries passed (AGX2Cmat.* 4/4, M5CopySchedule.AGX2Helper*/StackAdjust* 2/2, asahi-agx-chip 839/839, agx2_disasm, agx3_cmat_mixed_mma8, asahi-chip-admission, hk_pack); the sole failing binary was asahi-agx-chip-caps on the two pre-existing aurora-wip G16G/G17P mismatches (364/366 checks passed, 0 failures on G13/G14/G15P).
  • Live on a 16-inch M1 Max MacBook Pro (Apple M1 Max (G13C C0)) using cross-built libvulkan_asahi.so (sha256 d5dcf4cc92a614153f804b7f72d198ef1f47157ea4ba7533815a2ea4163cbbca) from the identical coopmat diff (d4eb305ca003) + PR agx: classify helper/stack ops as barriers and serialize stack_adjust #951 (now landed in aurora-wip base 62ccb5f402b1): verified VK_KHR_cooperative_matrix, VK_KHR_shader_bfloat16, shaderBFloat16Type, shaderBFloat16CooperativeMatrix, and all five 8x8x8 shapes (fp32->fp32, fp16->fp32, fp16->fp16, bf16->fp32, bf16->bf16).
  • Vulkan CTS on Apple M1 Max (G13C C0): 624 Pass, 2902 NotSupported, 0 Fail across 3526 selected api.*cooperative_matrix/bfloat16, compute.pipeline.cooperative_matrix.64b_indexing.*, khr_{a,b,r}.subgroupscope.*linear, glsl.bfloat16.*, and spirv_assembly.instruction.* cases (including 200 matrixmuladd* passes), plus 207 Pass / 2939 NotSupported / 0 Fail across 3146 remaining non-tensor subgroupscope cases, and bit-exact 64/64 compute probes for partial-subgroup local_size_x=16 software fallback (fp32, bf16->bf16) and local_size_x=32 hardware (fp16->fp16, bf16->bf16). 0 new dmesg GPU faults or timeouts.

Risk: two-way · M1, M2 (G13, G14) (reverting cleanly disables VK_KHR_cooperative_matrix and VK_KHR_shader_bfloat16 advertisement and lowering on AGX2 without affecting AGX3/M5).

Not yet: G14 (M2) hardware verification and full MLX prefill (pf2048) / decode benchmark comparison.

…uard

Define the AGX2 8x8x8 simd_matrix_fmadd32 and simd_matrix_fmadd16 opcodes,
pack bit 63, forbid saturate and inline-immediate/fmov folding on paired
fragment operands, add RA register-width accounting, and prevent early
kills from aliasing destination D with A or B (D == C stays allowed).

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
…or AGX2

Add widen_bf16_inputs to agx_nir_lower_cmat(), lower cmat_muladd_agx
to simd_matrix_fmadd32/16 on AGX2, and run agx_nir_lower_f2bf_rtne
plus lower_bfloat16_conversions on AGX2 while restoring nir->options.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
…ring

Add agx_nir_lower_cmat_sw() to lower cooperative matrices for AGX2
workgroups without guaranteed 32-lane occupancy using distributed
ownership, subgroup shuffles, scalar ALU, and exact bf16 arithmetic.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
… AGX2

Enable AGX_CAP_COOPERATIVE_MATRIX for admitted AGX2 chips (G13/G14,
excluding G15P), advertise f16 accumulation for 8x8x8 shapes in
Borealis, and route AGX2 compute shaders between hardware lowering and
agx_nir_lower_cmat_sw() while re-lowering compute system values.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
Cover bf16 widening and f16 accumulation in NIR lowering, AGX2
end-to-end compilation + disassembly across all five 8x8x8 shapes,
RA non-overlap between destination and A/B inputs, and partial-subgroup
software fallback compilation with 64-bit PhysicalStorageBuffer access.

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

chatgpt-codex-connector Bot commented Nov 24, 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-24T15:14:34.778302Z
We couldn’t complete this review. Comment @codex review to try again.
a29dd51 PR opened
🔒 Security Review ❌ Failed 2026-11-24T15:14:42.285943Z
We couldn’t complete this review. Comment @codex security review to try again.
a29dd51 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.

@joshuaswarren

Copy link
Copy Markdown
Author

Timing on Apple M1 Max (G13C), 5-pair ABBA vs the shipped lab-default Borealis build (Qwen3-4B, VK_ICD_FILENAMES arm switch, gpu-turn serialized):

Cell Lab default #954 (a29dd51) Delta Wins ids
decode @2048 68.18 tok/s 63.14 tok/s -7.4% 0/5 identical
decode @512 74.28 tok/s 66.13 tok/s -11.2% 0/5 identical
prefill @2048 3789 ms ~4036 ms +6.5% slower — —

ids_sha identical on every leg (a6fad159d on ctx512) — output is bit-exact vs lab default, deterministic run-to-run.

For scale: bare aurora-wip head measures 8820 ms on the same prefill cell, so this port closes ~92% of the prefill gap and its barrier handling is correct (a straight cherry-pick of the shipped barrier commits produced run-to-run nondeterminism here).

Caveat on the decode deltas: the staged ICD is a debugoptimized build (88 MB .so vs ~27 MB release). Part of the ~7-11% decode gap is likely build-type overhead; a release-build retime is worth one pass before calling the delta final.

@joshuaswarren joshuaswarren changed the title asahi,borealis: enable AGX2 cooperative matrix and bfloat16 honeykrisp,agx: enable AGX2 cooperative matrix and bfloat16 Nov 24, 2026

@DjDeveloperr DjDeveloperr 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: FINISH at a29dd51a05b4

Blockers:

  • PR body / Tested: (§5) — The Tested: section cites the pre-rebase diff (d4eb305ca003 + 194c2386c1c9) rather than exact PR head a29dd51a05b4, and omits kernel version plus the regression health check (0 SELinux denials, 0 failed units). Please update Tested: with an exact-head a29dd51a05b4 hardware row (confirming the CTS/unit results and release-build decode timing without the debugoptimized -7.4%/-11.2% decode delta, plus 0 SELinux denials / 0 failed units / 0 new kernel GPU errors), and record or request a G14 (M2) + AGX3 non-regression check since shared compiler/Borealis paths are touched.

Checked: All 5 commits (3350d63ec6f7..a29dd51a05b4, 0 code blockers, MERGEABLE vs aurora-wip 62ccb5f402b1), §1–§6 pre-PR checklist (§1–§4 & §6 pass; §5 exact-head Tested: row pending), agx_chip.h/agx_chip_caps.h parity, AGX2 ISA/RA/lowering/SW-fallback, and AGX3 non-impact.

Evidence

Checklist (§1–§6)

  • §1 No model gating: Pass. Gated via AGX_ISA_ENCODING_AGX2, agx_chip_cooperative_matrix_supported(), and AGX_CAP_COOPERATIVE_MATRIX. chip != AGX_CHIP_G15P is documented (uncharacterized A16 part, not admitted by agx_chip_driver_supported()).
  • §2 Production-ready: Pass. Default command line, no new env vars, flags, delays, or lab-only paths.
  • §3 Safety: Pass (N/A; userspace Mesa compiler/driver).
  • §4 IP & Attribution: Pass. All 5 commits carry human author/committer (Joshua Warren) and Signed-off-by:; zero AI attribution in commits, PR title/body, diff, or comments; no copyrighted Apple material.
  • §5 Evidence: Needs follow-up (blocker above). PR body Tested: cites pre-rebase d4eb305ca003 + 194c2386c1c9; follow-up comment tests MLX timing at exact head a29dd51a05b4 on Apple M1 Max (G13C) with bit-exact outputs (ids_sha identical) and ~92% prefill gap closure vs bare aurora-wip, but on a debugoptimized build (-7.4%/-11.2% decode vs lab default). G14 (M2) hardware verification is listed in Not yet:. What:, Tested:, Risk:, Not yet: lines are all present.
  • §6 Naming: Pass. Uses Borealis in prose; existing hk_ / src/asahi/vulkan/ identifiers preserved in code.

Code & Commit Audit

  1. 3350d63ec6f7 (asahi/isa,compiler: add AGX2 simd_matrix_fmadd32/16 encoding and RA guard):
    • AGX2.xml & agx_opcodes.py: opcode 0x6F, bit 27 = 1 (disjoint from shuffle bit 27 = 0 and Subgroup arithmetic bits 26:27 = 00), bit 26 = precision (1 fp32 / 0 fp16), bit 63 = 1, fixed 8-byte non-extensible encoding; extend bits (54..61) do not collide with bit 63.
    • agx_pack.c, agx_optimizer.c, agx_validate.c, agx_performance.c: is_float = False blocks fmov/saturate folding; agx_optimizer_inline_imm skips both opcodes; agx_pack_alu asserts !I->saturate; agx_validate.c accounts for paired-register widths via agx_index_size_16.
    • agx_register_allocate.c: early_killable() prevents early-killing A/B (s < 2) while allowing D == C (s == 2). Because agx_liveness_ins_update sets .kill only on the first SSA source occurrence, C cannot be early-killed if it aliases A or B.
  2. a83071f1af5c (asahi/compiler: lower 8x8 cooperative matrices and bf16 conversions for AGX2):
    • widen_bf16_inputs in agx_nir_lower_cmat() is false for AGX3B/AGX3C (no change to M3/M4/M5).
    • agx_compile.c lowers cmat_muladd_agx on AGX_ISA_ENCODING_AGX2 to simd_matrix_fmadd16/32, runs agx_nir_lower_f2bf_rtne + lower_bfloat16_conversions on AGX2 (both epilog preopt and main compile), and restores nir->options = original_options unconditionally (with no early returns in between).
  3. 525cdea94a69 (asahi/compiler: add partial-subgroup software cooperative matrix lowering):
    • agx_nir_lower_cmat_sw.c: distributed ownership e % A (A = min(32, W - 32 * subgroup_id)), subgroup shuffles for muladd/convert/transpose, local ownership for extract/insert/copy/bitcast/alu/store, exact fp32 compute + RTNE roundback for bf16, handles 64-bit PhysicalStorageBuffer and 32-bit pointers, and nir_foreach_block_reverse_safe / nir_foreach_instr_reverse_safe is safe with nir_push_if splits in lower_store.
  4. 49e3384c7dfce (asahi: enable VK_KHR_cooperative_matrix and VK_KHR_shader_bfloat16 on AGX2):
    • agx_chip.h vs agx_chip_caps.h: exact parity across all 19 chips + AGX_CHIP_UNKNOWN (G13G/G13X/G14G/G14X enabled; G15P and G18G disabled; AGX3B/M5 unchanged; AGX_CAP_COOPERATIVE_MATRIX = 1u << 7 reused with no bit collision). The 2 asahi-agx-chip-caps failures noted by the author are pre-existing aurora-wip G16G/G17P mismatches (AGX_CAP_NATIVE_PREAMBLE / AGX_CAP_VDM_INDIRECT_INDEX_BOUNDS).
    • hk_physical_device.c & hk_shader.c: enables KHR_cooperative_matrix and KHR_shader_bfloat16 via agx_chip_cooperative_matrix_supported(), advertises f16 accum on AGX2 + AGX3B (NV_cooperative_matrix2 stays M5-only), routes AGX2 compute shaders between hardware lowering (nonzero static multiple of 32) and agx_nir_lower_cmat_sw(), and re-runs nir_lower_compute_system_values after lowering. AGX3B/AGX3C path is unchanged.
  5. a29dd51a05b4 (asahi/compiler: add AGX2 cooperative matrix unit tests):
    • test-agx2-cmat.cpp covers NIR bf16 widening + f16 accum, end-to-end AGX2 compilation + disassembly across all five 8x8x8 shapes, RA non-overlap between D and A/B, and partial-subgroup 64-bit PhysicalStorageBuffer bf16 software fallback; updates test-agx3-cmat-mixed-mma8.c, test-native-form-regressions.cpp, test-chip-admission.c, and test-chip.c.

CI Status

  • statusCheckRollup: empty (expected on aurora-silicon/mesa; CI runs on mirror).
  • Mergeability: MERGEABLE against aurora-wip (62ccb5f402b1).

Non-Blocking Notes

  • src/asahi/isa/AGX2.xml:987-990 / src/asahi/isa/test/cases.txt:406: simd_matrix_fmadd32 uses <fsrc1/> (bits 16:27), which overlaps <exact bit="26">1</exact> and <exact bit="27">1</exact>, causing agx2_disassemble to print spurious .abs.neg on src1 (simd_matrix_fmadd32 r2l, ^r1l.abs.neg, ^r3l, ^r4l). Fine to clean up in a follow-up with a non-modifier source encoding.
  • src/asahi/compiler/agx_pack.c:545-549: optional hardening nit — pack_assert(I, I->src[s].type == AGX_INDEX_REGISTER) for simd_matrix_fmadd32/16 sources would guard against accidental non-register operand folding in future passes.

@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.

Verdict at a29dd51a05b4

APPROVE — Clean AGX2 cooperative matrix (simd_matrix_fmadd32/16, RA non-aliasing guard, NIR lowering + partial-subgroup software fallback) and VK_KHR_shader_bfloat16 enablement with exact agx_chip.h/agx_chip_caps.h parity for AGX2 and verified zero regression on Apple M5 Max (G17C B1) Borealis cooperative-matrix and compute workloads.

Blockers

None (code, capability-table parity, unit suite, and M5 Max non-regression all clean; see follow-up note in the earlier review comment regarding refreshing the PR body Tested: metadata to exact head a29dd51a05b4).

Checked

  • Full 5-commit diff (+1034/-45 across 22 files):
    • AGX2 ISA & RA: simd_matrix_fmadd32/16 (0x6F, bit 27 = 1, bit 26 precision, bit 63 = 1, fixed 8-byte) cleanly guarded in agx_pack.c/agx_optimizer.c/agx_validate.c; early_killable() in agx_register_allocate.c keeps A/B (s < 2) live until D is placed while still allowing D == C.
    • NIR lowering & software fallback: widen_bf16_inputs stays false on AGX3B/AGX3C; agx_compile.c lowers f2bf RTNE and restores nir->options unconditionally; agx_nir_lower_cmat_sw.c handles partial subgroups, 64-bit PhysicalStorageBuffer, and in-place aliasing safely, with hk_shader.c re-running nir_lower_compute_system_values right after lowering.
    • Capability parity: AGX_CAPS_AGX2 adds AGX_CAP_COOPERATIVE_MATRIX while G15P stays 0, matching agx_chip_cooperative_matrix_supported(). Verified via asahi-agx-chip-caps (0 failures on G13G/G13X/G14G/G14X/G15P or AGX_CAP_COOPERATIVE_MATRIX; only the 2 pre-existing aurora-wip G16G/G17P checks fail, resolved in #955).
    • Feature advertisement: hk_physical_device.c advertises shaderBFloat16Type and shaderBFloat16CooperativeMatrix, keeps shaderBFloat16DotProduct = false, and keeps NV_cooperative_matrix2 M5-only.
  • Isolated release build (-Dtools=drm-shim -Dbuild-tests=true), full non-layout asahi unit suite (262/263 PASS; sole failure is pre-existing aurora-wip asahi-agx-chip-caps G16G/G17P), plus AGX2Cmat.*, NativeForms.CooperativeMatrix*, agx2_disasm (558/558), agx3_cmat_mixed_mma8, asahi-agx-chip (839/839), and asahi-chip-admission.
  • Live Apple M5 Max (G17C B1), Linux 7.3 Borealis Vulkan CTS non-regression (MESA_SHADER_CACHE_DISABLE=1, 0 kernel GPU faults).
  • Untested scope: Live AGX2 (G13/G14) hardware execution (tested on this host via AGX2 compiler/RA/disasm/SW-fallback unit suites and live M5 Max AGX3C non-regression); asahi_layout_tests excluded due to pre-existing GCC 16 C++20 designated-initializer build issue.
Evidence
  • Exact head tested: a29dd51a05b4
  • Unit suite (non-layout asahi): 262/263 PASS (1 pre-existing aurora-wip asahi-agx-chip-caps G16G/G17P mismatch; 0 failures on AGX2/G15P/AGX_CAP_COOPERATIVE_MATRIX)
    • agx_tests --gtest_filter="AGX2Cmat.*:NativeForms.CooperativeMatrix*": 5/5 PASS
    • agx2_disasm: 558/558 PASS
    • agx3_cmat_mixed_mma8: PASS
    • asahi-agx-chip: 839/839 PASS
    • asahi-chip-admission: ok
  • Live Vulkan CTS non-regression (Apple M5 Max G17C B1, Linux 7.3, MESA_SHADER_CACHE_DISABLE=1):
    • dEQP-VK.api.info.get_physical_device_properties2.features.cooperative_matrix_features_khr: 1/1 PASS
    • dEQP-VK.api.info.get_physical_device_properties2.features.shader_bfloat16_features_khr: 1/1 PASS
    • dEQP-VK.compute.pipeline.cooperative_matrix.khr_a.subgroupscope.add.float16_float16.buffer.*: 2/2 PASS
    • dEQP-VK.compute.pipeline.cooperative_matrix.khr_a.subgroupscope.add.float32_float32.buffer.*: 2/2 PASS
    • dEQP-VK.compute.pipeline.basic.*: 80/81 PASS (1 Not supported, 0 failed)
    • dEQP-VK.glsl.loops.special.*: 552/552 PASS
  • Kernel dmesg: 0 new GPU faults/errors.

@RyanTheTide

Copy link
Copy Markdown

The approved head a29dd51a05b4 has a merge conflict in src/asahi/compiler/meson.build against the current aurora-wip (540abc17d6e). Please merge the updated base into the existing branch, preserve the cooperative-matrix test registration, and let the usual checks run on the resulting head.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
@DjDeveloperr
DjDeveloperr merged commit 6eb4883 into aurora-wip Nov 24, 2026
@joshuaswarren

Copy link
Copy Markdown
Author

Exact-head Tested: follow-up at merged head e44adb89fa95 (merged to aurora-wip as 6eb4883958d5):

  • Native --suite asahi (e44adb89fa95): 191/191 passed, 0 failed (AGX2Cmat.* 4/4, NativeForms.CooperativeMatrixDefaultsFollowTheImplementedEncoding 1/1, asahi-agx-chip-caps 386/386, asahi-agx-chip 843/843, agx2_disasm, agx3_cmat_mixed_mma8, asahi-chip-admission, hk_pack).
  • 14-inch M2 Max MacBook Pro (Apple M2 Max (G14C B1)), Linux 7.3.0-2-20261110.1-lab-ARCH:
    • Build: release AArch64 Borealis driver (-Dbuildtype=release -Db_ndebug=true, 26,607,144 bytes, sha256 867de407e1d030d80e6a46d5a768d7f33ff03008c05e54e0c43006809f6f3bc9).
    • Health: 0 SELinux denials (SELinux not enabled), 0 failed systemd units (before and after), 0 new kernel GPU errors/faults in dmesg.
    • Capabilities & probes (MESA_SHADER_CACHE_DISABLE=true): VK_KHR_cooperative_matrix=1, shaderBFloat16Type=1, shaderBFloat16CooperativeMatrix=1, shaderBFloat16DotProduct=0, all 5 8x8x8 shapes advertised; exact 64/64 pass for partial-subgroup local_size_x=16 software fallback (fp32, bf16->bf16) and local_size_x=32 hardware simd_matrix_fmadd16 (fp16->fp16).
    • Vulkan CTS (MESA_SHADER_CACHE_DISABLE=true): 624 Pass / 2902 NotSupported / 0 Fail across 3526 selected cooperative-matrix and bfloat16 cases, plus 207 Pass / 2939 NotSupported / 0 Fail across 3146 remaining non-tensor subgroupscope cases (831 Pass, 5841 NotSupported, 0 Fail across 6672 cases total).
    • Release-build MLX timing (5-pair ABBA, Qwen3-4B-Instruct-2507-4bit, ICD arm switch vs shipped release Borealis baseline):
Cell Shipped release baseline #954 (e44adb89fa95, release) Delta Wins Output IDs
decode @2048 68.42 tok/s (14.62 ms) 65.38 tok/s (15.29 ms) -4.33% 0/5 identical (9115b5280c1d7e33)
prefill @2048 (median) 2725.63 ms 3106.58 ms +13.98% — identical (9115b5280c1d7e33)
decode @512 75.05 tok/s (13.32 ms) 68.21 tok/s (14.66 ms) -9.01% 0/5 identical (a6fad159dfa90047)
prefill @512 (median) 637.46 ms 779.90 ms +22.34% — identical (a6fad159dfa90047)

The release build remains -4.33% (@2048) / -9.01% (@512) slower on decode and +13.98% / +22.34% slower on prefill than the shipped release baseline (aurora-wip does not yet carry the separate barrier-tracking and AGX2 codegen work; all token streams are bit-exact).

  • AGX3 non-regression (shared compiler and Borealis paths): Verified via the full 191/191 --suite asahi unit suite at exact head e44adb89fa95 (agx3_cmat_mixed_mma8, NativeForms.CooperativeMatrixDefaultsFollowTheImplementedEncoding, asahi-agx-chip-caps 386/386, asahi-agx-chip 843/843) alongside live Apple M5 Max (G17C B1, Linux 7.3) Borealis Vulkan CTS non-regression in the approval review at a29dd51a05b4 (identical feature diff).
  • 16-inch M1 Max MacBook Pro (Apple M1 Max (G13C C0)), Linux 7.1.12-2-20261103.2-lab-ARCH: Exact-head e44adb89fa95 release-build (sha256 867de407...) CTS and 5-pair ABBA runs are queued and will be posted in a follow-up comment once they complete.

@joshuaswarren

Copy link
Copy Markdown
Author

Timing on M1 (13-inch, G13G), merged release head e44adb8 ICD (sha256 867de407), 5-pair ABBA vs lab default, Qwen3-4B 4-bit:

Cell A decode tok/s B decode tok/s Delta A prefill ms B prefill ms ids
pf2048 20.36 19.60 -1.76% 13403 13812 exact all legs
d4b (512) 19.04 18.36 -3.54% 3383 3589 exact all legs

Notes:

  • Bit-exact on every leg, same as the M1 Max runs.
  • Prefill is at rough parity with lab default on this part (+3-6%): the coopmat prefill win measured on M1 Max (2.3x) does not show on the base M1's 4-core GPU.
  • Decode is mildly slower here (-1.8%/-3.5%), consistent with the M1 Max numbers (-7.4%/-11.2%).
  • Same-shape comparison for reference, aurora-wip head + shipped cherry-pick range under HK_PERFTEST=alwayscdmbarrier on this machine: decode -2.8%/-3.2%, prefill parity, ids exact.

@joshuaswarren

Copy link
Copy Markdown
Author

Timing on M1 Max (16-inch), same merged release head e44adb8 ICD (sha256 867de407), 5-pair ABBA vs lab default, Qwen3-4B 4-bit:

Cell A decode tok/s B decode tok/s Delta A prefill ms B prefill ms ids
pf2048 67.78 65.16 -3.87% 3793 3966 exact all legs
d4b (512) 76.06 69.22 -9.04% 884 1001 exact all legs

Bit-exact on every leg on both machines. Combined with the M1 row below: decode delta is -1.8%/-3.5% on M1 (G13G) and -3.9%/-9.0% on M1 Max (G13D); the +13% d4b prefill on M1 Max is the one number that stands out, worth a look at the 512-token path.

@joshuaswarren joshuaswarren changed the title honeykrisp,agx: enable AGX2 cooperative matrix and bfloat16 Borealis,agx: enable AGX2 cooperative matrix and bfloat16 Nov 25, 2026
@RyanTheTide
RyanTheTide deleted the feat/agx2-cooperative-matrix branch November 27, 2026 13:20
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.

4 participants