Skip to content

Commit 700e8bc

Browse files
Add roofline.json metadata for all 35 kernels and examples
Per-kernel roofline metadata files containing name, description, run command, kernel_filter, FLOPs, bytes, and computation notes. These are consumed by scripts/roofline_report.py and rooflinex for automated roofline analysis and plotting. Covers: aiter (8), examples (4), gemm_variant (6), hip_* (6), llamacpp (6), fp8 (2), radeonflow_moe_topk, te_rmsnorm (2). Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 6dc899d commit 700e8bc

35 files changed

Lines changed: 315 additions & 0 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "Atomic Reduction",
3+
"description": "Atomic sum reduction over 1M elements with block-level partial sums",
4+
"command": "./atomic_reduction_bench",
5+
"kernel_filter": "atomic_reduce_kernel",
6+
"flops": 1048575,
7+
"bytes": 4194308,
8+
"notes": "N=1048576. FLOPs: N-1 additions. Bytes: read N floats + write 1 float"
9+
}

examples/02_conv1d/roofline.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "Conv1D",
3+
"description": "Causal 1D convolution with kernel width 4",
4+
"command": "./conv1d_bench",
5+
"kernel_filter": "causal_conv1d_kernel",
6+
"flops": 29360128,
7+
"bytes": 33554448,
8+
"notes": "batch=1, dim=2048, seqlen=2048, width=4. FLOPs: size*(2*width-1). Bytes: read x+weight + write out, all FP32"
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "Grouped GEMM",
3+
"description": "Batched GEMM with per-group row ranges for MoE-style routing",
4+
"command": "./grouped_gemm_bench",
5+
"kernel_filter": "grouped_gemm_kernel",
6+
"flops": 2146435072,
7+
"bytes": 29360128,
8+
"notes": "num_groups=8, K=1024, N=512, total_m=2048. FLOPs: total_m*N*(2*K-1). Bytes: read X+weights + write Y, all FP32"
9+
}

examples/04_scan/roofline.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "Scan (Prefix Sum)",
3+
"description": "Naive O(n^2) inclusive prefix sum where each thread serially sums up to its index",
4+
"command": "./scan_bench",
5+
"kernel_filter": "scan_kernel",
6+
"flops": 549755551488,
7+
"bytes": 8388608,
8+
"notes": "N=1048576. FLOPs: (N-1)*N/2 (naive O(n^2) scan). Bytes: read+write N floats"
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "Fused Add RMSNorm",
3+
"description": "Adds residual to input then applies RMSNorm in one fused kernel",
4+
"command": "./fused_add_rmsnorm_bench 128 4096",
5+
"kernel_filter": "fused_add_rms_norm_kernel",
6+
"flops": 2621696,
7+
"bytes": 4202496,
8+
"notes": "num_tokens=128, hidden_size=4096. FLOPs: 128*(5*4096+2). Bytes: read 2 inputs+weight + write 2 outputs, all FP16"
9+
}

kernels/aiter/hgemv/roofline.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "HGEMV",
3+
"description": "Half-precision GEMV y = A * x with wavefront-per-row tiling",
4+
"command": "./hgemv_bench 4096 4096",
5+
"kernel_filter": "HGEMV_WFPerRow",
6+
"flops": 33554432,
7+
"bytes": 33579008,
8+
"notes": "M=4096, K=4096. FLOPs: 2*M*K. Bytes: read A[M*K]+x[K] + write y[M], all FP16"
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "LLGemm1",
3+
"description": "General FP16 GEMV: C = A * B, N=1",
4+
"command": "./llgemm1_bench 4096 4096",
5+
"kernel_filter": "LLGemm1_kernel",
6+
"flops": 33554432,
7+
"bytes": 33579008,
8+
"notes": "M=4096, K=4096. FLOPs: 2*M*K. Bytes: read A[M*K]+B[K] + write C[M], all FP16"
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "LLGemm SiLU",
3+
"description": "Fused GEMV + SiLU gating: gate=silu(A[:M/2,:]*B), up=A[M/2:,:]*B, out=gate*up",
4+
"command": "./llgemm_silu_bench 4096 4096",
5+
"kernel_filter": "LLGemm_Silu_kernel",
6+
"flops": 33558528,
7+
"bytes": 33574912,
8+
"notes": "M=4096, K=4096. FLOPs: 2*M*K + M (two GEMVs + SiLU + mul). Bytes: read A[M*K]+B[K] + write C[M/2], all FP16"
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "Online Softmax",
3+
"description": "Row-wise softmax over expert routing logits for MoE models",
4+
"command": "./softmax_bench 128 64",
5+
"kernel_filter": "moeSoftmax",
6+
"flops": 40960,
7+
"bytes": 49152,
8+
"notes": "num_rows=128, num_cols=64. FLOPs: 8192*5 (sub,exp,add,div,mul per element). Bytes: read FP16 input + write FP32 output"
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "RMSNorm",
3+
"description": "RMS normalization over hidden dimension: normalize by RMS, scale by learned weight",
4+
"command": "./rmsnorm_bench 128 4096",
5+
"kernel_filter": "rms_norm_kernel",
6+
"flops": 2097408,
7+
"bytes": 2105344,
8+
"notes": "num_tokens=128, hidden_size=4096. FLOPs: 128*(4*4096+2). Bytes: read input+weight + write output, all FP16"
9+
}

0 commit comments

Comments
 (0)