add-op

Guide engineers through adding a new operation to the tt-mlir stack.

295|145|Updated Jun 17, 2024
One-click install
npx skills add https://github.com/tenstorrent/tt-mlir --skill add-op
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-op
Source: https://github.com/tenstorrent/tt-mlir/tree/main/.claude/skills/add-op
Command: npx skills add https://github.com/tenstorrent/tt-mlir --skill add-op

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a comprehensive, repeatable blueprint for adding a new operation (op) to the tt-mlir compiler stack, covering TTNN dialects, TTIR dialects, conversions, EmitC/EmitPy, flatbuffers, runtime, and tests to ensure end-to-end integration.

Core Features & Use Cases

  • Structured, end-to-end op addition workflow spanning TTNN definitions, TTIR mappings, TTIR→TTNN conversions, TTNN→EmitC/EmitPy, flatbuffer schema, runtime wiring, and test scaffolding.
  • Guidance anchored to the TTNN type mappings in references/ttnn_type_mapping.md to align C++ API signatures with MLIR definitions.
  • Comprehensive testing scaffolds including TTIR-to-TTNN conversion, StableHLO composites (where applicable), and EmitC/EmitPy pipelines to validate the op across toolchains.

Quick Start

Define the new op in TTNN, propagate it through TTIR and all conversions, then implement runtime and tests as described.

Frequently Asked Questions about add-op

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new op to the tt-mlir compiler stack?

To add a new op to tt-mlir, define the operation in TTNN, propagate it through TTIR mappings, implement TTIR-to-TTNN conversions, wire flatbuffer schemas and runtime, and scaffold tests for end-to-end validation.

What is the full conversion pipeline for a new TTNN operation?

The TTNN operation conversion pipeline spans TTNN definitions, TTIR mappings, TTIR-to-TTNN conversions, and TTNN-to-EmitC/EmitPy transformations to ensure the op integrates across toolchains.

Do I need to update flatbuffer schemas and runtime when adding a tt-mlir op?

Yes, adding a tt-mlir op requires updating flatbuffer schemas and wiring the runtime to ensure the new operation executes correctly end-to-end within the compiler stack.

How do I test a new operation across the tt-mlir and TTNN toolchains?

Test a new tt-mlir operation using comprehensive scaffolds including TTIR-to-TTNN conversion tests, StableHLO composites where applicable, and EmitC/EmitPy pipeline validations.

How do I align C++ API signatures with MLIR definitions for a new TTNN op?

Align C++ API signatures with MLIR definitions for a new TTNN op by referencing the TTNN type mappings to ensure proper consistency across the compiler stack.

What are the limitations of using add-op for mlir operation development?

The add-op workflow focuses specifically on the tt-mlir stack, meaning guidance is anchored to TTNN dialects, TTIR mappings, and EmitC/EmitPy pipelines rather than general MLIR operation development.