Muzammiluddin Syed 7131244f38
[mlir][AMDGPU] Allow packing of exactly 4 elements. (#181843)
`amdgpu.scaled_mfma` ops ingest byte sized scales stored in 4-byte
registers. To avoid unnecessary padding (where we only ever use the
first byte in this 4-byte register), this canonicalization finds
opportunities to enable packing multiple scales into 4-byte chunks
whenever possible. Note this is necessary but not sufficient to avoid
byte loads from LDS.

This canonicalization should try to pack scales that are extracted from
an alloc in shared mem of size 4 bytes or larger (meaning packing to 4
bytes is possible). Currently we bail out if it is exactly 4 bytes long
which is incorrect and fixed in this PR.

---------

Signed-off-by: Muzammiluddin Syed <muzasyed@amd.com>
2026-02-17 12:01:18 -05:00
..