Read the IR ladder for one kernel
Colab T4 · freereading-code150 minrequiredGoal · A side-by-side annotated dump of one Triton kernel at the TTIR, TTGIR, LLIR and PTX stages, plus the PTX of an equivalent hand CUDA kernel from nvcc -ptx.
- 1On a Colab T4, take a small Triton kernel (vector add or a fused softmax from p6-triton-programming).
- 2Dump its intermediate stages with the kernel's asm dict (ttir, ttgir, llir, ptx) and save each to a file.
- 3For each stage transition, write two sentences on what the compiler decided (tiling, layout, vector width, shared memory, register mapping).
- 4Write the same operation as a tiny CUDA kernel, compile with nvcc -ptx, and diff its PTX against Triton's PTX at the hot loop.
- 5Identify one instruction or pattern in the final PTX that explains the measured performance difference (or similarity) between the two versions.
- Deliverable
- A folder with the four Triton IR dumps, the CUDA PTX, and a one-page annotation of the stage transitions and the final PTX diff.
- Check
- Each stage transition has a written explanation; the PTX diff names a concrete instruction or pattern (for example ld.global vector width or a fused multiply-add form) tied to the performance note.
- Fallback
- Use a pre-generated dump pack (export it from any machine with a GPU and Triton) and do the annotation work offline; the reading skill is the lesson.