Logo TT-NN

TTNN

  • What is TT-NN?
  • Getting Started
  • Install
  • Using TT-NN
  • Tensor
  • APIs
  • Tutorials
    • Create and Add Two Tensors
    • Basic Operations with TT-NN
    • MLP inference with TT-NN
  • Onboarding New Functionality
  • Converting PyTorch Model to TT-NN
  • Adding New TT-NN Operation
  • Profiling TT-NN Operations
  • Building and Uplifting Demos

Resources

  • Support
  • Contributing as a developer
TT-NN
  • Tutorials
  • View page source

Tutorials

This is a collection of tutorials written in Python to help you ramp up using TT-NN for various tasks such as tensor operations, model conversion, and profiling.

These tutorials assume you already have a machine set up with either a wormhole or blackhole device available and that you have successfully followed the instructions for TT-NN / TT-Metalium Installation.

With the recommended virtual environment activated, you can run these tutorials directly:

$ python3 --version
Python 3.10.12
$ python3 example.py
...
  • Create and Add Two Tensors
    • Import the necessary libraries
    • Open Tenstorrent device
    • Tensor Creation
    • Perform the addition operation and convert back
    • Full example and output
  • Basic Operations with TT-NN
    • Import the necessary libraries
    • Open Tenstorrent device
    • Helper Function for Tensor Preparation
    • Host Tensor Creation
    • Convert Host Tensors to TT-NN Tiled Tensors or Create Natively on Device
    • Tile-Based Arithmetic Operations
    • Simulated Broadcasting (Row Vector Expansion)
    • Full example and output
  • MLP inference with TT-NN
    • Import the necessary libraries
    • Open Tenstorrent device
    • Load MNIST Test Data
    • Load Pretrained MLP Weights
    • Basic accuracy tracking, inference, loop, and image flattening
    • Convert to TT-NN Tensor
    • Layer 1 (Linear + ReLU)
    • Layer 2 (Linear + ReLU)
    • Layer 3 (Output Layer)
    • Convert Back to PyTorch and sum results
    • Full example and output
Previous Next

© Copyright Tenstorrent.

Built with Sphinx using a theme provided by Read the Docs.
Version: latest
Versions