Files
metal2vulkan/crates
Anees Iqbal 9da0f0a63b Matrix: a subgroup multiply-add's loop of step pairs asks the driver nothing about unrolling
The loop a1ca99880a wrote for a subgroup tier's multiply-add (tile_mad's paired_steps) carried
DontUnroll. On an RX 7900 XTX (RADV, Mesa 26.2.6) that made one real kernel 12.6 to 12.9% slower
than development's form before it. Without the hint (LoopSpec's default, the driver's own choice)
the same kernel is back within 0.3% of that form, and NVIDIA's driver compiles it in the memory it
took for the DontUnroll loop. SEMANTICS_VERSION 2274 -> 2275.

Verified, on a probe branch that never lands (the same change on the probe runners; the kernel
compiled in the harness process unless the helper is named), the kernel's two workloads each:
- RX 7900 XTX, four arms alternating in one job, 3 rounds of 100 runs (m3-max-68270), steady
  and GPU p50 means in us: before 653.7 / 671.6 and 750.4 / 766.6, compile 2.64 s, peak
  271 MiB; a1ca99880a 737.9 / 751.7 and 845.1 / 864.8, 0.46 s, 199 MiB; this change
  655.9 / 672.1 and 751.1 / 765.8, 2.43 s, 275 MiB. Every arm's outputs bit-equal (the same
  digests in every round).
- RTX 5080 Laptop (NVIDIA 615.71.09; m3-max-68271), one round each, the arms in turn:
  a1ca99880a reached first use in 92.4 s at a peak of 2.85 GiB, GPU p50 10,845 and 4,305 us,
  steady 10,197 and 3,953 us; this change in 79.6 s at 2.85 GiB, GPU 10,888 and 4,284 us,
  steady 10,626 and 4,163 us; outputs bit-equal.
- RTX 3090 (NVIDIA 620.70.06; m3-max-68288), the kernel's module (bound weight 62,810, 644
  subgroup instructions, spirv-val valid) through the helper under the consumer's 3,072 MiB cap:
  filled in 59.2 s at a peak of 2,701 MiB, against a1ca99880a's form at 2,699 MiB
  (m3-max-67936).
- The paired steps written out instead of looped were as fast on the RX 7900 XTX (654.6 and
  748.5 us) but their module passed 6,144 MiB in the RTX 3090's helper (m3-max-67936).
- fmt, clippy --workspace --all-targets --all-features and Rustdoc clean; the stage-bound,
  widest-pin, multiply-add and API-surface tests pass, 52 of 52 (m3-max-68301).
2026-11-22 10:35:12 -08:00
..