roofline

Estimates per-kernel roofline headroom from GPU profile data to prioritize optimization targets.

178|52|Updated Jul 30, 2025
One-click install
npx skills add https://github.com/AMD-AGI/GEAK --skill roofline-amd-agi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: roofline
Source: https://github.com/AMD-AGI/GEAK/tree/main/e2e_workflow/knowledge/analysis_skills/roofline
Command: npx skills add https://github.com/AMD-AGI/GEAK --skill roofline-amd-agi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When profiling an LLM serving workload on AMD Instinct GPUs, the biggest kernel by GPU time is not always the one with the most optimization headroom. This Skill answers how close each top kernel already is to its hardware roofline ceiling, so optimization budget goes to kernels with real recoverable gains instead of saturated ones. ## Core Features & Use Cases - Roofline headroom analysis: Computes achieved bandwidth/FLOPs against hardware peaks for each top kernel, classifying it as memory-bound, compute-bound, or latency-bound, and emitting attainable speedup and expected end-to-end gain. - Byte/FLOP models per op class: Provides analytic models for dense GEMM, MoE grouped GEMM, paged attention decode, and elementwise kernels, with confidence stages that sharpen as real shapes and rocprofv3 counters become available. - Non-fatal degradation ladder: Every failure mode (missing peaks, unmodelable op class, infeasible ratio, unavailable counters) degrades gracefully so the profiling run never fails because of this analysis. - Use Case: Given a vLLM decode profile where a fused MoE kernel takes 26% of GPU time and paged attention takes 9%, the Skill shows the MoE kernel is saturated at 88% of the memory roofline while attention is underperforming with 1.7-2.8x headroom, reversing the naive priority order. ## Quick Start Analyze the top kernels in my latest GPU profile and tell me which ones have real optimization headroom versus which are already saturated at the roofline.

Frequently Asked Questions about roofline

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I tell if a GPU kernel is memory-bound or compute-bound?

Compare achieved bandwidth and FLOPs against hardware peaks: compute arithmetic intensity against the ridge point to pick the roof, then check utilization. If neither roof exceeds 60% utilization and the launch is above the dispatch floor, the kernel is latency or occupancy-bound instead.

How to prioritize which GPU kernels to optimize first?

Rank kernels by expected end-to-end gain, not raw GPU time percentage. A kernel at 88% of its roofline has almost no tuning headroom even if it dominates GPU time, while a lower-percentage kernel at 20% utilization may offer 2x speedup.

What does a roofline percentage above 100% mean?

A ratio above 1.0 means the byte or FLOP model is wrong, not that the kernel exceeds hardware limits. Common causes are over-counted bytes (assuming all MoE experts are streamed) or an unvalidated compute peak such as a BF16 microbenchmark reading 2x low.

Does this roofline analysis work without rocprofv3 counters?

Yes, it operates in confidence stages: stage A uses estimated shapes from the profile and model config, stage B uses captured real shapes, and stage C adds measured counters. Missing counters degrade confidence to display-only rather than failing.

What should I do when a saturated kernel still dominates GPU time?

Switch from micro-tuning to byte-reduction levers: fuse adjacent ops to remove activation round-trips, skip streaming unused MoE experts, improve layout and L2 reuse, or lower weight precision. Lossy levers must pass an accuracy gate.