diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index 00ccde0ab..d6e7a20a7 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -1,7 +1,10 @@ # Summary -[Introduction](./introduction.md) +# Introduction +- [Introduction](./introduction.md) -# User Guide +# Project setup +- [Building](./build.md) -- [Building](./build.md) \ No newline at end of file +# User Guide +- [Getting Started](./getting-started.md) diff --git a/docs/src/build.md b/docs/src/build.md index e69de29bb..ede511328 100644 --- a/docs/src/build.md +++ b/docs/src/build.md @@ -0,0 +1,97 @@ +# Building + +Following page describes how to build the project on your local machine. + +## Prerequisites +Main project dependencies are: +1. Clang 17 +1. Ninja +1. CMake 3.20 or higher +1. Git LFS +1. Python 3.10 or higher + +On Ubuntu 22.04 systems, you can install these dependencies using the following commands: +```sh +# Update package list +sudo apt update -y +sudo apt upgrade -y + +# Install Clang +sudo apt install clang-17 + +# Install Ninja +sudo apt install ninja-build + +# Install CMake +sudo apt remove cmake -y +pip3 install cmake --upgrade +cmake --version + +# Install Git LFS +sudo apt install git-lfs + +# Check Python version +python3 --version +``` + +## Build environment +This is one off step to build the toolchain and create virtual environment for tt-forge. Generally you need to run this step only once, unless you want to update the toolchain (LLVM). + +First, it's required to create toolchain directories. Proposed example creates directories in default paths. You can change the paths if you want to use different locations (see build environment section below). +```sh +# FFE related toolchain (dafault path) +sudo mkdir -p /opt/ttforge-toolchain +sudo chown -R $USER /opt/ttforge-toolchain + +# MLIR related toolchain (default path) +sudo mkdir -p /opt/ttmlir-toolchain +sudo chown -R $USER /opt/ttmlir-toolchain +``` + +Build FFE environment: +```sh +# Inicialize required env vars +source env/activate + +# Initialize and update submodules +git submodule update --init --recursive -f + +# Build environment +cmake -B env/build env +cmake --build env/build +``` + +## Build Forge +```sh +# Activate virtual environment +source env/activate + +# Build Forge +cmake -G Ninja -B build +cmake --build build +``` + +## Build Cleanup + +To ensure a clean build environment, follow these steps to remove existing build artifacts: + +1. **Clean Forge FE build artifacts**: + ```sh + rm -rf build + ``` + Note: This command removes the `build` directory and all its contents, effectively cleaning up the build artifacts specific to Forge FE. + +2. **Clean all Forge build artifacts**: + ```sh + ./clean_all.sh + ``` + Note: This script executes a comprehensive cleanup, removing all build artifacts across the entire Forge project, ensuring a clean slate for subsequent builds. + +_Note: `clean_all.sh` script will not clean toolchain (LLVM) build artifacts and dependencies._ + +## Useful build environment variables +1. `TTMLIR_TOOLCHAIN_DIR` - Specifies the directory where TTMLIR dependencies will be installed. Defaults to `/opt/ttmlir-toolchain` if not defined. +2. `TTMLIR_VENV_DIR` - Specifies the virtual environment directory for TTMLIR. Defaults to `/opt/ttmlir-toolchain/venv` if not defined. +3. `TTFORGE_TOOLCHAIN_DIR` - Specifies the directory where tt-forge dependencies will be installed. Defaults to `/opt/ttforge-toolchain` if not defined. +4. `TTFORGE_VENV_DIR` - Specifies the virtual environment directory for tt-forge. Defaults to `/opt/ttforge-toolchain/venv` if not defined. +5. `TTFORGE_PYTHON_VERSION` - Specifies the Python version to use. Defaults to `python3.10` if not defined. diff --git a/docs/src/getting-started.md b/docs/src/getting-started.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/src/introduction.md b/docs/src/introduction.md index e69de29bb..ac401014a 100644 --- a/docs/src/introduction.md +++ b/docs/src/introduction.md @@ -0,0 +1,10 @@ +# Introduction + +The **TT-Forge FE** is a graph compiler designed to optimize and transform computational graphs for deep learning models, enhancing their performance and efficiency. + +Built on top of the [TT-MLIR](https://docs.tenstorrent.com/tt-mlir/) backend, **TT-Forge FE** is an integral component of the [TT-Forge]() project, which provides a comprehensive suite of tools for optimizing and deploying deep learning models on [Tenstorrent](https://tenstorrent.com/) hardware. + +Main project goals are: +- Provide abstraction of many different frontend frameworks (PyTorch, TensorFlow, ONNX, etc.) +- Compile many kinds of model architectures without custom modification and with great performance (e.g. Transformers, CNNs, etc.) +- Abstract all Tenstorrent device architectures (e.g. Wormhole, Blackhole, etc.)