Skip to content

gfx950-tutorial-v2.0

@zhanglx13 zhanglx13 tagged this 29 Jul 08:47
Adds the two compiler changes the Gluon Flash Attention kernels need, on top
of gfx950-tutorial-v1.1. The LLVM pin is unchanged (850a2b1b), so the
out-of-tree LLIR-scheduler plugin does NOT need rebuilding.

* [Gluon] gl.warp_predicate — a per-wave masked-skip region lowering to
  s_and_saveexec + s_cbranch_execz, with no cross-wave reduction and no
  barrier. This is what lets a wavefront skip the flash-attention
  accumulator rescale when none of its own rows advanced their running max.

* [AMD] warp-pipeline barriers — always emit LOCAL cluster barriers rather
  than the minimal set, place the loop-carried wrap-around barrier at the top
  of the loop body, and force a hard LDS drain there with
  amdgpu.memory_counter_wait(ds = 0). Together these keep s_waitcnt lgkmcnt
  out of the MFMA stages.

Verified against the branch these were developed on: both attention kernels
and all four inter_wave GEMM kernels (a16w16 fp16/bf16, a8w8, a4w4) compile
to byte-identical assembly and pass their correctness checks.
Assets 2
Loading