From 03365e4de76cc5c442fba5bc6b50b2363619df62 Mon Sep 17 00:00:00 2001 From: Jacob Gordon Date: Mon, 23 Dec 2024 20:04:42 +0000 Subject: [PATCH 1/5] style(docs/development.md): ensures fenced code blocks are surrounded by blank lines - enforced by markdown linter --- docs/development.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/development.md b/docs/development.md index 61c60a646a5c..717e9fd9e4f2 100644 --- a/docs/development.md +++ b/docs/development.md @@ -139,6 +139,7 @@ Be aware that the installed version of LLVM needs in general to match the commit ### Build commands After either cmake run (in-tree/out-of-tree), use one of the following commands to build the project: + ```shell # Build just torch-mlir (not all of LLVM) cmake --build build --target tools/torch-mlir/all @@ -173,6 +174,7 @@ To test the MLIR output to torch dialect, you can use `test/python/fx_importer/b Make sure you have activated the virtualenv and set the `PYTHONPATH` above (if running on Windows, modify the environment variable as shown above): + ```shell source mlir_venv/bin/activate export PYTHONPATH=`pwd`/build/tools/torch-mlir/python_packages/torch_mlir:`pwd`/test/python/fx_importer @@ -187,6 +189,7 @@ This path doesn't give access to the current generation work that is being drive and may lead to errors. Same as above, but with different python path and example: + ```shell export PYTHONPATH=`pwd`/build/tools/torch-mlir/python_packages/torch_mlir:`pwd`/projects/pt1/examples python projects/pt1/examples/torchscript_resnet18_all_output_types.py @@ -197,6 +200,7 @@ This will display the Resnet18 network example in three dialects: TORCH, LINALG The main functionality is on `torch_mlir.torchscript.compile()`'s `output_type`. Ex: + ```python module = torch_mlir.torchscript.compile(resnet18, torch.ones(1, 3, 224, 224), output_type="torch") ``` @@ -206,6 +210,7 @@ module = torch_mlir.torchscript.compile(resnet18, torch.ones(1, 3, 224, 224), ou ## Jupyter Jupyter notebook: + ```shell python -m ipykernel install --user --name=torch-mlir --env PYTHONPATH "$PYTHONPATH" # Open in jupyter, and then navigate to @@ -237,17 +242,21 @@ manually `source`'d in a shell. Torch-MLIR can also be built using Bazel (apart from the official CMake build) for users that depend on Bazel in their workflows. To build `torch-mlir-opt` using Bazel, follow these steps: 1. Launch an interactive docker container with the required deps installed: + ```shell ./utils/bazel/docker/run_docker.sh ``` 2. Build torch-mlir: + ```shell bazel build @torch-mlir//:torch-mlir-opt ``` + The built binary should be at `bazel-bin/external/torch-mlir/torch-mlir-opt`. 3. Test torch-mlir (lit test only): + ```shell bazel test @torch-mlir//test/... ``` @@ -255,6 +264,7 @@ bazel test @torch-mlir//test/... We welcome patches to torch-mlir's Bazel build. If you do contribute, please complete your PR with an invocation of buildifier to ensure the BUILD files are formatted consistently: + ```shell bazel run @torch-mlir//:buildifier ``` @@ -287,6 +297,7 @@ TM_PACKAGES="in-tree" ./build_tools/python_deploy/build_linux_packages.sh ### Out-of-Tree builds Build LLVM/MLIR first and then build Torch-MLIR referencing that build + ```shell TM_PACKAGES="out-of-tree" ./build_tools/python_deploy/build_linux_packages.sh ``` @@ -339,38 +350,48 @@ The following additional environmental variables can be used to customize your d * Custom Release Docker image: Defaults to `stellaraccident/manylinux2014_x86_64-bazel-5.1.0:latest` + ```shell TM_RELEASE_DOCKER_IMAGE="stellaraccident/manylinux2014_x86_64-bazel-5.1.0:latest" ``` + * Custom CI Docker image: Defaults to `powderluv/torch-mlir-ci:latest`. This assumes an Ubuntu LTS like image. You can build your own with `./build_tools/docker/Dockerfile` + ```shell TM_CI_DOCKER_IMAGE="powderluv/torch-mlir-ci:latest" ``` * Custom Python Versions for Release builds: Version of Python to use in Release builds. Ignored in CIs. Defaults to `cp39-cp39 cp310-cp310 cp312-cp312` + ```shell TM_PYTHON_VERSIONS="cp39-cp39 cp310-cp310 cp312-cp312" ``` * Location to store Release build wheels + ```shell TM_OUTPUT_DIR="./build_tools/python_deploy/wheelhouse" ``` * What "packages" to build: Defaults to torch-mlir. Options are `torch-mlir out-of-tree in-tree` + ```shell TM_PACKAGES="torch-mlir out-of-tree in-tree" ``` + * Use pre-built Pytorch: Defaults to using pre-built Pytorch. Setting it to `OFF` builds from source + ```shell TM_USE_PYTORCH_BINARY="OFF" ``` + * Skip running tests Skip running tests if you want quick build only iteration. Default set to `OFF` + ```shell TM_SKIP_TESTS="OFF" ``` @@ -389,6 +410,7 @@ CMAKE_GENERATOR=Ninja python setup.py bdist_wheel To package a completed CMake build directory, you can use the `TORCH_MLIR_CMAKE_BUILD_DIR` and `TORCH_MLIR_CMAKE_ALREADY_BUILT` environment variables: + ```shell TORCH_MLIR_CMAKE_BUILD_DIR=build/ TORCH_MLIR_CMAKE_ALREADY_BUILT=1 python setup.py bdist_wheel ``` @@ -490,6 +512,7 @@ Most of the unit tests use the [`FileCheck` tool](https://llvm.org/docs/CommandG # PyTorch source builds and custom PyTorch versions Torch-MLIR by default builds with the latest nightly PyTorch version. This can be toggled to build from latest PyTorch source with + ``` -DTORCH_MLIR_USE_INSTALLED_PYTORCH=OFF -DTORCH_MLIR_SRC_PYTORCH_REPO=vivekkhandelwal1/pytorch # Optional. Github path. Defaults to pytorch/pytorch From e435a2254eb5223774254592ad6fa1c8dca74e21 Mon Sep 17 00:00:00 2001 From: Jacob Gordon Date: Tue, 17 Dec 2024 17:37:41 +0000 Subject: [PATCH 2/5] docs(development.md): clarifies header structure --- docs/development.md | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/docs/development.md b/docs/development.md index 717e9fd9e4f2..a3e20fbacc33 100644 --- a/docs/development.md +++ b/docs/development.md @@ -1,4 +1,4 @@ -# Checkout and build from source +# Environment ## Check out the code @@ -31,7 +31,6 @@ it with the following `apt` command on Ubuntu/Debian. sudo apt install python3-dev ``` - ## (Optional) Set up pre-commit This project uses [pre-commit](https://pre-commit.com/) in its CI. You can @@ -45,15 +44,21 @@ pip install pre-commit pre-commit install ``` -## CMake Build +# Building + +## With CMake + +### Configure for Building... Two setups are possible to build: in-tree and out-of-tree. The in-tree setup is the most straightforward, as it will build LLVM dependencies as well. -### Building torch-mlir in-tree +#### ...with LLVM "in-tree" using... -The following command generates configuration files to build the project *in-tree*, that is, using llvm/llvm-project as the main build. This will build LLVM as well as torch-mlir and its subprojects. On Windows, use the "Developer PowerShell for Visual Studio" to ensure that the compiler and linker binaries are in the `PATH` variable. +The following commands generate configuration files to build the project *in-tree*, that is, using llvm/llvm-project as the main build. This will build LLVM as well as torch-mlir and its subprojects. On Windows, use the "Developer PowerShell for Visual Studio" to ensure that the compiler and linker binaries are in the `PATH` variable. -This requires `lld`, `clang`, `ccache`, and other dependencies for building `libtorch` / `PyTorch` wheels from source. If you run into issues because of these, try the [simplified build command](#simplified-build). +##### ...Base + Optimization Options + +This requires `lld`, `clang`, `ccache`, and other dependencies for building `libtorch` / `PyTorch` wheels from source. If you run into issues because of these, try the [simplified build command](#base-options). ```shell cmake -GNinja -Bbuild \ @@ -85,7 +90,7 @@ cmake -GNinja -Bbuild \ -DLIBTORCH_VARIANT=shared ``` -# Simplified build +##### ...Base Options If you're running into issues with the above build command, consider using the following: @@ -101,7 +106,7 @@ cmake -GNinja -Bbuild \ externals/llvm-project/llvm ``` -#### Flags to enable MLIR debugging: +#### Options to enable MLIR debugging * Enabling `--debug` and `--debug-only` flags (see [MLIR docs](https://mlir.llvm.org/getting_started/Debugging/)) for the `torch-mlir-opt` tool ```shell @@ -109,7 +114,7 @@ cmake -GNinja -Bbuild \ -DLLVM_ENABLE_ASSERTIONS=ON \ ``` -#### Flags to run end-to-end tests: +#### Options to run end-to-end tests Running the end-to-end execution tests locally requires enabling the native PyTorch extension features and the JIT IR importer, which depends on the former and defaults to `ON` if not changed: @@ -118,7 +123,7 @@ former and defaults to `ON` if not changed: -DTORCH_MLIR_ENABLE_JIT_IR_IMPORTER=ON \ ``` -### Building against a pre-built LLVM +#### ...with LLVM "out-of-tree" If you have built llvm-project separately in the directory `$LLVM_INSTALL_DIR`, you can also build the project *out-of-tree* using the following command as template: ```shell @@ -135,8 +140,7 @@ The same QoL CMake flags can be used to enable clang, ccache, and lld. Be sure t Be aware that the installed version of LLVM needs in general to match the committed version in `externals/llvm-project`. Using a different version may or may not work. - -### Build commands +### Initiate Build After either cmake run (in-tree/out-of-tree), use one of the following commands to build the project: From 6c707ee100f340d4691ad6f5ee76368bd291fd45 Mon Sep 17 00:00:00 2001 From: Jacob Gordon Date: Tue, 25 Feb 2025 14:23:59 +0000 Subject: [PATCH 3/5] docs(development.md): adds proper

title --- docs/development.md | 80 +++++++++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 39 deletions(-) diff --git a/docs/development.md b/docs/development.md index a3e20fbacc33..17ddd88f4c0e 100644 --- a/docs/development.md +++ b/docs/development.md @@ -1,6 +1,8 @@ -# Environment +# Development Guide -## Check out the code +## Environment + +### Check out the code ```shell git clone https://github.com/llvm/torch-mlir @@ -11,7 +13,7 @@ git submodule update --init --progress Optionally, use `--depth=1` to make a shallow clone of the submodules. While this is running, you can already setup the Python venv and dependencies in the next step. -## Setup your Python VirtualEnvironment and Dependencies +### Setup your Python VirtualEnvironment and Dependencies ```shell python3 -m venv mlir_venv @@ -31,7 +33,7 @@ it with the following `apt` command on Ubuntu/Debian. sudo apt install python3-dev ``` -## (Optional) Set up pre-commit +### (Optional) Set up pre-commit This project uses [pre-commit](https://pre-commit.com/) in its CI. You can install it locally too in order to lint and fix your code prior to the CI @@ -44,19 +46,19 @@ pip install pre-commit pre-commit install ``` -# Building +## Building -## With CMake +### With CMake -### Configure for Building... +#### Configure for Building... Two setups are possible to build: in-tree and out-of-tree. The in-tree setup is the most straightforward, as it will build LLVM dependencies as well. -#### ...with LLVM "in-tree" using... +##### ...with LLVM "in-tree" using... The following commands generate configuration files to build the project *in-tree*, that is, using llvm/llvm-project as the main build. This will build LLVM as well as torch-mlir and its subprojects. On Windows, use the "Developer PowerShell for Visual Studio" to ensure that the compiler and linker binaries are in the `PATH` variable. -##### ...Base + Optimization Options +###### ...Base + Optimization Options This requires `lld`, `clang`, `ccache`, and other dependencies for building `libtorch` / `PyTorch` wheels from source. If you run into issues because of these, try the [simplified build command](#base-options). @@ -90,7 +92,7 @@ cmake -GNinja -Bbuild \ -DLIBTORCH_VARIANT=shared ``` -##### ...Base Options +###### ...Base Options If you're running into issues with the above build command, consider using the following: @@ -106,7 +108,7 @@ cmake -GNinja -Bbuild \ externals/llvm-project/llvm ``` -#### Options to enable MLIR debugging +##### Options to enable MLIR debugging * Enabling `--debug` and `--debug-only` flags (see [MLIR docs](https://mlir.llvm.org/getting_started/Debugging/)) for the `torch-mlir-opt` tool ```shell @@ -114,7 +116,7 @@ cmake -GNinja -Bbuild \ -DLLVM_ENABLE_ASSERTIONS=ON \ ``` -#### Options to run end-to-end tests +##### Options to run end-to-end tests Running the end-to-end execution tests locally requires enabling the native PyTorch extension features and the JIT IR importer, which depends on the former and defaults to `ON` if not changed: @@ -123,7 +125,7 @@ former and defaults to `ON` if not changed: -DTORCH_MLIR_ENABLE_JIT_IR_IMPORTER=ON \ ``` -#### ...with LLVM "out-of-tree" +##### ...with LLVM "out-of-tree" If you have built llvm-project separately in the directory `$LLVM_INSTALL_DIR`, you can also build the project *out-of-tree* using the following command as template: ```shell @@ -140,7 +142,7 @@ The same QoL CMake flags can be used to enable clang, ccache, and lld. Be sure t Be aware that the installed version of LLVM needs in general to match the committed version in `externals/llvm-project`. Using a different version may or may not work. -### Initiate Build +#### Initiate Build After either cmake run (in-tree/out-of-tree), use one of the following commands to build the project: @@ -158,21 +160,21 @@ cmake --build build --target check-torch-mlir-python cmake --build build ``` -## Setup Python Environment to export the built Python packages +### Setup Python Environment to export the built Python packages -### Linux and macOS +#### Linux and macOS ```shell export PYTHONPATH=`pwd`/build/tools/torch-mlir/python_packages/torch_mlir:`pwd`/test/python/fx_importer ``` -### Windows PowerShell +#### Windows PowerShell ```shell $env:PYTHONPATH = "$PWD/build/tools/torch-mlir/python_packages/torch_mlir;$PWD/test/python/fx_importer" ``` -## Testing MLIR output in various dialects +### Testing MLIR output in various dialects To test the MLIR output to torch dialect, you can use `test/python/fx_importer/basic_test.py`. @@ -211,7 +213,7 @@ module = torch_mlir.torchscript.compile(resnet18, torch.ones(1, 3, 224, 224), ou `output_type` can be: `TORCH`, `TOSA`, `LINALG_ON_TENSORS`, `RAW` and `STABLEHLO`. -## Jupyter +### Jupyter Jupyter notebook: @@ -225,7 +227,7 @@ jupyter notebook [Example IR](https://gist.github.com/silvasean/e74780f8a8a449339aac05c51e8b0caa) for a simple 1 layer MLP to show the compilation steps from TorchScript. -## Interactive Use +### Interactive Use The `build_tools/write_env_file.sh` script will output a `.env` file in the workspace folder with the correct PYTHONPATH set. This allows @@ -233,7 +235,7 @@ tools like VSCode to work by default for debugging. This file can also be manually `source`'d in a shell. -## Bazel Build +### Bazel Build > **NOTE** Our Bazel build follows LLVM's Bazel build policy: only the > subcommunity interested in Bazel is responsible for fixing it. Average @@ -273,7 +275,7 @@ the BUILD files are formatted consistently: bazel run @torch-mlir//:buildifier ``` -## Docker Builds +### Docker Builds We have preliminary support for building with Docker images. Currently this is not very convenient for day-to-day interactive development and @@ -290,7 +292,7 @@ is built as part of the LLVM project along with MLIR. We mount a ccache and pip cache inside the docker container to speed up iterative builds. Iterative builds should be as fast as running without docker. -### In-Tree builds +#### In-Tree builds Build MLIR and Torch-MLIR together as part of the LLVM repo. @@ -298,7 +300,7 @@ Build MLIR and Torch-MLIR together as part of the LLVM repo. TM_PACKAGES="in-tree" ./build_tools/python_deploy/build_linux_packages.sh ``` -### Out-of-Tree builds +#### Out-of-Tree builds Build LLVM/MLIR first and then build Torch-MLIR referencing that build @@ -306,7 +308,7 @@ Build LLVM/MLIR first and then build Torch-MLIR referencing that build TM_PACKAGES="out-of-tree" ./build_tools/python_deploy/build_linux_packages.sh ``` -### Release builds +#### Release builds Build in a manylinux Docker image so we can upload artifacts to PyPI. @@ -314,7 +316,7 @@ Build in a manylinux Docker image so we can upload artifacts to PyPI. TM_PACKAGES="torch-mlir" ./build_tools/python_deploy/build_linux_packages.sh ``` -### Mimicing CI+Release builds +#### Mimicing CI+Release builds If you wanted to build all the CIs locally @@ -330,7 +332,7 @@ TM_PACKAGES="torch-mlir out-of-tree in-tree" TM_PYTHON_VERSIONS="cp310-cp310" ./ Note: The Release docker still runs as root so it may generate some files owned by root:root. We hope to move it to run as a user in the future. -### Cleaning up +#### Cleaning up Docker builds tend to leave a wide variety of files around. Luckily most are owned by the user but there are still some that need to be removed as superuser. @@ -339,7 +341,7 @@ as superuser. rm -rf build build_oot llvm-build docker_venv externals/pytorch/build .ccache ``` -## Building your own Docker image +### Building your own Docker image If you would like to build your own docker image (usually not necessary). You can run: @@ -348,7 +350,7 @@ cd ./build_tools/docker docker build -t your-name/torch-mlir-ci --no-cache . ``` -### Other configurable environmental variables +#### Other configurable environmental variables The following additional environmental variables can be used to customize your docker build: @@ -401,7 +403,7 @@ The following additional environmental variables can be used to customize your d ``` -## Build Python Packages +### Build Python Packages We have preliminary support for building Python packages. This can be done with the following commands: @@ -422,7 +424,7 @@ TORCH_MLIR_CMAKE_BUILD_DIR=build/ TORCH_MLIR_CMAKE_ALREADY_BUILT=1 python setup. Note: The setup.py script is only used for building the Python packages, not support commands like `setup.py develop` to build the development environment. -# Testing +## Testing Torch-MLIR has two types of tests: @@ -442,7 +444,7 @@ Torch-MLIR has two types of tests: [LLVM Testing Guide](https://llvm.org/docs/TestingGuide.html#regression-test-structure). -## Running execution (end-to-end) tests: +### Running execution (end-to-end) tests: > **Note** > An `.env` file must be generated via `build_tools/write_env_file.sh` before these commands can be run. @@ -480,7 +482,7 @@ vars like this makes it easy to set in GH action files, etc. Note that the verbose flags are very verbose. Basic sequential progress reports will be printed regardless when not running in parallel. -## Running unit tests. +### Running unit tests. To run all of the unit tests, run: @@ -513,7 +515,7 @@ $TORCH_MLIR_BUILD_DIR/bin/llvm-lit $TORCH_MLIR_SRC_ROOT/test -v --filter=canonic Most of the unit tests use the [`FileCheck` tool](https://llvm.org/docs/CommandGuide/FileCheck.html) to verify expected outputs. -# PyTorch source builds and custom PyTorch versions +## PyTorch source builds and custom PyTorch versions Torch-MLIR by default builds with the latest nightly PyTorch version. This can be toggled to build from latest PyTorch source with @@ -523,7 +525,7 @@ Torch-MLIR by default builds with the latest nightly PyTorch version. This can b -DTORCH_MLIR_SRC_PYTORCH_BRANCH=master # Optional. Defaults to PyTorch's main branch ``` -# Updating the LLVM and MLIR-HLO submodules +## Updating the LLVM and MLIR-HLO submodules Torch-MLIR depends on `llvm-project` (which contains, among other things, upstream MLIR) and `stablehlo`, both of which are submodules in the `externals/` @@ -531,7 +533,7 @@ directory. We aim to update these at least weekly to bring in the latest features and spread out over time the effort of updating our code for MLIR API breakages. -## Which LLVM commit should I pick? +### Which LLVM commit should I pick? NOTE: This section is in flux. Specifically, the `mlir-hlo` dep has been dropped and the project is running off of a `stablehlo` fork which can be @@ -551,7 +553,7 @@ our submodule updates on these green commits also helps us stay in sync with LLVM updates in other projects like ONNX-MLIR and MLIR-HLO. The person responsible for the update each week is listed [here](https://github.com/llvm/torch-mlir/wiki/Weekly-LLVM-Update). -## What is the update process? +### What is the update process? 1. **Lookup green commit hashes**: From the Github issue https://github.com/llvm/torch-mlir/issues/1178, find the LLVM and MLIR-HLO @@ -583,7 +585,7 @@ Here are some examples of PRs updating the LLVM and MLIR-HLO submodules: - https://github.com/llvm/torch-mlir/pull/1180 - https://github.com/llvm/torch-mlir/pull/1229 -# Enabling Address Sanitizer (ASan) +## Enabling Address Sanitizer (ASan) To enable ASAN, pass `-DLLVM_USE_SANITIZER=Address` to CMake. This should "just work" with all C++ tools like `torch-mlir-opt`. When running a Python script @@ -597,7 +599,7 @@ LD_PRELOAD="$(clang -print-file-name=libclang_rt.asan-x86_64.so)" ./projects/pt1 TODO: Add ASan docs for LTC. -# Other docs +## Other docs - GitHub wiki: https://github.com/llvm/torch-mlir/wiki - Of particular interest in the [How to add end-to-end support for new Torch ops](https://github.com/llvm/torch-mlir/wiki/Torch-ops-E2E-implementation) doc. From 811a78a7f97ff1983c07e7eddfee217c47bdcdf2 Mon Sep 17 00:00:00 2001 From: Jacob Gordon Date: Tue, 25 Feb 2025 14:25:35 +0000 Subject: [PATCH 4/5] docs(development.md): renames h2 "Environment" to "Setting Up Environment" --- docs/development.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/development.md b/docs/development.md index 17ddd88f4c0e..9efe1293b7c9 100644 --- a/docs/development.md +++ b/docs/development.md @@ -1,6 +1,6 @@ # Development Guide -## Environment +## Setting Up Environment ### Check out the code From 33298a7c35bca6a5df36811223a3197ca00a8c4b Mon Sep 17 00:00:00 2001 From: Jacob Gordon Date: Tue, 25 Feb 2025 14:32:12 +0000 Subject: [PATCH 5/5] style(docs/development.md): nests code blocks for list items --- docs/development.md | 62 ++++++++++++++++++++++----------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/docs/development.md b/docs/development.md index 9efe1293b7c9..ecce40707659 100644 --- a/docs/development.md +++ b/docs/development.md @@ -249,23 +249,23 @@ Torch-MLIR can also be built using Bazel (apart from the official CMake build) f 1. Launch an interactive docker container with the required deps installed: -```shell -./utils/bazel/docker/run_docker.sh -``` + ```shell + ./utils/bazel/docker/run_docker.sh + ``` 2. Build torch-mlir: -```shell -bazel build @torch-mlir//:torch-mlir-opt -``` + ```shell + bazel build @torch-mlir//:torch-mlir-opt + ``` -The built binary should be at `bazel-bin/external/torch-mlir/torch-mlir-opt`. + The built binary should be at `bazel-bin/external/torch-mlir/torch-mlir-opt`. 3. Test torch-mlir (lit test only): -```shell -bazel test @torch-mlir//test/... -``` + ```shell + bazel test @torch-mlir//test/... + ``` We welcome patches to torch-mlir's Bazel build. If you do contribute, please complete your PR with an invocation of buildifier to ensure @@ -357,50 +357,50 @@ The following additional environmental variables can be used to customize your d * Custom Release Docker image: Defaults to `stellaraccident/manylinux2014_x86_64-bazel-5.1.0:latest` -```shell - TM_RELEASE_DOCKER_IMAGE="stellaraccident/manylinux2014_x86_64-bazel-5.1.0:latest" -``` + ```shell + TM_RELEASE_DOCKER_IMAGE="stellaraccident/manylinux2014_x86_64-bazel-5.1.0:latest" + ``` * Custom CI Docker image: Defaults to `powderluv/torch-mlir-ci:latest`. This assumes an Ubuntu LTS like image. You can build your own with `./build_tools/docker/Dockerfile` -```shell - TM_CI_DOCKER_IMAGE="powderluv/torch-mlir-ci:latest" -``` + ```shell + TM_CI_DOCKER_IMAGE="powderluv/torch-mlir-ci:latest" + ``` * Custom Python Versions for Release builds: Version of Python to use in Release builds. Ignored in CIs. Defaults to `cp39-cp39 cp310-cp310 cp312-cp312` -```shell - TM_PYTHON_VERSIONS="cp39-cp39 cp310-cp310 cp312-cp312" -``` + ```shell + TM_PYTHON_VERSIONS="cp39-cp39 cp310-cp310 cp312-cp312" + ``` * Location to store Release build wheels -```shell - TM_OUTPUT_DIR="./build_tools/python_deploy/wheelhouse" -``` + ```shell + TM_OUTPUT_DIR="./build_tools/python_deploy/wheelhouse" + ``` * What "packages" to build: Defaults to torch-mlir. Options are `torch-mlir out-of-tree in-tree` -```shell - TM_PACKAGES="torch-mlir out-of-tree in-tree" -``` + ```shell + TM_PACKAGES="torch-mlir out-of-tree in-tree" + ``` * Use pre-built Pytorch: Defaults to using pre-built Pytorch. Setting it to `OFF` builds from source -```shell - TM_USE_PYTORCH_BINARY="OFF" -``` + ```shell + TM_USE_PYTORCH_BINARY="OFF" + ``` * Skip running tests Skip running tests if you want quick build only iteration. Default set to `OFF` -```shell - TM_SKIP_TESTS="OFF" -``` + ```shell + TM_SKIP_TESTS="OFF" + ``` ### Build Python Packages