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.
npx skills add tensormux/kernel-skills --skill avoid-warp-divergencegit clone --depth 1 https://github.com/tensormux/kernel-skillsWrote 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.
[](https://agentmods.dev/skills/tensormux/kernel-skills/avoid-warp-divergence)<a href="https://agentmods.dev/skills/tensormux/kernel-skills/avoid-warp-divergence"><img src="https://agentmods.dev/badge/skills/tensormux/kernel-skills/avoid-warp-divergence.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.03187 |
| Opus 5 | $0.00000 | $0.01594 |
| Sonnet 5 | $0.00000 | $0.00637 |
| Haiku 4.5 | $0.00000 | $0.00319 |
Grade A, and why
avoid-warp-divergence 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 8d 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.
How it starts
The opening of the file, as written. The whole thing — 99 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Skill: Avoid Warp Divergence
Purpose
Guide the agent through identifying, classifying, and restructuring warp divergence in CUDA kernels — distinguishing avoidable from unavoidable divergence, applying correct restructuring strategies, and assessing the real performance impact before spending engineering effort.
Use this when
- Profiling shows a high
sm__thread_inst_executed_pipe_alu_pred_on_pct/sm__inst_executedratio indicating significant predicated-off execution, or Nsight Compute'sbranch_efficiencyis notably below 100% - The kernel contains data-dependent branches where different threads in a warp take different paths based on their input data
- The kernel has irregular loop bounds or early-exit conditions that vary per thread
- Sparse or masked computation (e.g., attention masks, pruning masks) introduces branches that not all threads in a warp satisfy
Do not use this when
- The branches are on values that are uniform across the entire warp (e.g., checking a kernel argument or a loop bound that all threads compute identically): these do not cause divergence
- The divergent code is only at the boundary of the input (e.g., the last partial tile): this is unavoidable boundary divergence, and the performance impact is typically negligible for large inputs
- The kernel is memory-bandwidth-bound: eliminating divergence in a memory-bound kernel may not improve throughput because the bottleneck is not instruction throughput
- The divergence restructuring would require significant data reorganization that introduces worse memory access patterns: weigh the tradeoff explicitly
Inputs the agent should gather first
- The divergent code region: what is the branch condition? Is it a simple if/else, a loop with data-dependent bounds, or an early exit?
- What determines the branch: is it a function of thread index only (geometry-based), a function of input data values (data-dependent), or a function of a uniform warp-level value?
- Warp occupancy of each branch path: roughly what fraction of threads in a warp are expected to take each path? If 31 out of 32 threads take the same path and 1 takes the other, the impact is low. If 16 take each path, the serialization cost is highest.
- Branch body complexity: how many instructions are in the divergent region? A 2-instruction divergent branch has negligible cost even with full serialization. A 100-instruction divergent loop body is expensive.
- Hardware target: SM architecture. All current NVIDIA GPUs use the same 32-thread warp SIMT model.
- Whether the divergence is data-dependent or geometry-based: this determines which restructuring strategies apply.
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.
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.
- 8d ago First seen · 99 lines · 0 tokens per session scan A 84404333e5c6
avoid-warp-divergence is a skill published in the GitHub repository tensormux/kernel-skills (73 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,187 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.
Other skills, from other repositories
diagnose
Disciplined diagnosis loop for hard bugs and performance regressions. Reproduce → minimise → hypothesise → instrument → fix → regression-test. Use when user says "diagnose this" / "debug this", reports a bug, says something is broken/throwing/failing, or describes a performance regression.
agenttrace-session-audit
Audit local AI coding-agent sessions with agenttrace for cost, tool failures, latency, anomalies, health, diffs, and CI gates.
sglang-diffusion-benchmark-profile
Use when benchmarking denoise latency or profiling a diffusion bottleneck in SGLang.
systematic-debugging
A step-by-step method for finding the underlying cause of technical problems before changing code. It covers reading errors, reproducing failures, checking recent changes, and tracing data across system components.
investigate
Systematic debugging with root cause investigation. Four phases: investigate, analyze, hypothesize, implement. Iron Law: no fixes without root cause. Use when asked to "debug this", "fix this bug", "why is this broken", "investigate this error", or "root cause analysis". Proactively invoke this skill (do NOT debug…
anti-entropy-governance
Use when touching retiring old logic, collapsing duplicate owners, removing fallbacks, or schema/persistence/source-of-truth boundaries; identify opportunities automatically; destructive execution requires explicit confirmation.