tt-lang

Write TT hardware kernels using a Python DSL with data movement primitives.

341|51|Updated Aug 22, 2024
One-click install
npx skills add https://github.com/tenstorrent/tt-forge --skill tt-lang
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tt-lang
Source: https://github.com/tenstorrent/tt-forge/tree/main/skills/tt-lang
Command: npx skills add https://github.com/tenstorrent/tt-forge --skill tt-lang

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TT-Lang solves the challenge of writing low-level TT hardware kernels by providing a Python-based DSL that exposes explicit data movement and tile-level compute primitives.

Core Features & Use Cases

  • Explicit kernel structure and dataflow buffers for fine-grained control over TT hardware.
  • Support for grid, blocks, pipes, and streaming patterns to fuse workloads like matmul, softmax, and attention.
  • Use cases include rapid prototyping of ML kernels on TT hardware and deployment to real hardware or simulators.

Quick Start

Create a tiny kernel with ttl.kernel and ttl.compute and run it on the functional simulator to verify core TT-Lang syntax.

Frequently Asked Questions about tt-lang

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

FAQPage Schema
How do I write TT hardware kernels in Python?▼

You can write TT hardware kernels in Python using a domain-specific language that exposes explicit data movement and tile-level compute primitives, enabling fine-grained control over single or multi-core TT chips.

Can I fuse matmul and softmax operations into a single kernel?▼

Yes, you can fuse workloads like matmul, softmax, and attention into efficient kernels by utilizing grid, blocks, pipes, and streaming patterns to manage data movement and compute operations.

How do I test TT kernels before deploying to physical hardware?▼

You can test TT kernels before physical deployment by running them on a functional simulator to verify core syntax and validate explicit data movement and tile-level compute primitives.

Does TT kernel development support ttnn tensor handling?▼

Yes, TT kernel development supports ttnn tensor handling alongside data movement through ttl.copy and ttl.make_dataflow_buffer_like for end-to-end kernel development.

What is the best way to manage data movement for multi-core TT chips?▼

The best way to manage data movement for multi-core TT chips is by using dataflow buffers and pipes within a Python-based DSL to handle on-demand data transfers and streaming loops.

Why use a Python DSL for low-level hardware kernel development instead of C?▼

Using a Python DSL for low-level hardware kernel development provides rapid prototyping capabilities for ML kernels while still exposing explicit data movement and tile-level compute primitives for fine-grained hardware control.