Skip to main content

TT-UMD

User Mode Driver

ttnn logo

Quickstart

Software Dependencies

UMD requires Tenstorrent's kernel-mode driver

Required Ubuntu dependencies:

sudo apt install -y libhwloc-dev cmake ninja-build

UMD currently supports gcc-11 and newer gcc versions, and clang-13 and newer clang versions.

IOMMU and Hugepage requirements

To determine whether your system requires hugepage configuration, run the provided script:

./scripts/iommu_detect.sh

Wormhole and Blackhole

If your system IOMMU is enabled, no hugepage setup is required. If you don't have IOMMU enabled, than hugepages might be required for some of the driver functionality. 1G hugepages are required for shared device/host memory. Techniques for setup:

  • Recommended: the tt-system-tools repository contains a .deb package which will configure your system
    • sudo dpkg -i tenstorrent-tools_1.1-5_all.deb
  • Alternative: Metal project provides instructions and a script.
  • For experts:
    • Put system IOMMU in passthrough mode or disable it
    • Allocate 1 or more 1G hugepages
    • Mount the hugetlbfs at /dev/hugepages-1G (e.g. mount -t hugetlbfs hugetlbfs /dev/hugepages-1G -o mode=777,pagesize=1024M)

Install and use UMD

Python bindings

You can just run the following command, and you'll have tt_umd python package available in your environment:

pip install git+https://github.com/tenstorrent/tt-umd.git

Or if you have UMD downloaded locally you can install from local source:

pip install .

Build flow for C++ lib

To build libtt-umd.so:

cmake -B build -G Ninja
cmake --build build

To build all components (some are turned off by default, like tests), you can run these commands:

cmake -B build -G Ninja -DTT_UMD_BUILD_ALL=ON
cmake --build build

To build with GCC, set these environment variables before invoking cmake:

export CC=gcc
export CXX=g++

Disabling -Werror

By default, all warnings are treated as errors. This is controlled via the standard CMake variable CMAKE_COMPILE_WARNING_AS_ERROR.

Systems with recent libc may cause the python package building to fail due python redefining some *_SOURCES macros to higher versions and GCC has no mean to disable the macro redefinition diagnostic.

# Plain CMake
cmake -B build -G Ninja -DCMAKE_COMPILE_WARNING_AS_ERROR=OFF

# Python build (scikit-build-core passes CMAKE_ARGS through to CMake)
CMAKE_ARGS="-DCMAKE_COMPILE_WARNING_AS_ERROR=OFF" pip install .

Build debian dev package

cmake --build build --target package

# Generates umd-dev-x.y.z-Linux.deb

Enabling Logging

UMD uses a two-level logging system with compile-time and runtime controls.

Compile-Time Logging Control

By default, log_debug and log_trace statements are compiled out of release builds for performance. To include them in the binary:

Option 1: Enable logging explicitly

cmake -B build -G Ninja -DTT_UMD_ENABLE_LOGGING=ON
cmake --build build

Option 2: Use Debug build type (enables logging automatically)

cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug
cmake --build build

Runtime Logging Control

At runtime, control the logging level using the TT_LOGGER_LEVEL environment variable:

export TT_LOGGER_LEVEL=debug  # Show debug and above
export TT_LOGGER_LEVEL=trace  # Show all log messages (most verbose)
export TT_LOGGER_LEVEL=info   # Default level

Available log levels (from most to least verbose):

  • trace - Most detailed logging, traces program execution
  • debug - Debugging information useful during development
  • info - General informational messages (default)
  • warn - Warning messages for potentially harmful situations
  • error - Error messages for serious problems
  • critical - Critical errors that may lead to program termination
  • off - Disables all logging

Example: Running with debug logging

# Build with logging enabled
cmake -B build -G Ninja -DTT_UMD_ENABLE_LOGGING=ON
cmake --build build

# Run with debug level
TT_LOGGER_LEVEL=debug ./build/bin/your_program

Tracy Profiling

UMD supports Tracy profiling via the TT_UMD_ENABLE_TRACY build option. When disabled (the default), Tracy has zero footprint — no binary overhead, no runtime cost.

Building with Tracy

cmake -B build -G Ninja -DTT_UMD_ENABLE_TRACY=ON
cmake --build build

Capturing a trace

Launch the Tracy GUI locally, then on remote configure Port forwarding in VS Code for port 8086, start the application you want to profile on remote, then click Connect from GUI started locally. Alternatively, use tracy-capture -o trace.tracy to capture trace from the command line, then open the resulting file in the Tracy GUI.

Integration

UMD can be consumed by downstream projects in multiple ways.

From Source (Python)

You can use tt_umd module by installing it in your current python environment

From Source (CMake)

You can link libtt-umd.so by linking against the umd::tt-umd target.

Using CPM Package Manager

CPMAddPackage(
  NAME umd
  GITHUB_REPOSITORY tenstorrent/tt-umd
  GIT_TAG v0.1.0
  VERSION 0.1.0
)

As a submodule/external project

add_subdirectory(<path to umd>)

From Prebuilt Binaries

Ubuntu

apt install ./umd-dev-x.y.z-Linux.deb

Simulator Integration

You can run UMD tests without silicon by following setup instructions here.

Development workflow

For developing tt-umd, you can see the full set of dependencies in docker_install_common.sh

After that you can look at the section defined above Install and use UMD

Pre-commit Hook Integration for Formatting and Linting

As part of maintaining consistent code formatting across the project, we have integrated the pre-commit framework into our workflow. The pre-commit hooks will help automatically check and format code before commits are made, ensuring that we adhere to the project's coding standards.

What is Pre-commit?

Pre-commit is a framework for managing and maintaining multi-language pre-commit hooks. It helps catch common issues early by running a set of hooks before code is committed, automating tasks like:

  • Formatting code (e.g., fixing trailing whitespace, enforcing end-of-file newlines)
  • Running linters (e.g., clang-format, black, flake8)
  • Checking for merge conflicts or other common issues.

For more details on pre-commit, you can visit the official documentation.

How to Set Up Pre-commit Locally

To set up pre-commit on your local machine, follow these steps:

  1. Install Pre-commit: Ensure you have Python installed, then run:
    pip install pre-commit
    
  2. Install the Git Hook Scripts: In your local repository, run the following command to install the pre-commit hooks:
    pre-commit install
    
    This command will configure your local Git to run the defined hooks automatically before each commit.
  3. Run Pre-commit Hooks Manually: You can also run the hooks manually against all files at any time with:
    pre-commit run --all-files
    

Why You Should Use Pre-commit

By setting up pre-commit locally, you can help maintain the quality of the codebase and ensure that commits consistently meet the project's formatting standards. This saves time during code reviews and reduces the likelihood of code formatting issues slipping into the repository.

Since the hooks run automatically before each commit, you don't need to remember to manually format or check your code, making it easier to maintain consistency.

We strongly encourage all developers to integrate pre-commit into their workflow.

Formatting C++ code

Installing clang-format

If you're using an IRD docker, clang-format should be already available. If you don't have clang-format in your working environment, follow the instructions on llvm website for installing it.

Formatting files

If working with VSCode, you can copy the provided default settings:

cp .vscode/default.settings.json .vscode/settings.json

From now on, c++ files will be formatted on save (given that clang-format is available).

Note that if you setup pre-commit hook, the files will be automatically formatted when you commit changes. You can also manually auto format the whole repo using mentioned pre-commit:

   pre-commit run --all-files

Bumping the UMD version

There is an automated workflow for creating releases. It is triggered by merging a PR to main which changes the VERSION file.

You can change the VERSION as part of another PR or as an isolated PR. Please also update the CHANGELOG with the exact version you are changeing to.

Once the PR is merged, a draft Release will be created with the generated changelog and artifacts. Please review it and publish it using the tag which exactly matches the version of the release.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

tt_umd-0.9.7-cp313-cp313-manylinux_2_28_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

tt_umd-0.9.7-cp313-cp313-manylinux_2_28_aarch64.whl (2.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

tt_umd-0.9.7-cp312-cp312-manylinux_2_28_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

tt_umd-0.9.7-cp312-cp312-manylinux_2_28_aarch64.whl (2.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

tt_umd-0.9.7-cp311-cp311-manylinux_2_28_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

tt_umd-0.9.7-cp311-cp311-manylinux_2_28_aarch64.whl (2.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

tt_umd-0.9.7-cp310-cp310-manylinux_2_28_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

tt_umd-0.9.7-cp310-cp310-manylinux_2_28_aarch64.whl (2.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

tt_umd-0.9.7-cp39-cp39-manylinux_2_28_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

tt_umd-0.9.7-cp39-cp39-manylinux_2_28_aarch64.whl (2.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ ARM64

File details

Details for the file tt_umd-0.9.7-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for tt_umd-0.9.7-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cbcdfcfd4dc714147e1a2ba5fb26747fadb4607b35df2705a91427592420efc9
MD5 3ec15f4fdaaa2daedf185bb9e1c35a49
BLAKE2b-256 57c1df39c2cebfc39bfd488c6224725858c1fe827b47b5fc53e1a1c9949c8e8d

See more details on using hashes here.

Provenance

The following attestation bundles were made for tt_umd-0.9.7-cp313-cp313-manylinux_2_28_x86_64.whl:

Publisher: release.yml on tenstorrent/tt-umd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tt_umd-0.9.7-cp313-cp313-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for tt_umd-0.9.7-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 e88cda3e61d92c58aec673f36dcf821964e936491efca4a83ac47f408a1cb28c
MD5 2d620fdaf3a197b6847f68afdedf6669
BLAKE2b-256 b64c9b68688dfc1a01b78ade75dafbdf0bdc9786c7bef104a359091666abcbd5

See more details on using hashes here.

Provenance

The following attestation bundles were made for tt_umd-0.9.7-cp313-cp313-manylinux_2_28_aarch64.whl:

Publisher: release.yml on tenstorrent/tt-umd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tt_umd-0.9.7-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for tt_umd-0.9.7-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ff22ae74124f6872f0d14b06ab27590649eb04207478b819ec59863aaa8220af
MD5 625a450296d740d7112f62cc149b154f
BLAKE2b-256 173deab33567867b5e49227304f0c39e27ff595502434a533b6f22931f25b8aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for tt_umd-0.9.7-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: release.yml on tenstorrent/tt-umd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tt_umd-0.9.7-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for tt_umd-0.9.7-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 10968ba3cb993856b69b9961e6d5aa911bd8913a9dce7d62e7351e62f225cbbb
MD5 26e35100cedb0c31317c5f65ccc56dd8
BLAKE2b-256 3797def31b5068826e2d81e8a808890ae66b2e524d76b5ddb84cf2f3e882172c

See more details on using hashes here.

Provenance

The following attestation bundles were made for tt_umd-0.9.7-cp312-cp312-manylinux_2_28_aarch64.whl:

Publisher: release.yml on tenstorrent/tt-umd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tt_umd-0.9.7-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for tt_umd-0.9.7-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 747879e659d582d11790727c66e880fcd2b9ccf93f9fdd2c4d584bebed60b531
MD5 87fc15a0e30f677d262fb67905562ea1
BLAKE2b-256 91e00c6cba4c24108903665bdcf6a0a286fdcce4546592d65d413c388958a2f2

See more details on using hashes here.

Provenance

The following attestation bundles were made for tt_umd-0.9.7-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: release.yml on tenstorrent/tt-umd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tt_umd-0.9.7-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for tt_umd-0.9.7-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 b6f0060c754406d110081ebab8b7191df5774ce964e19959ee35437fd0d06dd1
MD5 d352eb6d26d16d4b6a1238136dc6ed62
BLAKE2b-256 ff1c343a1a2ce0de5afac441d4ad44cdbe6afdb28d56daac1c11cd54510d3a41

See more details on using hashes here.

Provenance

The following attestation bundles were made for tt_umd-0.9.7-cp311-cp311-manylinux_2_28_aarch64.whl:

Publisher: release.yml on tenstorrent/tt-umd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tt_umd-0.9.7-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for tt_umd-0.9.7-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 34078c2361b68434a8338bfe8d70447cf06d5129f0ac5759754f475eff3a29a9
MD5 abb1a5fde4570134d8cf06c320f78e80
BLAKE2b-256 361780e8e8fed6a804d838cad55b60665c26c8a7f302d9da638f323d0c9829c4

See more details on using hashes here.

Provenance

The following attestation bundles were made for tt_umd-0.9.7-cp310-cp310-manylinux_2_28_x86_64.whl:

Publisher: release.yml on tenstorrent/tt-umd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tt_umd-0.9.7-cp310-cp310-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for tt_umd-0.9.7-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 8f16175cd777ec9dbc2ca2e8c963f58dfc47492b90057bbe1d2d48e544098a70
MD5 ad86d6ff6af9fdf591bf037f72dade68
BLAKE2b-256 7efc711673068e1c5a45053f1a3c43905e73a46e245b18c116fca88388cf8a9c

See more details on using hashes here.

Provenance

The following attestation bundles were made for tt_umd-0.9.7-cp310-cp310-manylinux_2_28_aarch64.whl:

Publisher: release.yml on tenstorrent/tt-umd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tt_umd-0.9.7-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for tt_umd-0.9.7-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2c012450d4974f563d1698c4c32f54980aa84741363ccdc24335eadc078122f5
MD5 69bbc8dcc66cffc67789b1e5bda9d429
BLAKE2b-256 2aefa7ce7f598494badba16afe89f4b00932e4bcd5338c553e7d3c5fed5b44eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for tt_umd-0.9.7-cp39-cp39-manylinux_2_28_x86_64.whl:

Publisher: release.yml on tenstorrent/tt-umd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tt_umd-0.9.7-cp39-cp39-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for tt_umd-0.9.7-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 3edbf0ee395e1c758231ebda894db1faaf4799fbc81ee1a7effef031a2cd3d91
MD5 4e060cfaa446b3fa58bcc9a78197259b
BLAKE2b-256 e6ad987772a6a192d0da508d1191bdc5724a6464e3133d17b60fa0fef2b2b273

See more details on using hashes here.

Provenance

The following attestation bundles were made for tt_umd-0.9.7-cp39-cp39-manylinux_2_28_aarch64.whl:

Publisher: release.yml on tenstorrent/tt-umd

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page