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.9-cp313-cp313-manylinux_2_28_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

tt_umd-0.9.9-cp313-cp313-manylinux_2_28_aarch64.whl (2.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

tt_umd-0.9.9-cp312-cp312-manylinux_2_28_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

tt_umd-0.9.9-cp312-cp312-manylinux_2_28_aarch64.whl (2.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

tt_umd-0.9.9-cp311-cp311-manylinux_2_28_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

tt_umd-0.9.9-cp311-cp311-manylinux_2_28_aarch64.whl (2.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

tt_umd-0.9.9-cp310-cp310-manylinux_2_28_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

tt_umd-0.9.9-cp310-cp310-manylinux_2_28_aarch64.whl (2.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

tt_umd-0.9.9-cp39-cp39-manylinux_2_28_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

tt_umd-0.9.9-cp39-cp39-manylinux_2_28_aarch64.whl (2.2 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ ARM64

File details

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

File metadata

File hashes

Hashes for tt_umd-0.9.9-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2c718b63aa9a5098fc1d7f5bc280b434d1ca4d5a13ee5e941259ba72745d88d4
MD5 7df18dd5d9af8dccd17f2a0f38e500c8
BLAKE2b-256 0fa28fd50ffb99371f4a0b0a37b1fd316727cc67b00fef20f9efc9d98fed70e3

See more details on using hashes here.

Provenance

The following attestation bundles were made for tt_umd-0.9.9-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.9-cp313-cp313-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for tt_umd-0.9.9-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 7322aafcf02d8d93a426b63f939578a92679569897c5c841a29081f2ec240025
MD5 a0cb983de4e2297c9d1784d10162141d
BLAKE2b-256 fdb36ffe2c5333589d1eafec511b7f3eb5c80e4637fbc74a32f116b429d809be

See more details on using hashes here.

Provenance

The following attestation bundles were made for tt_umd-0.9.9-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.9-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for tt_umd-0.9.9-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4b6a89559ed2006b64dd957b0e5bfd136f4bab4bf9bcc73ee215eae8e611b462
MD5 b7780e21f3c010f6fddb8ea69bbf77a2
BLAKE2b-256 7191e7c3121726d466ff1684450cf633c4dee428169c589916d5db7608c920e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for tt_umd-0.9.9-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.9-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for tt_umd-0.9.9-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d709f2d6075b0d83afef17d7a55dd6e651b21d9fd615350de30f71df878ea076
MD5 a94e3e12e4dcc461c9bfcb4514dbd589
BLAKE2b-256 4bb9b94f94c17af2d869f1eb571a5140e783bce32572dfeb0d41ab7780f337ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for tt_umd-0.9.9-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.9-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for tt_umd-0.9.9-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ea94d16ef9b7d1c6fb612baba6b0c49ff84f98a6dc9af9c79af0eccb42e08d10
MD5 37351edb14944951885ccb39749bc26d
BLAKE2b-256 7a84affbb5f9f66d78b5345c685352dd51c3b26cdf92553a73cd188754be0335

See more details on using hashes here.

Provenance

The following attestation bundles were made for tt_umd-0.9.9-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.9-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for tt_umd-0.9.9-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 72962057a2e874a22a725dbe8a0baea83ef42b20e447eb16150f7a43a4ff285f
MD5 7e81bdb225626b5447cc0d7287c2c98d
BLAKE2b-256 7df76234846020515f9260274523041d6af48d1da403f59d1d5d7a2146fb0092

See more details on using hashes here.

Provenance

The following attestation bundles were made for tt_umd-0.9.9-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.9-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for tt_umd-0.9.9-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4edad9b3552e223c4aaf5888248b7af2437a7265fad63d64803c346b8b990183
MD5 2345ac7a5c0240d6a5248816e0a9be42
BLAKE2b-256 2f80ebb9975355eeed5ce4d166d4c2babd97cd74b913acc7781c5a6942a41a1e

See more details on using hashes here.

Provenance

The following attestation bundles were made for tt_umd-0.9.9-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.9-cp310-cp310-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for tt_umd-0.9.9-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 748f61830667cd614891933c43e296adf9fc4088dae56daf77b12564ce2bbd5d
MD5 00efd32f379c336dd083704cfad2cf76
BLAKE2b-256 9b20e2a72393505847b40ed831c87b385136ace3b26c0c7d8d138c2523f6332c

See more details on using hashes here.

Provenance

The following attestation bundles were made for tt_umd-0.9.9-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.9-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for tt_umd-0.9.9-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9c598218a2573c848cce9a9ca399e2d7b5b599b92fcdf7d557c5827e3eed919a
MD5 368ee44b1b1b357400677b6e0de975cb
BLAKE2b-256 9ce68fbfc95d47f2dae16081f869ba0825439123080cd90686c0d96b55b7d48d

See more details on using hashes here.

Provenance

The following attestation bundles were made for tt_umd-0.9.9-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.9-cp39-cp39-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for tt_umd-0.9.9-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 9bed2997f422fec14c88831c61a8d972f27d0c6abc9b85fe383687387133efcd
MD5 889c65ecdd6d71ee70b6ffacc02484bf
BLAKE2b-256 8f33a7322715da375b9f9041018775a5ab0fa568f10bf8129dc01c091e461f27

See more details on using hashes here.

Provenance

The following attestation bundles were made for tt_umd-0.9.9-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