{"id":18289644,"url":"https://github.com/jushbjj/tt-division","last_synced_at":"2025-06-14T22:33:08.160Z","repository":{"id":253571560,"uuid":"843899979","full_name":"JushBJJ/TT-Division","owner":"JushBJJ","description":"Demo of doing division in Tenstorrent","archived":false,"fork":false,"pushed_at":"2024-09-26T09:34:14.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-01T14:25:27.441Z","etag":null,"topics":["division","tenstorrent","tt","tt-metal","tt-nn"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JushBJJ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-17T18:56:46.000Z","updated_at":"2024-12-24T04:18:58.000Z","dependencies_parsed_at":"2025-02-15T01:40:54.146Z","dependency_job_id":null,"html_url":"https://github.com/JushBJJ/TT-Division","commit_stats":null,"previous_names":["jushbjj/tt-division"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JushBJJ%2FTT-Division","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JushBJJ%2FTT-Division/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JushBJJ%2FTT-Division/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JushBJJ%2FTT-Division/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JushBJJ","download_url":"https://codeload.github.com/JushBJJ/TT-Division/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247995624,"owners_count":21030325,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["division","tenstorrent","tt","tt-metal","tt-nn"],"created_at":"2024-11-05T14:07:25.962Z","updated_at":"2025-04-09T07:23:42.688Z","avatar_url":"https://github.com/JushBJJ.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TT-Division\n\nSmall demo of doing division in TT-NN and TT-Metal\n\nIn python TTNN:\n```python\nz_ttnn = ttnn.div(x_ttnn, y_ttnn) # \u003e0.50.0 TT-Metal versions only\n```\n\nResult:\n```python\n# CPU\ntensor([2.], dtype=torch.bfloat16)\n\n# TTNN\nttnn.Tensor([[ 1.99219,  0.00000,  ...,  0.00000,  0.00000],\n             [ 0.00000,  0.00000,  ...,  0.00000,  0.00000],\n             ...,\n             [ 0.00000,  0.00000,  ...,  0.00000,  0.00000],\n             [ 0.00000,  0.00000,  ...,  0.00000,  0.00000]], shape=Shape([1[32], 1[32]]), dtype=DataType::BFLOAT16, layout=Layout::TILE)\n```\n\nResult (TT-Metal):\n```\nResult: 2\nExpected: 2\nTest Passed\n```\n\n\\* 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.\n\n## How to run TT-Metal\n```sh\n# 1. Make sure you have set the right environment variables and built TT-Metal\nexport ARCH_NAME=\u003cyour device name (e.g \"grayskull\")\u003e\nexport TT_METAL_HOME=/your/path/to/tt-metal\n\n# If you haven't built TT-Metal, follow this:\n# https://github.com/tenstorrent/tt-metal/blob/main/INSTALLING.md\n\n# 2. Build project\ncd ./TT-Metal\nmkdir build\n\ncd build\ncmake ..\n\nmake\n./tt-division\n\n# Or if you want to run with debug\nTT_METAL_DPRINT_CORES=0,0 TT_METAL_DPRINT_FILE=log.txt ./tt-division\ncat ./log.txt\n```\n\n![Osaka Thousand Year Stare](https://i.redd.it/b064yxmkl0zb1.jpg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjushbjj%2Ftt-division","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjushbjj%2Ftt-division","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjushbjj%2Ftt-division/lists"}