Stella Laurenzo | afd7cab | 2024-04-21 18:41:28 -0700 | [diff] [blame] | 1 | # IREE Releasing |
| 2 | |
| 3 | This file documents the extant release process that IREE uses. This process |
| 4 | and the automation (such as it is) has grown over many years and is due for |
| 5 | a refresh. However, in the interests of documenting what exists, we attempt |
| 6 | to do so here. |
| 7 | |
| 8 | ## Nightly Core Releases |
| 9 | |
| 10 | IREE development is primarily driven via automated nightly release snapshots. |
Scott Todd | 62efaee | 2024-05-31 13:33:55 -0700 | [diff] [blame] | 11 | These are scheduled automatically each day by the |
Stella Laurenzo | afd7cab | 2024-04-21 18:41:28 -0700 | [diff] [blame] | 12 | `schedule_candidate_release.yml` workflow, which selects a green commit from |
| 13 | main (for non optional CI tasks), created a tag of the format |
| 14 | `candidate-{YYYYMMDD}.{BUILDNUM}` and schedules automation to populate the |
| 15 | release. |
| 16 | |
| 17 | The `build_package.yml` workflow then runs jobs to do builds for all |
Scott Todd | 62efaee | 2024-05-31 13:33:55 -0700 | [diff] [blame] | 18 | platforms and packages, finally triggering the |
Stella Laurenzo | afd7cab | 2024-04-21 18:41:28 -0700 | [diff] [blame] | 19 | `validate_and_publish_release.yml` workflow. |
| 20 | |
| 21 | Release artifacts are uploaded as a GitHub |
| 22 | [pre release](https://github.com/iree-org/iree/releases) and an index of files |
| 23 | is updated by periodic automation at https://iree.dev/pip-release-links.html. |
| 24 | |
Scott Todd | 62efaee | 2024-05-31 13:33:55 -0700 | [diff] [blame] | 25 | Some debugging notes for this process are available here: |
Stella Laurenzo | afd7cab | 2024-04-21 18:41:28 -0700 | [diff] [blame] | 26 | https://iree.dev/developers/debugging/releases/ |
| 27 | |
| 28 | ### Nightly Release Packages |
| 29 | |
| 30 | A number of packages are produced automatically: |
| 31 | |
| 32 | * `iree-dist-*.tar.xz` (manylinux x86_64 and aarch64): Install image of the |
| 33 | binaries and development assets needed to use or depend on the C/C++ parts |
| 34 | of the project. |
| 35 | * `iree-compiler`: Binary Python wheels |
| 36 | * `iree-runtime`: Binary Python wheels |
| 37 | * `iree-tools-tf` and `iree-tools-tflite`: Pure Python wheels |
| 38 | |
| 39 | #### Linux Builds |
| 40 | |
Scott Todd | 62efaee | 2024-05-31 13:33:55 -0700 | [diff] [blame] | 41 | Binary Linux packages are built using a custom `manylinux` based Docker |
Stella Laurenzo | afd7cab | 2024-04-21 18:41:28 -0700 | [diff] [blame] | 42 | image hosted here: https://github.com/nod-ai/base-docker-images/pkgs/container/manylinux_x86_64 |
| 43 | (TODO: this repository of Docker images should be moved into `iree-org`) using |
| 44 | isolated self-hosted runners (only used for building checked in code) of |
| 45 | sufficient size for building large components and GitHub managed runners for |
| 46 | smaller components. The project aims to target all non-EOL Python versions with |
| 47 | Linux builds on x86_64 and aarch64. |
| 48 | |
| 49 | #### Windows Builds |
| 50 | |
| 51 | Windows builds are built using GitHub managed large Windows runners. Due to the |
| 52 | cost, the project aims to target the most recent version of Python only while |
| 53 | building version N-1 for the first year of the lifecycle of the next version. |
| 54 | |
| 55 | Only the Python `iree-compiler` and `iree-runtime` packages are built for |
| 56 | Windows. |
| 57 | |
| 58 | The release is published even if the MacOS build fails. When this happens, it |
| 59 | is fixed forward for the next snapshot. |
| 60 | |
| 61 | #### MacOS Builds |
| 62 | |
| 63 | MacOS builds are performed using self hosted MacOS runners in a dedicated |
Scott Todd | 62efaee | 2024-05-31 13:33:55 -0700 | [diff] [blame] | 64 | post-submit pool. Due to the cost, the project aims to target the most recent |
| 65 | version of Python only while building version N-1 for the first year of the |
Stella Laurenzo | afd7cab | 2024-04-21 18:41:28 -0700 | [diff] [blame] | 66 | lifecycle of the next version. |
| 67 | |
| 68 | Only the Python `iree-compiler` and `iree-runtime` packages are built for |
| 69 | MacOS. |
| 70 | |
| 71 | The release is published even if the MacOS build fails. When this happens, it |
| 72 | is fixed forward for the next snapshot. |
| 73 | |
| 74 | ## Retention |
| 75 | |
| 76 | The project will keep pre-release tagged releases on its releases page for a |
| 77 | minimum of 6 months. Releases older than this can be purged. |
| 78 | |
| 79 | ## Distribution to Package Registries |
| 80 | |
| 81 | The following package registry projects are managed as part of the IREE |
| 82 | release process: |
| 83 | |
| 84 | ### PyPI |
| 85 | |
| 86 | * https://pypi.org/project/iree-compiler/ |
| 87 | * https://pypi.org/project/iree-runtime/ |
| 88 | * https://pypi.org/project/iree-turbine/ |
| 89 | * https://pypi.org/project/shark-turbine/ (transitional until switched to |
| 90 | iree-turbine) |
| 91 | * https://pypi.org/project/iree-tools-tf/ |
| 92 | * https://pypi.org/project/iree-tools-tflite/ |
| 93 | |
| 94 | Deprecated projects no longer updated: |
| 95 | |
| 96 | * https://pypi.org/project/iree-runtime-instrumented/ (functionality is |
| 97 | included in the main iree-runtime package) |
| 98 | * https://pypi.org/project/iree-tools-xla/ (functionality is no longer needed) |
| 99 | |
| 100 | |
| 101 | ## Build Promotion |
| 102 | |
| 103 | There are presently two build promotion processes documented: |
| 104 | |
Scott Todd | 62efaee | 2024-05-31 13:33:55 -0700 | [diff] [blame] | 105 | * Old one focused purely on releasing IREE core packages: |
Stella Laurenzo | afd7cab | 2024-04-21 18:41:28 -0700 | [diff] [blame] | 106 | https://iree.dev/developers/general/release-management/ |
| 107 | * New one driven by the Torch frontend and documented below. |
| 108 | |
Scott Todd | 62efaee | 2024-05-31 13:33:55 -0700 | [diff] [blame] | 109 | The versioning scheme for |
Stella Laurenzo | afd7cab | 2024-04-21 18:41:28 -0700 | [diff] [blame] | 110 | [iree-turbine](https://github.com/iree-org/iree-turbine) is rooted on the |
| 111 | then-current PyTorch released version, with optional date-based dev/pre-release |
| 112 | suffixes (i.e. `rcYYYYMMDD` or `devYYYYMMDD`) or intra PyTorch releases |
| 113 | (i.e. `postVVVV`). |
| 114 | |
| 115 | This process is being trialed to correspond with the 2.3.0 release of PyTorch. |
| 116 | In this scenario, the pinned nightly build of IREE is considered current and |
| 117 | promoted as part of the Turbine release to PyPI (and the release is marked as |
| 118 | not pre-release on the GitHub releases page). |
| 119 | |
| 120 | Promotions are done roughly monthly or at need. The schedule is shifted to |
| 121 | account for extra factors as needed. |
| 122 | |
| 123 | In the future, we would like to adopt a real versioning scheme (beyond the |
| 124 | nightly calver+build number scheme) and manage promotion and pinning of the |
| 125 | core IREE dep more explicitly and in alignment with how downstreams are using |
| 126 | it. |
| 127 | |
| 128 | ### Steps to Promote |
| 129 | |
| 130 | There are multiple release artifacts that are deployed from this project: |
| 131 | |
| 132 | * shark-turbine wheel (transitional while switching to iree-turbine) |
| 133 | * iree-turbine wheel |
| 134 | * iree-compiler wheels |
| 135 | * iree-runtime wheels |
| 136 | |
| 137 | Typically we deploy IREE compiler and runtime wheels along with a turbine |
| 138 | release, effectively promoting a nightly. |
| 139 | |
| 140 | #### Building Artifacts |
| 141 | |
| 142 | Start with a clean clone of iree-turbine: |
| 143 | |
| 144 | ``` |
| 145 | cd scratch |
| 146 | git clone git@github.com:iree-org/iree-turbine.git |
| 147 | cd iree-turbine |
| 148 | ``` |
| 149 | |
| 150 | Build a pre-release: |
| 151 | |
| 152 | ``` |
| 153 | ./build_tools/build_release.py --core-version 2.3.0 --core-pre-version=rcYYYYMMDD |
| 154 | ``` |
| 155 | |
| 156 | Build an official release: |
| 157 | |
| 158 | ``` |
| 159 | ./build_tools/build_release.py --core-version 2.3.0 |
| 160 | ``` |
| 161 | |
| 162 | This will download all deps, including wheels for all supported platforms and |
| 163 | Python versions for iree-compiler and iree-runtime. All wheels will be placed |
| 164 | in the `wheelhouse/` directory. |
| 165 | |
| 166 | |
| 167 | #### Testing |
| 168 | |
| 169 | TODO: Write a script for this. |
| 170 | |
| 171 | ``` |
| 172 | python -m venv wheelhouse/test.venv |
| 173 | source wheelhouse/test.venv/bin/activate |
| 174 | pip install -f wheelhouse iree-turbine[testing] |
| 175 | # Temp: tests require torchvision. |
| 176 | pip install -f wheelhouse torchvision |
| 177 | pytest core/tests |
| 178 | ``` |
| 179 | |
| 180 | #### Push |
| 181 | |
| 182 | From the testing venv, verify that everything is sane: |
| 183 | |
| 184 | ``` |
| 185 | pip freeze |
| 186 | ``` |
| 187 | |
| 188 | Push IREE deps (if needed/updated): |
| 189 | |
| 190 | ``` |
| 191 | twine upload wheelhouse/iree_compiler-* wheelhouse/iree_runtime-* |
| 192 | ``` |
| 193 | |
| 194 | Push built wheels: |
| 195 | |
| 196 | ``` |
| 197 | twine upload wheelhouse/iree_turbine-* wheelhouse/shark_turbine-* |
| 198 | ``` |
| 199 | |
| 200 | #### Install from PyPI and Sanity Check |
| 201 | |
| 202 | TODO: Script this |
| 203 | |
| 204 | From the testing venv: |
| 205 | |
| 206 | ``` |
| 207 | pip uninstall -y shark-turbine iree-turbine iree-compiler iree-runtime |
| 208 | pip install iree-turbine |
| 209 | pytest core/tests |
| 210 | ``` |