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