fuse-elementwise-ops

fuse-elementwise-ops is a skill for Claude Code, Codex from tensormux/kernel-skills. It costs 0 tokens per session (2,391 once invoked), scanned A, original, MIT.

A guide for combining consecutive element-by-element GPU operations into one CUDA or Triton kernel pass. Elementwise operations apply separately to each value, such as adding a bias or applying an activation.

In plain words
What is it for?
Use it when considering fusion of tensor operations or a GEMM/convolution output step, but not for operations such as softmax, layer normalization, or reductions that need communication between values.
Why use it?
It can reduce repeated reads and writes when a sequence is limited by memory speed and its intermediate results are not reused. It also helps decide when fusion would make the code harder to understand or incorrect.

Skill for Claude CodeCodex

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

Good fit Use it when considering fusion of tensor operations or a GEMM/convolution output step, but not for operations such as softmax, layer normalization, or reductions that need communication between values.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tensormux/kernel-skills/fuse-elementwise-ops
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 fuse-elementwise-ops
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 fuse-elementwise-ops

README.md
[![agentmods](https://agentmods.dev/badge/skills/tensormux/kernel-skills/fuse-elementwise-ops/github.svg)](https://agentmods.dev/skills/tensormux/kernel-skills/fuse-elementwise-ops)
Your own site
<a href="https://agentmods.dev/skills/tensormux/kernel-skills/fuse-elementwise-ops"><img src="https://agentmods.dev/badge/skills/tensormux/kernel-skills/fuse-elementwise-ops/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 fuse-elementwise-ops

Your own site · 80×15
<a href="https://agentmods.dev/skills/tensormux/kernel-skills/fuse-elementwise-ops"><img src="https://agentmods.dev/badge/skills/tensormux/kernel-skills/fuse-elementwise-ops.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 2,391 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.02391
Opus 5.5 $0.00000 $0.00956
Sonnet 5.5 $0.00000 $0.00478
Haiku 4.5 $0.00000 $0.00239

Measured 3mo ago against content hash 74e6fecfd760, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

fuse-elementwise-ops 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 3mo 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/fuse-elementwise-ops/SKILL.md · 108 lines

How it starts

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

Skill: Fuse Elementwise Operations

Purpose

Guide the agent through deciding whether to fuse multiple elementwise operations into a single kernel pass, and if so, how to implement the fusion correctly and efficiently in CUDA or Triton.

Use this when

  • Two or more consecutive elementwise operations are applied to the same tensor and the intermediate results are not reused elsewhere.
  • Profiling shows the pipeline is memory-bandwidth bound and the operations between loads and stores are cheap arithmetic.
  • Epilogue fusion into an existing GEMM or convolution kernel is being considered (e.g., bias add + activation after GEMM).
  • The operation chain is simple enough that a fused kernel remains readable and maintainable.
  • torch.compile/inductor is unavailable or insufficient (e.g., custom op, non-standard dtype, or strict latency requirements).

Do not use this when

  • Any operation in the chain requires inter-element communication — softmax, layernorm, and reductions are not elementwise and require separate synchronization steps or multi-pass designs.
  • The operations involve different tensor shapes that require broadcasting logic complex enough to obscure correctness.
  • torch.compile with mode="reduce-overhead" or mode="max-autotune" already fuses the chain adequately — validate this before writing a manual kernel.
  • The chain is so long that register pressure in the fused kernel would reduce occupancy below the unfused baseline.
  • Development and maintenance cost of a custom kernel is not justified by the measured speedup.

Inputs the agent should gather first

  • The ordered list of operations to fuse, with their mathematical definitions.
  • Input and output dtypes for each operation; flag any dtype transitions (e.g., fp16 input, fp32 accumulation, fp16 output).
  • Tensor shapes and memory layouts (contiguous, strided, transposed) for all inputs.
  • Whether any intermediate tensor is consumed by a path other than the next operation in the chain. If yes, fusion is not valid.
  • Target hardware (compute capability, memory bandwidth, L2 size) and whether the workload is bandwidth-bound or compute-bound on that hardware.
  • Whether torch.compile has already been tried and what the result was.
  • Epilogue context: if this follows a GEMM, what CUTLASS or cuBLAS epilogue API is available.

Read the full file on GitHub · 108 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. 3mo ago First seen · 108 lines · 0 tokens per session scan A 74e6fecfd760

Subscribe to this mod's changes

fuse-elementwise-ops is a skill published in the GitHub repository tensormux/kernel-skills (93 stars, last pushed 5mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,391 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

fuse-elementwise-ops compared with skills from other repositories

fuse-elementwise-ops next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
fuse-elementwise-opstensormux/kernel-skillsSkill935mo agoMITA0Claude Code, Codex
design-impl-auditMagicKidd/Rokid-agentic-workflowSkill35mo agononeA0Claude Code, Codex
skill-creatorMagicKidd/Rokid-agentic-workflowSkill35mo agononeA45Claude Code, Codex
brainstormingMagicKidd/Rokid-agentic-workflowSkill35mo agononeA0Claude Code, Codex
diagnoseMagicKidd/Rokid-agentic-workflowSkill35mo agononeA66Claude Code, Codex
prompt-engineeringMagicKidd/Rokid-agentic-workflowSkill35mo agononeA0Claude Code, Codex
setup-matt-pocock-skillsMagicKidd/Rokid-agentic-workflowSkill35mo agononeA124Claude Code