tune-multiplication

Optimize GEMV, GEMM, and grouped GEMM kernels on NVIDIA Ampere and Hopper GPUs.

168|55|Updated Jun 3, 2025
One-click install
npx skills add https://github.com/tile-ai/TileOPs --skill tune-multiplication
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tune-multiplication
Source: https://github.com/tile-ai/TileOPs/tree/main/.claude/skills/tune-multiplication
Command: npx skills add https://github.com/tile-ai/TileOPs --skill tune-multiplication

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a compact, reproducible standard operating procedure for profiling and optimizing matrix-related operators (GEMV, GEMM, Grouped GEMM) to reach high bandwidth or TFLOPS utilization on NVIDIA Ampere/Hopper GPUs by identifying memory vs compute bottlenecks, enforcing warp-level coalescing, and selecting hardware-aligned tile and pipeline parameters.

Core Features & Use Cases

  • Bottleneck classification using arithmetic intensity to decide memory-bound versus compute-bound strategies.
  • Memory-bound guidance: warp coalescing rules, shared memory reuse patterns, reduce-thread sizing, and Hopper-specific tips (TMA, cp.async, L2 behavior).
  • Compute-bound guidance: tensor-core alignment constraints, shared-memory budgeting, and double-buffered pipelining recommendations.
  • Autotune strategy and workflow: recommended search spaces, best practices for warmup/reps, logging, validation, and comparison to cuBLAS/torch baselines.
  • Case studies demonstrating real-world gains (e.g., high H200 utilization on large Llama-3 shapes) and pitfalls to avoid.
  • Use case example: tune kernels for a production inference workload (large sequence GEMVs) to recover bandwidth and reduce latency.

Quick Start

Use the tune-multiplication guide to compute arithmetic intensity, verify warp-level memory coalescing, design a hardware-aligned autotune search space, and run the autotuner to record the best GEMV/GEMM configuration.

Frequently Asked Questions about tune-multiplication

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

FAQPage Schema
How do I optimize matrix multiplication kernels for GPU performance?

To optimize matrix multiplication kernels for GPU performance, compute arithmetic intensity to classify bottlenecks, enforce warp-level memory coalescing, design hardware-aligned autotune search spaces, and run the autotuner to record the best configuration.

What is the best way to tune GEMM and GEMV operations on NVIDIA Hopper GPUs?

The best way to tune GEMM and GEMV operations on NVIDIA Hopper GPUs is to apply Hopper-specific memory guidance, utilize tensor core tile alignment, configure double-buffered pipelining, and validate results against cuBLAS baselines.

How do I design an autotune search space for tensor core alignment?

Design an autotune search space for tensor core alignment by defining hardware-aligned tile parameters, budgeting shared memory, setting appropriate warmup and reps, and logging configurations to identify the optimal kernel setup.

Why does my GPU matrix multiplication kernel underperform compared to cuBLAS?

Your GPU matrix multiplication kernel underperforms compared to cuBLAS when it lacks warp-level memory coalescing, suffers from unoptimized shared memory reuse, or uses misaligned tensor core tiles and unconfigured pipeline stages.

Can I use this approach for grouped GEMM tuning on NVIDIA Ampere GPUs?

Yes, you can use this approach for grouped GEMM tuning on NVIDIA Ampere GPUs, as it explicitly supports identifying memory versus compute bottlenecks and selecting hardware-aligned tile and pipeline parameters for production workloads.

When should I use memory-bound versus compute-bound strategies for GPU kernel optimization?

You should use memory-bound versus compute-bound strategies for GPU kernel optimization after computing arithmetic intensity to classify your bottleneck, which determines whether to prioritize warp coalescing or tensor core pipelining.