Optimize Triton Block Parameters

Autotune Triton GEMM block sizes and launch parameters for GPU throughput.

54|7|Updated Apr 10, 2026
One-click install
npx skills add https://github.com/tensormux/kernel-skills --skill optimize-triton-block-parameters
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Optimize Triton Block Parameters
Source: https://github.com/tensormux/kernel-skills/tree/main/skills/triton/optimize-triton-block-parameters
Command: npx skills add https://github.com/tensormux/kernel-skills --skill optimize-triton-block-parameters

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill guides the agent to systematically select and tune Triton launch parameters (BLOCK_M, BLOCK_N, BLOCK_K, num_warps, and num_stages) to maximize GEMM-style kernel throughput while respecting hardware constraints.

Core Features & Use Cases

  • Systematic autotune for block sizes and parallelism to improve performance on GPUs such as A100 and H100.
  • Shape- and dtype-aware configuration that preserves correctness and efficiency across representative problem instances.
  • Reproducible benchmark-driven workflow that documents the winning configuration and expected throughput.

Quick Start

Provide a representative Triton GEMM kernel and hardware target, then run the autotune workflow to discover the optimal BLOCK_M, BLOCK_N, BLOCK_K, and related parameters.

Frequently Asked Questions about Optimize Triton Block Parameters

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

FAQPage Schema
How do I tune Triton block sizes for GEMM kernels to maximize throughput?

Tune Triton block sizes by systematically searching BLOCK_M, BLOCK_N, and BLOCK_K configurations to maximize GEMM kernel throughput. The autotune workflow benchmarks representative shapes against device peak to determine the optimal configuration.

What Triton autotune parameters should I configure for GPU kernel optimization?

Configure BLOCK_M, BLOCK_N, BLOCK_K alongside num_warps and num_stages for GEMM-style kernels. Ensure the autotune key includes all shape dimensions affecting tile geometry and shared memory usage to preserve correctness across instances.

Can I use this autotuning workflow to optimize Triton kernels for both A100 and H100 GPUs?

Yes, the autotuning workflow supports hardware targets including A100, H100, and RTX GPUs. It systematically evaluates block sizes and parallelism configurations to improve performance across these specific hardware architectures.

What is the best way to find the optimal num_warps and num_stages for a Triton GEMM kernel?

The best way is running a reproducible benchmark-driven workflow that tests num_warps and num_stages combinations alongside block sizes. It documents the winning configuration and expected throughput against device peak efficiency.

Why does my Triton autotune search fail to maintain efficiency across different matrix shapes?

Triton autotune fails when the search key omits shape dimensions that affect tile geometry and smem usage. Include all relevant problem dimensions in the autotune key to ensure shape- and dtype-aware configuration that preserves efficiency.