AMD’s Instinct MI455X can do four times the peak 4-bit matrix math of the MI355X, but its HBM bandwidth grew only about three times. Any FP4 GEMM kernel that was balanced on the older chip now starves its matrix cores, and AMD’s AITER library answers with hand-written assembly kernels built around tile size, operand layout and pipelining.
The problem is supply, not compute
The chip carries 256 workgroup processors (WGPs) with four SIMD32 units apiece. At a 2.4 GHz peak clock it reaches 40.3 PFLOPS of dense MXFP4, or roughly 64K FP4 operations per WGP each cycle. The MI355X, rated 10.1 PFLOPS, delivers about 16K.
Keeping that busy costs bandwidth. Using a K-tile of 256, every K-step of an output tile consumes 128 bytes of A per row and 128 bytes of B per column, while the math lasts 2·M·N/128 cycles. The best case, a 256 by 256 tile, still needs 128 bytes per cycle from each WGP throughout the main loop, and a 128 by 128 tile doubles that. A rectangle with the same area as a square takes equal math time but moves more bytes.
Redundancy makes it worse. All WGPs run one kernel, and neighbours that share an output row or column ask for identical operand tiles, so without coordination the same data crosses the memory system repeatedly.
Three rules for any compute-bound kernel
- Choose tile and cluster as one decision. For FP8 and FP4 begin with tiles of at least 128 by 128, and group workgroups into clusters so nearby WGPs split loads through L2 multicast.
- Fetch data through the Tensor Data Mover (TDM) with full-width requests from both SIMD pairs.
- Avoid LDS conflicts.
Hardware caps a cluster at 16 workgroups, one per WGP, which makes 4 by 4 the biggest square. For large problems the shipped kernels pair a 256 by 256 tile with a 4 by 4 cluster. Small GEMMs limited by bandwidth, like decode-time projections, gain little from clusters because HBM is the bottleneck.
Each WGP has a TDM, an asynchronous engine that copies tensor tiles between global memory and LDS based on a descriptor, bypassing vector registers. One request can replace 64 buffer_load_b128 instructions per wave, along with the address arithmetic, for a 32 KiB tile. Its direct route needs the tile’s innermost dimension sized in multiples of 128 bytes, and a 256-byte transfer moves double the data.
On the LDS side, two conflicts serialize access. The LDS has 64 banks of 4 bytes, so rows in the same bank collide unless padded. It is also built from five 64 KiB partitions, and waves from different SIMD pairs hitting one partition in the same cycle serialize even without a bank conflict.
Instruction choice, layout and pipeline
MI455X offers scaled WMMA instructions for FP8, FP6 and FP4 with block scales. Both FP4 shapes reach the same peak, but one 32×16×128 instruction does the work of two 16×16×128 ones. That leaves more room to co-issue LDS reads, TDM triggers and scale handling, so the kernel prefers it where the tile allows. The price is that the M step doubles and fewer tile shapes fit a given problem.
The layout answer is pre-shuffling. Stored row-major, the 16 fragments for a single WMMA are scattered across rows 128 bytes apart, so no one 256-byte request can collect them. Weights get repacked ahead of time so those fragments sit together in lane order as a single 256-byte block, and block scales are treated the same way. AITER ships two helper functions for this, one for weights and one for scales, in its shuffle module.
Activations are produced on the fly, so the kernel supports two layouts. In tests at 16384 on every dimension, the shuffled form lifted A4W4 throughput by 16.1% on static inputs (459 µs down to 395.33 µs) and by 6.1% on random inputs (544 µs down to 512.54 µs). The figures leave out the work of packing activations, so a framework should choose per GEMM based on measurements from the actual model.
The main loop is multi-stage. A 256 by 256 FP4 tile needs 512 math cycles per K-block, while a TDM load takes roughly twice that. Hiding that takes at least three buffers. The kernel runs four, which buys roughly 1,500 cycles of lead against a measured delay near 1,000.
To balance the two SIMD pairs, a square tile has one pair load A and the other load B. For wide tiles, where B is four times A, each pair loads half of each, and A and B buffers read in the same cycle sit in different LDS partitions.
What it means for kernel authors
The chip absorbs address generation, register staging and operand sharing across workgroups. That shrinks the author’s job to fewer, weightier choices about tile, layout and pipeline, and the MMA shape, tile and cluster need settling together.
The kernels ship in AITER under hsa/gfx1250/f4gemm, and their names carry the configuration, such as 256x256_4x4. On MI455X, the apreshuffle setting of gemm_a4w4 fits cases where the upstream quantization kernel can output the shuffled layout. Absent that, the padded path stays the default.
Source: ROCm Blogs