Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jushbjj/tt-division
Demo of doing division in Tenstorrent
https://github.com/jushbjj/tt-division
division tenstorrent tt tt-metal tt-nn
Last synced: 1 day ago
JSON representation
Demo of doing division in Tenstorrent
- Host: GitHub
- URL: https://github.com/jushbjj/tt-division
- Owner: JushBJJ
- Created: 2024-08-17T18:56:46.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-08-26T08:07:51.000Z (2 months ago)
- Last Synced: 2024-08-27T05:27:15.967Z (2 months ago)
- Topics: division, tenstorrent, tt, tt-metal, tt-nn
- Language: CMake
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TT-Division
Small demo of doing division in TT-NN and TT-Metal
In python TTNN:
```python
z_ttnn = ttnn.div(x_ttnn, y_ttnn) # >0.50.0 TT-Metal versions only
```Result:
```python
# CPU
tensor([2.], dtype=torch.bfloat16)# TTNN
ttnn.Tensor([[ 1.99219, 0.00000, ..., 0.00000, 0.00000],
[ 0.00000, 0.00000, ..., 0.00000, 0.00000],
...,
[ 0.00000, 0.00000, ..., 0.00000, 0.00000],
[ 0.00000, 0.00000, ..., 0.00000, 0.00000]], shape=Shape([1[32], 1[32]]), dtype=DataType::BFLOAT16, layout=Layout::TILE)
```Result (TT-Metal):
```
Result: 2
Expected: 2
Test Passed
```\* There is a bug where it says `Result: 7.96875`, not sure why but when you run it again it will go back to 2. For some reason c_intermed0 switches between 1.99 and 0.50 when it should be empty.
## How to run TT-Metal
```sh
# 1. Make sure you have set the right environment variables and built TT-Metal
export ARCH_NAME=
export TT_METAL_HOME=/your/path/to/tt-metal# If you haven't built TT-Metal, follow this:
# https://github.com/tenstorrent/tt-metal/blob/main/INSTALLING.md# 2. Build project
cd ./TT-Metal
mkdir buildcd build
cmake ..make
./tt-division# Or if you want to run with debug
TT_METAL_DPRINT_CORES=0,0 TT_METAL_DPRINT_FILE=log.txt ./tt-division
cat ./log.txt
```![Osaka Thousand Year Stare](https://i.redd.it/b064yxmkl0zb1.jpg)