Agent skill

Run Ops Mlir Snippets

by tenstorrent in tenstorrent/tt-mlir

Compile and optionally execute every func.func in an ops.mlir-style snippet file (or every .mlir file in a directory) using runopsmlirsnippets.py.

Apache-2.0Auto-check passed

Install Run Ops Mlir Snippets

skills CLI
$ npx skills add tenstorrent/tt-mlir --skill run-ops-mlir-snippets -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install tenstorrent/tt-mlir run-ops-mlir-snippets --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/tenstorrent/tt-mlir.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/run-ops-mlir-snippets .claude/skills/run-ops-mlir-snippets && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
run-ops-mlir-snippets
GitHub stars
314
Token cost
~1.8k tokens
SKILL.md length
600 words
Files
1
Skills in repo
9
Repo updated
First seen
Licence
Apache-2.0

At a glance

Compile and optionally execute every func.func in an ops.mlir-style snippet file (or every .mlir file in a directory) using runopsmlirsnippets.py.

  • Works in 3 steps: Summary at top -- target, mode,… → Per-op table -- one row per function… → Failure details -- numbered list with…
  • The user wants to compile
  • SKILL.md covers Prerequisites, Basic usage, Flags and Common workflows, plus 4 more sections
  • Calls python

What it does

Run Ops Mlir Snippets is an agent skill from tenstorrent/tt-mlir. Compile and optionally execute every func.func in an ops.mlir-style snippet file (or every .mlir file in a directory) using runopsmlirsnippets.py. Use when the user wants to compile or run TTIR op snippets on device, test ops.mlir files, or check which ops compile/execute successfully.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: Tenstorrent MLIR compiler. The licence is Apache-2.0.

When your agent uses it

  • The user wants to compile
  • Run TTIR op snippets on device
  • Test ops.mlir files
  • Check which ops compile/execute successfully

Example prompts

  • “/run-ops-mlir-snippets”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Summary at top -- target, mode, pass/fail counts at a glance.
  2. Per-op table -- one row per function showing compile (and execute) status.
  3. Failure details -- numbered list with the Python exception and

What it can do on your machine

Read from SKILL.md and the folder at commit 78b7044. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Run Ops Mlir Snippets loads about 1.8k tokens when it runs. Until then it costs about 78 tokens; SKILL.md has 600 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~78
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from tenstorrent/tt-mlir at commit 78b7044, republished under its Apache-2.0 licence (© tenstorrent). 600 words, ~1,818 tokens.

Download SKILL.mdSave it as .claude/skills/run-ops-mlir-snippets/SKILL.md (or your agent's skills folder).
name
run-ops-mlir-snippets
description
Compile and optionally execute every func.func in an ops.mlir-style snippet file (or every .mlir file in a directory) using `run_ops_mlir_snippets.py`. Use when the user wants to compile or run TTIR op snippets on device, test ops.mlir files, or check which ops compile/execute successfully.

Run ops.mlir snippets (compile + execute)

Given an ops.mlir-style file (a module containing one func.func per unique TTIR op configuration), compile each function to TTMetal (or TTNN) and optionally execute on device.

The input can be:

  • A single .mlir file (e.g. ops.mlir)
  • A directory of .mlir files -- processes every *.mlir in it. Each file gets its own report. Caution: only point a directory at folders that contain ops-style snippet files, not raw/preprocessed model IR.

The driver script is tools/scripts/model_breakdown/run_ops_mlir_snippets.py.

Prerequisites

bash
source env/activate
ttrt query --save-artifacts                    # creates system descriptor
export SYSTEM_DESC_PATH="$(pwd)/ttrt-artifacts/system_desc.ttsys"

Basic usage

Single file:

bash
python tools/scripts/model_breakdown/run_ops_mlir_snippets.py path/to/ops.mlir

Multiple files (per-file reports + combined report at common parent):

bash
python tools/scripts/model_breakdown/run_ops_mlir_snippets.py path/to/*/ops.mlir

Directory (processes every *.mlir in the dir):

bash
python tools/scripts/model_breakdown/run_ops_mlir_snippets.py path/to/dir/

This compiles and executes every snippet. Each function is wrapped in its own module, compiled via compile_ttir_module_to_flatbuffer, and run with execute_fb. In directory mode, the device is opened once and shared across all files.

Flags

FlagEffect
--skip-execCompile only; do not open a device or run
--target {ttmetal,ttnn}Compile target (default: ttmetal)
--sys-desc PATHOverride SYSTEM_DESC_PATH
--output-root DIRRoot for artifact dirs (default: .)
--save-artifactsKeep flatbuffers / compiled MLIR under the artifact dir
--print-irPrint compiled MLIR to stdout
--fail-fastStop on first compile or execution failure
--disable-eth-dispatchSame as pytest --disable-eth-dispatch
--func NAMEOnly process function names containing NAME
--listList matching function names without compiling or running

Common workflows

Compile-only triage (no device needed)

Use --skip-exec to find which ops fail at compile time without requiring hardware:

bash
python tools/scripts/model_breakdown/run_ops_mlir_snippets.py path/to/ops.mlir --skip-exec
List or run one snippet

Use --list to see the functions in an ops.mlir, and combine --func with --skip-exec to compile one matching snippet without opening a device:

bash
python tools/scripts/model_breakdown/run_ops_mlir_snippets.py path/to/ops.mlir --list
python tools/scripts/model_breakdown/run_ops_mlir_snippets.py path/to/ops.mlir --func add_0 --skip-exec
Multi-graph model directory

After running the ttir-model-op-analysis skill on a multi-graph directory like vllm_opt/, each graph gets its own subdirectory with an ops.mlir. Pass all of them in one command:

bash
python tools/scripts/model_breakdown/run_ops_mlir_snippets.py vllm_opt/*/ops.mlir --skip-exec

This writes ops-run-report.txt next to each ops.mlir, plus a combined ops-run-report.txt at the common parent with per-file summaries and all failures in one place:

vllm_opt/
  ops-run-report.txt            # combined report across all graphs
  graph1/
    ops.mlir
    ops-run-report.txt          # compile results for graph1
  graph2/
    ops.mlir
    ops-run-report.txt          # compile results for graph2

Important: pass the specific ops.mlir files, not the subdirectories. The subdirectories also contain preprocessed.mlir (the full model graph), which is not a snippet file and will produce a useless failure report if the runner tries to process it.

Fail-fast to find the first broken op
bash
python tools/scripts/model_breakdown/run_ops_mlir_snippets.py path/to/ops.mlir --fail-fast
Save artifacts for debugging
bash
python tools/scripts/model_breakdown/run_ops_mlir_snippets.py path/to/ops.mlir \
    --save-artifacts --output-root /tmp/snippets --print-ir

Artifacts land in <output-root>/ops_mlir_snippets/<filename>/<func_name>/<target>/.

Show full SKILL.md (237 more words)Show less

Report

The script writes a <stem>-run-report.txt in the same directory as each input .mlir file (e.g. ops-run-report.txt for ops.mlir). In directory mode, each file gets its own report. The report has three sections:

  1. Summary at top -- target, mode, pass/fail counts at a glance.
  2. Per-op table -- one row per function showing compile (and execute) status.
  3. Failure details -- numbered list with the Python exception and the captured MLIR diagnostics (L1 memory exceeded, missing parser, etc.).

Example (compile-only):

target:  ttmetal
input:   /path/to/ops.mlir
mode:    compile-only
total:   50 ops

  compile: 47/50 passed, 3 failed

────────────────────────────────────────────────────────────────────────

  func_name   compile
  ──────────  ───────
  softmax_0   ok
  matmul_0    FAILED
  reshape_0   FAILED
  ...

────────────────────────────────────────────────────────────────────────

  Failure details (3)

  [1] matmul_0 — compile FAILED
      exception: Failed to run pass manager
      diagnostics:
        can't find feasible allocation because all 8 var(s) are bound
        error: 'func.func' op required L1 memory usage 3309568 exceeds
               memory capacity 1395424 (usable space is [103712, 1499136))

  [2] reshape_0 — compile FAILED
      exception: No parser found for opview <class '...ReshapeOp'>

With --skip-exec, the execute column is omitted. Diagnostics are captured from C-level stderr so MLIR allocator errors, verification failures, etc. appear in the report even though the Python exception only says "Failed to run pass manager".

Interpreting stdout

The script also prints a banner per snippet to stdout:

============================================================
Snippet: ops.mlir/softmax_0
============================================================
  compile: ok
  execute: ok

On failure you'll see compile: FAILED: <error> or execute: FAILED: <error>. At the end: either all N snippet(s) succeeded across M file(s) or N snippet(s) failed across M file(s).

Error handling

  • Compile failures skip to the next snippet (unless --fail-fast).
  • Execution failures close and re-open the device before continuing, so one hang doesn't block the rest of the run.
  • If a snippet causes a device hang that persists across re-open, use --skip-exec to isolate compile issues, then test individual snippets by extracting the function into its own file.

Generating ops.mlir

If you don't already have an ops.mlir, see the ttir-model-op-analysis skill which produces one from a model's TTIR dump via tools/scripts/model_breakdown/ttir_model_op_inventory.py.

© tenstorrent, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/run-ops-mlir-snippets of tenstorrent/tt-mlir.

Open the folder on GitHubat commit 78b7044

Compare with similar skills

Run Ops Mlir Snippets next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Run Ops Mlir Snippets compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Run Ops Mlir Snippets this skilltenstorrent/tt-mlir314—~1.8kAutomated safety check: PassApache-2.0
Optionsasgeirtj/system_prompts_leaks69k—~918Automated safety check: PassCC0-1.0
Executealirezarezvani/claude-skills28k—~831Automated safety check: PassMIT
Debugging Executionsn8n-io/n8n207k—~2.6kAutomated safety check: PassCustom licence
Terminal Opsaffaan-m/ECC277k2 repos~750Automated safety check: PassMIT
Project Flow Opsaffaan-m/ECC277k3 repos~787Automated safety check: PassMIT

Similar skills

  • Options

    asgeirtj/system_prompts_leaks

    Present multiple design options as a vertical stack of anchored turns

    69k GitHub stars~918 tokensUpdated yesterday
    Auto-check passed
  • Execute

    alirezarezvani/claude-skills

    /cs:execute <decision — Generate a 90-day execution plan with weekly milestones, DRIs, and check-in cadence from an approved decision.

    28k GitHub stars~831 tokensUpdated 1 mo ago
    Product & Project ManagementAuto-check passed
  • Official

    Debug failed or wrong-output workflow executions using executions tools.

    207k GitHub stars~2.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Terminal Ops

    affaan-m/ECC

    Evidence-first repo execution workflow for ECC. An agent skill from affaan-m/ECC.

    277k GitHub starsUsed in 2 repos~750 tokens
    Testing & QAAuto-check passed
  • Project Flow Ops

    affaan-m/ECC

    Operate execution flow across GitHub and Linear by triaging issues and pull requests, linking active work, and keeping GitHub public-facing while Linear remains the internal execution layer.

    277k GitHub starsUsed in 3 repos~787 tokens
    DevelopmentAuto-check passed
  • Ulw Execute

    code-yeongyu/oh-my-openagent

    Executes a written ulw-plan work plan with Boulder state, evidence ledger, worktree discipline, and parallel subagents.

    70k GitHub stars~6.3k tokensUpdated today
    Agent WorkflowsAuto-check passed

More from tenstorrent/tt-mlir

All 9 skills in this repo
  • Add Op

    tenstorrent/tt-mlir

    How to add a new operation (op) to the tt-mlir compiler across all layers: TTIR/TTNN dialect definitions, StableHLO composite conversion, TTIR-to-TTNN conversion, EmitC/EmitPy conversions…

    314 GitHub stars~11k tokensUpdated yesterday
    Auto-check passed
  • Add Ttir Builder Op

    tenstorrent/tt-mlir

    Add full builder API support (@tag, @parse, @split) for a TTIR op.

    314 GitHub stars~1.6k tokensUpdated yesterday
    Auto-check passed
  • Add a new composite op decomposition pattern to the TTMetal pipeline.

    314 GitHub stars~2.2k tokensUpdated yesterday
    Auto-check passed
  • Uplift Ttsim CI

    tenstorrent/tt-mlir

    Uplift the TTSim version used by tt-mlir CI and refresh WH/BH simulator skips.

    314 GitHub stars~3.1k tokensUpdated yesterday
    Auto-check passed
  • Validate a tt-mlir PR against tt-xla by creating a cherry-picked branch and triggering CI.

    314 GitHub stars~4.5k tokensUpdated yesterday
    Auto-check passed
  • Triage Tt Metal Asserts

    tenstorrent/tt-mlir

    Triage a tt-metal uplift diff or digest of TTFATAL validation changes against what tt-mlir guarantees at each optimization level (0: workarounds only, 1: optimizer with DRAM-only fallback, 2: L1…

    314 GitHub stars~7.8k tokensUpdated yesterday
    Auto-check passed

Questions about Run Ops Mlir Snippets

What does Run Ops Mlir Snippets do?

Compile and optionally execute every func.func in an ops.mlir-style snippet file (or every .mlir file in a directory) using runopsmlirsnippets.py. Run Ops Mlir Snippets is an agent skill from tenstorrent/tt-mlir.py.

When should I use Run Ops Mlir Snippets?

Run Ops Mlir Snippets fits situations like: the user wants to compile; run TTIR op snippets on device; test ops.mlir files; check which ops compile/execute successfully.

How do I install Run Ops Mlir Snippets in Claude Code?

Run `npx skills add tenstorrent/tt-mlir --skill run-ops-mlir-snippets -a claude-code`. Or copy the skill folder (.claude/skills/run-ops-mlir-snippets in tenstorrent/tt-mlir) into .claude/skills/run-ops-mlir-snippets in your project. Claude Code loads it when a task matches its description.

How do I install Run Ops Mlir Snippets in Codex?

Run `npx skills add tenstorrent/tt-mlir --skill run-ops-mlir-snippets -a codex`. Or copy the skill folder (.claude/skills/run-ops-mlir-snippets in tenstorrent/tt-mlir) into .agents/skills/run-ops-mlir-snippets in your project. Codex loads it when a task matches its description.

Can I use Run Ops Mlir Snippets in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add tenstorrent/tt-mlir --skill run-ops-mlir-snippets -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/run-ops-mlir-snippets, .gemini/skills/run-ops-mlir-snippets, .github/skills/run-ops-mlir-snippets and .opencode/skills/run-ops-mlir-snippets in your project.

What does Run Ops Mlir Snippets need to run?

Going by SKILL.md and its folder, Run Ops Mlir Snippets needs the command-line tools its instructions call (python). Our summary lists: Python 3.

Does Run Ops Mlir Snippets access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Run Ops Mlir Snippets safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Run Ops Mlir Snippets use?

Run Ops Mlir Snippets is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Run Ops Mlir Snippets use?

About 1.8k tokens (SKILL.md is roughly 7.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Run Ops Mlir Snippets?

Skills that share tags, products or a category with Run Ops Mlir Snippets: Options (asgeirtj/system_prompts_leaks, 69k stars), Execute (alirezarezvani/claude-skills, 28k stars), Debugging Executions (n8n-io/n8n, 207k stars) and Terminal Ops (affaan-m/ECC, 277k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Run Ops Mlir Snippets?

tenstorrent (a GitHub organization) maintains it in tenstorrent/tt-mlir, which has 314 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on October 10, 2026.

Source: tenstorrent/tt-mlir on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.