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
- Basic Operations with TT-NN
-
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