choose-tile-size-and-work-partitioning

choose-tile-size-and-work-partitioning is a skill for Claude Code, Codex from tensormux/kernel-skills. It costs 0 tokens per session (3,166 once invoked), scanned A, original, MIT.

A guide for choosing the block sizes and thread assignments used by CUDA or Triton GPU kernels. It considers the data shape, memory use, register use, and how many GPU workers can stay active.

In plain words
What is it for?
Use it when designing or tuning a tiled GPU kernel, especially for irregular input sizes or Triton settings such as BLOCK_M, BLOCK_N, BLOCK_K, num_warps, and num_stages.
Why use it?
Poor choices can leave GPU workers idle, waste memory, or make a kernel slower than expected. It helps investigate low GPU usage and inefficient memory access.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when designing or tuning a tiled GPU kernel, especially for irregular input sizes or Triton settings such as BLOCK_M, BLOCK_N, BLOCK_K, num_warps, and num_stages.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tensormux/kernel-skills/choose-tile-size-and-work-partitioning
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add tensormux/kernel-skills --skill choose-tile-size-and-work-partitioning
Clone the repo
git clone --depth 1 https://github.com/tensormux/kernel-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for choose-tile-size-and-work-partitioning

README.md
[![agentmods](https://agentmods.dev/badge/skills/tensormux/kernel-skills/choose-tile-size-and-work-partitioning/github.svg)](https://agentmods.dev/skills/tensormux/kernel-skills/choose-tile-size-and-work-partitioning)
Your own site
<a href="https://agentmods.dev/skills/tensormux/kernel-skills/choose-tile-size-and-work-partitioning"><img src="https://agentmods.dev/badge/skills/tensormux/kernel-skills/choose-tile-size-and-work-partitioning/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for choose-tile-size-and-work-partitioning

Your own site · 80×15
<a href="https://agentmods.dev/skills/tensormux/kernel-skills/choose-tile-size-and-work-partitioning"><img src="https://agentmods.dev/badge/skills/tensormux/kernel-skills/choose-tile-size-and-work-partitioning.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,166 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.03166
Opus 5 $0.00000 $0.01583
Sonnet 5 $0.00000 $0.00633
Haiku 4.5 $0.00000 $0.00317

Measured 12d ago against content hash 74a156c04efd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

choose-tile-size-and-work-partitioning scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/patterns/choose-tile-size-and-work-partitioning/SKILL.md · 122 lines

How it starts

The opening of the file, as written. The whole thing — 122 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Skill: Choose Tile Size and Work Partitioning

Purpose

Guide the agent through selecting tile sizes and work partitioning strategies for a CUDA or Triton kernel, based on shared memory budget, register pressure, occupancy targets, problem shape, and access pattern.

Use this when

  • Designing a new tiled kernel and the tile size and launch configuration have not yet been chosen.
  • An existing kernel has suboptimal performance and the cause may be a poor tile size, low occupancy, or inefficient work partitioning.
  • The problem shape has an irregular or non-power-of-2 size that makes default tile choices potentially wasteful.
  • Writing a Triton kernel where BLOCK_M, BLOCK_N, BLOCK_K, num_warps, and num_stages must be chosen.
  • Profiling shows low SM utilization, high idle warp cycles, or memory throughput below roofline estimates.

Do not use this when

  • Using a library (cuBLAS, cuDNN, CUTLASS with auto-tuning) that handles tile size selection internally. Trust the library's tuner unless profiling shows a clear gap.
  • The kernel is purely streaming (one pass, no reuse) and tiling provides no shared memory reuse benefit. In that case, work partitioning reduces to choosing a block size that achieves good occupancy and coalesced access, which is a simpler problem.
  • The problem is so small (total work fits in one or two blocks) that tile size selection is irrelevant compared to launch overhead.

Inputs the agent should gather first

  • Problem dimensions (e.g., M, N, K for GEMM; sequence length and head dimension for attention; reduction length for softmax).
  • Element dtype: determines element size in bytes (fp16 = 2B, fp32 = 4B, bf16 = 2B, int8 = 1B).
  • Target GPU architecture: shared memory capacity per SM (48 KB–228 KB depending on architecture and configuration), L2 size, number of SMs, warp size (always 32 for CUDA).
  • Maximum shared memory per block (for sm_86: up to 100 KB with cudaFuncSetAttribute(f, cudaFuncAttributeMaxDynamicSharedMemorySize, ...)).
  • Number of registers available per SM (65536 for most modern architectures), and target occupancy.
  • Whether the problem shape is static or dynamic at kernel launch time.
  • Whether the input access pattern is coalesced in the tile dimension being chosen.
  • For Triton: whether autotuning will be used to sweep tile sizes, or if a fixed tile must be chosen.

Read the full file on GitHub · 122 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 122 lines · 0 tokens per session scan A 74a156c04efd

Subscribe to this mod's changes

choose-tile-size-and-work-partitioning is a skill published in the GitHub repository tensormux/kernel-skills (75 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,166 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories