Unit 8 of 10 · about 5 hours · implement
Reconstructing a real kernel path and making one bounded change
Research starts where the library ends: one real path, fully traced, with one change whose effect was predicted before it was measured.
You'll be able to
- Reconstruct a compiled operation from graph through IR, schedule and generated kernel to runtime dispatch and hardware profile.
- Make one bounded change with a predeclared mechanism hypothesis and full correctness coverage.
- State the architecture, shape and version limits of the change without universal speedup claims.
Covers
Read
In this order, only the parts listed
0 of 3 done
- Kernel benchmarking appendix as the trace templateModern GPU Programming for MLSys
Timing boundary, GPU-time versus end-to-end, benchmark-condition consistency, and the worked BF16 GEMM baseline with the Proton to Nsight Systems to Nsight Compute chain
Hopper-and-later constructs (thread-block clusters, TMA) and Blackwell-only ones (
tcgen05, TMEM) are reading unless your GPU has them: produce the static mechanism audit and leave performance claims open. - Adaptive kernel selection as the claim sourceAI Systems Performance Engineering - Chapters 2, 19 and 20 and the Appendix checklist
Chapter 19: Kernel Autotuning for Transformer Self-Attention and MLP Paths; Dynamic Shared-Memory Allocation and Occupancy-Aware Kernel Selection; Runtime Kernel Performance Improvements and Hot-Swappable Implementations
- Milestone C implementation contractGPU Microbenchmark and Kernel Suite - Final Evaluation
Milestone C: complete the kernels or document a hardware or toolchain blocker while completing the real available path; Milestone E: report shapes where added resources or overhead regress performance
Focus on
- Trace first, change second: graph, IR, schedule, generated kernel, dispatch, profile. An untraced change is a guess with a diff attached.
- One change, one hypothesis, stated beforehand: tile size, pipeline depth or layout, with predicted bytes, launches and resources.
- Blackwell-only constructs do not run on older GPUs. The audit names them and the fallback, and measures only what the hardware runs.
- Correctness coverage spans shapes, dtypes, boundaries and numerics before any timing. Timing an uncovered kernel measures a bug.
Common mistakes · 3
- Porting a Blackwell GEMM to Ampere by renaming intrinsics. Blackwell matrix and memory constructs have no
sm_86equivalent; the path needs redesign, not renaming. - Changing two things and crediting one. Tile and pipeline depth interact through shared memory; vary one and hold the other.
- Profiling the tuned shape only. Autotuned tiles overfit the tuning set; evaluation shapes must differ from tuning shapes.
Try it yourself
Closed-book, before checking anything
Quiz yourself
Answer first, then mark it. Missed ones go to Review.
0 got · 0 missed
1.List the links of the reconstruction chain in order.Answer
Graph, IR and schedule, generated kernel, runtime dispatch, hardware profile, plus the mechanism hypothesis linking predicted bytes, launches and resources to the profile.
2.Your change halves shared-memory use per block. Which two profiler signals confirm or falsify the predicted gain?Answer
Active warps or occupancy rising where shared memory limited residency, and the timeline showing the predicted launch or byte change. If neither moves, the bottleneck was elsewhere.
3.Why must tuning and evaluation shapes differ?Answer
Autotuning selects for the tuning set, so reporting on it measures selection rather than the kernel. Unseen shapes test whether the choice generalizes.
4.The appendix flushes a large buffer before each measured call. What breaks if you compare against a run that does not?Answer
Cache state differs: warm-cache hits inflate the no-flush run. The policy must match across implementations or the comparison measures the cache, not the kernel.
You're done when
Your traced path predicts the profile within stated uncertainty, and your one change lands inside its predicted interval on unseen shapes.
Only when you can do this without notes.
Leads to
Notes
Resources · 3 for this unit, 11 more in the section
- AI Systems Performance Engineering - Chapters 2, 19 and 20 and the Appendix checklistChris Fregly · primary
Read Chapter 2 for hardware generations, Chapters 19 and 20 on adaptive engine optimization and AI-assisted optimization, and use the Appendix checklist as an audit list for the final project. Treat every performance number as a hypothesis requiring your own evidence.
- GPU Microbenchmark and Kernel Suite - Final EvaluationRoadmap-Final · required
Complete Milestones C through F: CUDA and Triton kernel suite, failure injection, model-versus-profile reconciliation, strong baselines, real integration, full shape matrix, dispatch and fallback defense, clean reproduction and negative results.
- Modern GPU Programming for MLSysMLC · depth
Use the Blackwell GEMM and Flash Attention path as a real architecture-specific reconstruction target if compatible hardware is available. Otherwise produce a static mechanism audit and leave all performance claims open.
Also in this section
- AI Performance Engineering - Hardware, Frontier and Source PolicyWafer · reference
A dated map of current hardware and frontier work. Apply its Source Policy to every final claim, and use the hardware and frontier sections only to find primary documentation.
- Performance Engineering and GPU Programming CheckpointRoadmap-Final · support
Use the checkpoint as the final adversarial assessment after the source-derived route. Pass the real kernel, compiler or communication modification and end-to-end evidence clauses; ignore its ordering where it conflicts with this track.
- KernelBench-VerifiedKernelBench-Verified Authors · required
Study the evaluator hardening and baseline-parity failures found in the original benchmark. Run a very small task slice or port its adversarial testing ideas into the project evaluator; do not optimize for aggregate benchmark score.
- SOL-ExecBenchNVIDIA · support
Inspect how correctness and performance are compared with a hardware speed-of-light model. Apply one attainable-efficiency analysis to a project kernel and explain missing hardware or model assumptions.
- MLPerf EndpointsMLCommons · support
Read the endpoint-level scenario and load-generation rules. Borrow the workload and result-boundary discipline for the integrated benchmark without claiming an official MLPerf result.
- CUDA Toolkit and Architecture Tuning GuidesNVIDIA · reference
Use the current toolkit root, release notes and the tuning guide matching the measured GPU. Pin the document and toolkit versions, verify capability checks and rerun any claim affected by compiler or architecture change.
- MIT 6.S894 Accelerated Computing (Fall 2025) - Lecture 10MIT · support
Use Lecture 10 (Accelerated Computing Beyond NVIDIA and CUDA) for AMD GPUs, TPUs, NPUs and higher-level kernel languages as portability vocabulary.
- KernelBench - benchmark toolkit and task suiteScalingIntelligence · support
Clone the repository and check one Level 1 problem with
scripts/run_and_check.pyin local mode; readEVAL.mdfor the correctness and timing guidance. Do not chase the aggregate score. - Etalon - holistic evaluation for LLM inferenceGeorgia Tech, Microsoft Research India and Intel AI Lab · support
Read Section 2.2 for TTFT and TPOT pitfalls, then the fluidity-index design (Section 4.1) for deadline-based, SLO-qualified capacity.
- ROCm Composable KernelAMD · support
Read the repository
READMEfor the tile-based programming model, Tensor Coordinate Transformation and the four CK layers; open one tiled operator and map each CUDA term to its CK counterpart. - DistServe: Disaggregating Prefill and Decoding for Goodput-optimized LLM ServingZhong et al. (OSDI 2024) · support
Read Section 1 with Figure 1 for per-GPU goodput: the highest request rate served while a target share of requests meets the TTFT and TPOT SLOs.