Skip to content

Commit 2f9272a

Browse files
Merge pull request #9 from daisytuner/tenstorrent-move
Renamed tenstorrent examples to be easier identifeable and added readme
2 parents 3cb0c72 + 89f7c56 commit 2f9272a

20 files changed

+49
-4
lines changed

.daisy/test_metal.yml renamed to .daisy/tenstorrent_metalium.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ parameters:
1212

1313
steps:
1414
build: |
15-
cd metal/matmul_single_core
15+
cd tenstorrent/metalium/matmul_single_core
1616
export TT_METAL_HOME=$TT_METAL_INSTALL_HOME
1717
cmake . -B build -G Ninja
1818
cmake --build build
1919
run:
2020
matmul_single_core:
2121
command: ./build/demo
22-
cwd: metal/matmul_single_core
22+
cwd: tenstorrent/metalium/matmul_single_core
2323
env:
2424
TT_METAL_HOME: $TT_METAL_INSTALL_HOME
2525
measurements: 3

.daisy/test_ttnn.yml renamed to .daisy/tenstorrent_ttnn.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ parameters:
1212

1313
steps:
1414
build: |
15-
cd ttnn
15+
cd tenstorrent/ttnn
1616
python3 -m venv venv
1717
. venv/bin/activate
1818
pip config set global.extra-index-url https://download.pytorch.org/whl/cpu
1919
pip install /opt/tenstorrent/wheels/ttnn-0.58.0rc25+gg33cbd50ba3-cp312-cp312-linux_x86_64.whl
2020
run:
2121
matmul_ttnn:
2222
command: venv/bin/python3 matmul_tutorial.py
23-
cwd: ttnn
23+
cwd: tenstorrent/ttnn
2424
measurements: 3

tenstorrent/README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Using Tenstorrent accelerator on Daisytuner runners
2+
3+
## Metal
4+
5+
The examples are taken from the programming examples of [tt-metal](https://github.com/tenstorrent/tt-metal/tree/main/tt_metal/programming_examples), but transformed into standalone CMake projects that use the provided runtime.
6+
7+
This uses the `libtt_metal.so` directly to run low level kernels. Taken from programming example and refactored into a standalone project, removing any dependency on the build-time dependencies of the runtime itself.
8+
9+
### Prerequisites
10+
11+
To compile locally, tt-metal must be available with the ENV-var `TT_METAL_INSTALL_DIR` pointing to the directory under which the collected headers (`/include`) and libraries (`/lib`) are available. This can be the build-directory of the tt-metal git or a locally installed distribition.
12+
13+
It was tested against v0.58.0 of tt-metal.
14+
15+
During runtime, the tt-metal library will look for the ENV-var `TT_METAL_HOME` to point to a directory including all the runtime dependencies (object files, headers, compilers, target architecture definitions) to build the actual kernels. This can also be the full git directly (as in the tt-metal installation guide) or the provided distribution
16+
17+
### Daisytuner Workflows
18+
19+
Our runners provide a runtime pointed to by `TT_METAL_INSTALL_DIR` and `TT_METAL_INSTALL_HOME` respectively. To use the runtime for executions, only `TT_METAL_HOME` must be set to `$TT_METAL_INSTALL_HOME`. This is not done by default as other tenstorrent parts, like ttnn would also pick it up and attempt to replace the builtin runtime with the provided one. Sadly, the installed runtime is not yet ready for ttnn and missing dependencies.
20+
21+
Example: [test_metal.yml](.daisy/test_metal.yml)
22+
23+
Note: the examples use a relative path to the kernel-sources, which are only compiled at runtime. Thus, the working directory must be matched for the provided examples to find the kernel-sources.
24+
25+
## ttnn
26+
27+
A python / pytorch-based example following [the matrix multiplcation tutorial](https://docs.tenstorrent.com/tt-metal/latest/ttnn/ttnn/tutorials/ttnn_tutorials/002.html).
28+
29+
It uses a python-ttnn distribution similar to the one already available from tenstorrent directly as [docker image](https://github.com/orgs/tenstorrent/packages?q=tt-metalium-ubuntu&tab=packages&q=tt-metalium-ubuntu-22.04-release-amd64) or [wheel](https://github.com/tenstorrent/tt-metal/releases).
30+
It is rebuilt to use the same source revision as the metal library and built to run on our runners, which use Ubuntu 24.04 as base.
31+
32+
ttnn includes most parts of the tt_metal distribution. Only the RISC-V compilers need to be provided externally and are already installed on our runners.
33+
34+
### Daisytuner Workflows
35+
36+
Ideally, within a venv, pytorch repositories are added and the wheel provided on each tenstorrent-equipped runner is installed:
37+
```
38+
pip config set global.extra-index-url https://download.pytorch.org/whl/cpu
39+
pip install /opt/tenstorrent/wheels/ttnn-0.58.0rc25+gg33cbd50ba3-cp312-cp312-linux_x86_64.whl
40+
```
41+
Following that, the ttnn runtime is ready for execution. ENV-Var `TT_METAL_HOME` must *not* be set, as ttnn would then replace many of its included and working parts with whatever is provided and the binary installation does not currently include all parts of ttnn that are required for that.
42+
43+
Example: [test_ttnn.yml](.daisy/test_ttnn.yml)
44+
45+
Any other external ttnn wheels that were built to run on Ubuntu 24.04 according to the official tenstorrent guides would also work instead of the provided one.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)