Agent skill

Ttir Model Op Analysis

by tenstorrent in tenstorrent/tt-mlir

Given a .mlir file (or a directory of .mlir files) with TTIR ops, run the same TTIR normalization passes as D2MFrontendPipeline before D2M, then produce per-file outputs: preprocessed.mlir…

Apache-2.0Auto-check passedDatabases

Install Ttir Model Op Analysis

skills CLI
$ npx skills add tenstorrent/tt-mlir --skill ttir-model-op-analysis -a claude-code

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

GitHub CLI
$ gh skill install tenstorrent/tt-mlir ttir-model-op-analysis --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/d2m-model-op-analysis .claude/skills/ttir-model-op-analysis && 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
ttir-model-op-analysis
GitHub stars
314
Token cost
~1.8k tokens
SKILL.md length
488 words
Files
1
Skills in repo
9
Repo updated
First seen
Licence
Apache-2.0

At a glance

Given a .mlir file (or a directory of .mlir files) with TTIR ops, run the same TTIR normalization passes as D2MFrontendPipeline before D2M, then produce per-file outputs: preprocessed.mlir…

  • Works in 2 steps: Run the frontend TTIR normalization… → Fill the report and ops.mlir
  • Tasks that involve Database schema design
  • SKILL.md covers Step 1: Run the frontend TTIR…, Step 2: Fill the report and… and Next: compile/run the snippets
  • Calls python

What it does

Ttir Model Op Analysis is an agent skill from tenstorrent/tt-mlir. Given a .mlir file (or a directory of .mlir files) with TTIR ops, run the same TTIR normalization passes as D2MFrontendPipeline before D2M, then produce per-file outputs: preprocessed.mlir, ttir-op-report.txt (op counts from normalized IR), and ops.mlir (one func per unique op configuration, golden-style). Optional: per-pass IR dumps.

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.

It sits in Databases, covering Database schema design. It works with vLLM. The repository describes itself as: Tenstorrent MLIR compiler. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Database schema design

Example prompts

  • “/ttir-model-op-analysis”

Requirements

  • Python 3

Workflow steps

2 steps, taken from the step headings in SKILL.md.

  1. Run the frontend TTIR normalization pipeline
  2. Fill the report and ops.mlir

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

Ttir Model Op Analysis loads about 1.8k tokens when it runs. Until then it costs about 93 tokens; SKILL.md has 488 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~93
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). 488 words, ~1,834 tokens.

Download SKILL.mdSave it as .claude/skills/ttir-model-op-analysis/SKILL.md (or your agent's skills folder).
name
ttir-model-op-analysis
description
Given a `.mlir` file (or a directory of `.mlir` files) with TTIR ops, run the same TTIR normalization passes as `D2MFrontendPipeline` before D2M, then produce per-file outputs: `preprocessed.mlir`, `ttir-op-report.txt` (op counts from normalized IR), and `ops.mlir` (one func per unique op configuration, golden-style). Optional: per-pass IR dumps.

TTIR model op analysis (post-frontend-normalization)

Given a .mlir file (or a directory of .mlir files, e.g. a multi-graph model) containing TTIR ops (from vLLM, torch-mlir, or tt-forge), normalize it the way the compiler does before D2M, then inventory which TTIR ops (and shapes) appear. Do not open TTIRToD2M.cpp, grep populateTTIRToD2MPatterns, or produce "D2M coverage" unless the user explicitly asks for that comparison.

The input can be:

  • A single .mlir file (e.g. model.mlir)
  • A directory of .mlir files (e.g. vllm_opt/ containing graph1.mlir, graph2.mlir). Each file is processed independently with per-graph reports.

Step 1: Run the frontend TTIR normalization pipeline

These passes match createD2MFrontendPipeline in lib/Dialect/D2M/Pipelines/D2MPipelines.cpp:

#Pass flagShort name (for filenames)
1--canonicalizecanonicalize
2--ttir-predicate-type-alignmentpredicate-type-alignment
3--ttir-element-type-normalizationelement-type-normalization
4--ttir-to-ttir-decompositiondecomposition
5--ttir-explicate-tmsexplicate-tms
6--ttir-erase-inverse-opserase-inverse-ops
7--ttir-move-reshape-to-constantmove-reshape-to-constant
8--ttir-fold-constant-reshape-broadcastfold-constant-reshape-broadcast
9--ttir-implicit-broadcast-foldimplicit-broadcast-fold
Single-file mode

Create <basename>/ next to the input (basename = filename without .mlir):

<basename>/
  preprocessed.mlir              # IR after all passes above
  ttir-op-report.txt             # counts + sorted mnemonic list (see below)
  ops.mlir                       # one func per unique TTIR op configuration
bash
source env/activate
INPUT="<input.mlir>"
BASENAME="$(basename "$INPUT" .mlir)"
mkdir -p "$BASENAME"

ttmlir-opt \
  --canonicalize \
  --ttir-predicate-type-alignment \
  --ttir-element-type-normalization \
  --ttir-to-ttir-decomposition \
  --ttir-explicate-tms \
  --ttir-erase-inverse-ops \
  --ttir-move-reshape-to-constant \
  --ttir-fold-constant-reshape-broadcast \
  --ttir-implicit-broadcast-fold \
  -o "$BASENAME/preprocessed.mlir" \
  "$INPUT"
Directory mode (multi-graph models)

When the input is a directory like vllm_opt/ containing graph1.mlir, graph2.mlir, etc., loop over each file and create a subdirectory per graph. Each subdirectory uses clean names -- the folder provides the graph context:

vllm_opt/
  graph1.mlir                        # original input
  graph2.mlir
  ttir-op-report.txt                 # combined report across all graphs
  graph1/                            # per-graph output folder
    preprocessed.mlir
    ttir-op-report.txt
    ops.mlir
  graph2/
    preprocessed.mlir
    ttir-op-report.txt
    ops.mlir
bash
source env/activate
INPUT_DIR="<dir>"
for f in "$INPUT_DIR"/*.mlir; do
  STEM="$(basename "$f" .mlir)"
  mkdir -p "$INPUT_DIR/$STEM"
  ttmlir-opt \
    --canonicalize \
    --ttir-predicate-type-alignment \
    --ttir-element-type-normalization \
    --ttir-to-ttir-decomposition \
    --ttir-explicate-tms \
    --ttir-erase-inverse-ops \
    --ttir-move-reshape-to-constant \
    --ttir-fold-constant-reshape-broadcast \
    --ttir-implicit-broadcast-fold \
    -o "$INPUT_DIR/$STEM/preprocessed.mlir" \
    "$f" || { echo "FAILED on $f"; continue; }
done
ttir-op-report.txt and ops.mlir

Do not hand-roll parsing. From the repo root (any Python 3.12+; no venv import deps). The script accepts multiple paths, so pass all preprocessed files in one command:

bash
python tools/scripts/model_breakdown/ttir_model_op_inventory.py "$INPUT_DIR"/*/preprocessed.mlir

This writes ttir-op-report.txt and ops.mlir next to each preprocessed.mlir, plus a combined ttir-op-report.txt at the common parent directory with per-file summary and merged mnemonic counts.

Optional flags: --report PATH, --ops PATH (single-file only), -v.

The script reports: total "ttir.*" instances, per-mnemonic counts (with optional percentages), distinct mnemonic count, and distinct op configurations (SSA-normalized op lines). ops.mlir follows the same shape as test/python/golden/mlir_snippets/models/qwen3_4b/ops.mlir: one func.func per unique configuration (<mnemonic>_<index>), args %arg0, ..., single op + return. For multi-result ops such as ttir.sort and ttir.topk, the generated op must use MLIR multi-result binding syntax (%0:2 = ...) and return projected results (return %0#0, %0#1 : ...). If you see operation defines 2 results but was provided 1 to bind, regenerate with tools/scripts/model_breakdown/ttir_model_op_inventory.py instead of hand-editing every snippet.

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

ttir.full and ttir.constant are excluded from ops.mlir unless their result is directly returned by the module -- they almost always just produce values consumed by other ops, and are already inlined as const producers inside those ops' test functions. The report still counts them.

It assumes one generic TTIR op per line (normal ttmlir-opt output). If needed, sanity-check parse with ttmlir-opt on ops.mlir.

Optional: dump IR after each pass

Only if the user asks. Same pass loop as above; write <basename>/<basename>.<short-name>.mlir for each stage. Final stage is the source for ttir-op-report.txt and ops.mlir (same as *.implicit-broadcast-fold.mlir when you ran all nine).

bash
source env/activate
INPUT="<input.mlir>"
BASENAME="$(basename "$INPUT" .mlir)"
mkdir -p "$BASENAME"
PREV="$INPUT"
declare -a PASSES=(
  "--canonicalize|canonicalize"
  "--ttir-predicate-type-alignment|predicate-type-alignment"
  "--ttir-element-type-normalization|element-type-normalization"
  "--ttir-to-ttir-decomposition|decomposition"
  "--ttir-explicate-tms|explicate-tms"
  "--ttir-erase-inverse-ops|erase-inverse-ops"
  "--ttir-move-reshape-to-constant|move-reshape-to-constant"
  "--ttir-fold-constant-reshape-broadcast|fold-constant-reshape-broadcast"
  "--ttir-implicit-broadcast-fold|implicit-broadcast-fold"
)
for entry in "${PASSES[@]}"; do
  IFS='|' read -r FLAG SHORTNAME <<< "$entry"
  OUT="$BASENAME/$BASENAME.$SHORTNAME.mlir"
  ttmlir-opt $FLAG -o "$OUT" "$PREV" || { echo "FAILED at: $FLAG"; break; }
  PREV="$OUT"
done

NOTE: If a pass fails, check include/ttmlir/Dialect/TTIR/Transforms/Passes.td for the registered flag. Some setups need --ttcore-register-device="system-desc-path=..." before other passes.

Step 2: Fill the report and ops.mlir

Run tools/scripts/model_breakdown/ttir_model_op_inventory.py on each preprocessed.mlir file (single-file mode). See above.

Next: compile/run the snippets

To compile or execute the generated ops.mlir on device, see the run-ops-mlir-snippets skill.

© 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/d2m-model-op-analysis of tenstorrent/tt-mlir.

Open the folder on GitHubat commit 78b7044

Compare with similar skills

Ttir Model Op Analysis 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.

Ttir Model Op Analysis compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Ttir Model Op Analysis this skilltenstorrent/tt-mlir314—~1.8kAutomated safety check: PassApache-2.0
Gptqmodel Tokenizer NormalizationModelCloud/GPTQModel1.3k—~1.1kAutomated safety check: PassCustom licence
SQL Optimization Patternsynulihao/AgentSkillOS61811 repos~3.3kAutomated safety check: PassNone
Datamodellmnimbalyst/nimbalyst1.9k—~713Automated safety check: PassMIT
Add Mpk Taskmirage-project/mirage2.5k—~4.5kAutomated safety check: PassApache-2.0
Sqlite Schema Designfastrepl/anarlog9.5k—~1.9kAutomated safety check: PassMIT

Similar skills

  • Diagnose and correct GPT-QModel tokenizer initialization, tokenization normalization, special-token handling, prompt rendering, and chat-template problems.

    1.3k GitHub stars~1.1k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • SQL Optimization Patterns

    ynulihao/AgentSkillOS

    Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries.

    618 GitHub starsUsed in 11 repos~3.3k tokens
    DatabasesAuto-check passed
  • Datamodellm

    nimbalyst/nimbalyst

    Create visual data models for database schemas using Nimbalyst's DataModelLM editor.

    1.9k GitHub stars~713 tokensUpdated today
    DatabasesAuto-check passed
  • Add Mpk Task

    mirage-project/mirage

    Step-by-step guide for adding a new task implementation to Mirage Persistent Kernel (MPK).

    2.5k GitHub stars~4.5k tokensUpdated 3 days ago
    DatabasesAuto-check passed
  • Sqlite Schema Design

    fastrepl/anarlog

    Design or review schemas for crates/cloudsync using SQLite Sync constraints, not generic SQLite advice.

    9.5k GitHub stars~1.9k tokensUpdated today
    DatabasesAuto-check passed
  • DB Migrations

    kurealnum/dotfiles

    A skill your agent uses when generating or regenerating Drizzle migration files, changing database schema tables or columns, resolving migration sequence conflicts after rebase, reviewing migration…

    290 GitHub stars~820 tokensUpdated 6 mo ago
    DatabasesAuto-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
  • Run Ops Mlir Snippets

    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.

    314 GitHub stars~1.8k 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

Works with

Categories

Questions about Ttir Model Op Analysis

What does Ttir Model Op Analysis do?

Given a .mlir file (or a directory of .mlir files) with TTIR ops, run the same TTIR normalization passes as D2MFrontendPipeline before D2M, then produce per-file outputs: preprocessed.mlir…. Ttir Model Op Analysis is an agent skill from tenstorrent/tt-mlir.mlir (one func per unique op configuration, golden-style).

When should I use Ttir Model Op Analysis?

Ttir Model Op Analysis fits situations like: tasks that involve Database schema design.

How do I install Ttir Model Op Analysis in Claude Code?

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

How do I install Ttir Model Op Analysis in Codex?

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

Can I use Ttir Model Op Analysis 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 ttir-model-op-analysis -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/ttir-model-op-analysis, .gemini/skills/ttir-model-op-analysis, .github/skills/ttir-model-op-analysis and .opencode/skills/ttir-model-op-analysis in your project.

What does Ttir Model Op Analysis need to run?

Going by SKILL.md and its folder, Ttir Model Op Analysis needs the command-line tools its instructions call (python). Our summary lists: Python 3.

Does Ttir Model Op Analysis 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 Ttir Model Op Analysis 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 Ttir Model Op Analysis use?

Ttir Model Op Analysis 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 Ttir Model Op Analysis 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 Ttir Model Op Analysis?

Skills that share tags, products or a category with Ttir Model Op Analysis: Gptqmodel Tokenizer Normalization (ModelCloud/GPTQModel, 1.3k stars), SQL Optimization Patterns (ynulihao/AgentSkillOS, 618 stars), Datamodellm (nimbalyst/nimbalyst, 1.9k stars) and Add Mpk Task (mirage-project/mirage, 2.5k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Ttir Model Op Analysis?

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.