Skip to content

Commit

Permalink
Bump version to 2.5.0 and document release process. (#256)
Browse files Browse the repository at this point in the history
The `docs/releasing.md` file was first introduced next to the
`build_release.py` script in
nod-ai/SHARK-ModelDev#605. I don't see that file
in this repository (iree-org/iree-turbine) though, despite
nod-ai/SHARK-ModelDev#655 claiming that it had
been upstreamed. Since the packages involved have changed over the
months (shark-turbine --> iree-turbine naming, see also
#28), I also updated the
document to reflect the current setup.

The `iree-requirements.txt` file was being used to pin versions of the
`iree-compiler` and `iree-runtime` that would be released together with
this `iree-turbine` package. That was overlooked when
#115 removed pins from that
file. I've reworked the script to reference `iree-requirements-ci.txt`
for now, but we can continue to iterate on the cross-project release
process going forward (with docs this time).

I've updated the version in code from 2.3.0 to 2.5.0. We can push a
release to https://github.com/iree-org/iree-turbine/releases and
https://pypi.org/project/iree-turbine/#history using the new version
next. Note that 2.3.1, 2.4.0, and 2.4.1 were released to PyPI without
updating the code or GitHub releases.
  • Loading branch information
ScottTodd authored Nov 6, 2024
1 parent db1ec57 commit 9b3fa06
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test_build_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
uses: actions/checkout@v3

- name: Build Release Wheels
run: ./build_tools/build_release.py --core-version 2.3.0
run: ./build_tools/build_release.py --package-version 2.5.0.dev

- name: Validate Release Build
if: ${{ !cancelled() }}
Expand Down
44 changes: 27 additions & 17 deletions build_tools/build_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,27 @@
# a specific wheel".
IREE_PLATFORM_ARGS = [
# Linux aarch64
["--platform", "manylinux_2_28_aarch64", "--python-version", "3.9"],
# ["--platform", "manylinux_2_28_aarch64", "--python-version", "3.9"],
["--platform", "manylinux_2_28_aarch64", "--python-version", "3.10"],
["--platform", "manylinux_2_28_aarch64", "--python-version", "3.11"],
["--platform", "manylinux_2_28_aarch64", "--python-version", "3.12"],
["--platform", "manylinux_2_28_aarch64", "--python-version", "3.13"],
# ["--platform", "manylinux_2_28_aarch64", "--python-version", "3.13t"],
# Linux x86_64
["--platform", "manylinux_2_28_x86_64", "--python-version", "3.9"],
# ["--platform", "manylinux_2_28_x86_64", "--python-version", "3.9"],
["--platform", "manylinux_2_28_x86_64", "--python-version", "3.10"],
["--platform", "manylinux_2_28_x86_64", "--python-version", "3.11"],
["--platform", "manylinux_2_28_x86_64", "--python-version", "3.12"],
["--platform", "manylinux_2_28_x86_64", "--python-version", "3.13"],
# ["--platform", "manylinux_2_28_x86_64", "--python-version", "3.13t"],
# MacOS
["--platform", "macosx_13_0_universal2", "--python-version", "3.11"],
["--platform", "macosx_13_0_universal2", "--python-version", "3.12"],
["--platform", "macosx_13_0_universal2", "--python-version", "3.13"],
# Windows
["--platform", "win_amd64", "--python-version", "3.11"],
["--platform", "win_amd64", "--python-version", "3.12"],
["--platform", "win_amd64", "--python-version", "3.13"],
]


Expand All @@ -55,13 +63,13 @@ def write_version_info(args):
with open(VERSION_INFO_FILE, "rt") as f:
info_dict = json.load(f)

# Compute core-version.
core_version = eval_version(args.core_version)
if args.core_pre_version:
core_version += eval_version(args.core_pre_version)
if args.core_post_version:
core_version += f".{eval_version(args.core_post_version)}"
info_dict["core-version"] = core_version
# Compute package-version.
package_version = eval_version(args.package_version)
if args.package_pre_version:
package_version += eval_version(args.package_pre_version)
if args.package_post_version:
package_version += f".{eval_version(args.package_post_version)}"
info_dict["package-version"] = package_version

with open(VERSION_INFO_FILE, "wt") as f:
json.dump(info_dict, f)
Expand Down Expand Up @@ -112,12 +120,16 @@ def download_iree_binaries():
]
args.extend(platform_args)
args += [
"-f",
"https://iree.dev/pip-release-links.html",
# Uncomment to allow nightly releases (if not pinned in the file)
# "-f",
# "https://iree.dev/pip-release-links.html",
"-f",
WHEEL_DIR,
# Note: could also drop `-ci` here, if coordinating a release
# across projects and new stable versions of the IREE packages
# haven't yet been pushed.
"-r",
REPO_ROOT / "iree-requirements.txt",
REPO_ROOT / "iree-requirements-ci.txt",
]
exec(args)

Expand All @@ -130,16 +142,14 @@ def build_wheel(path, env=None):

def main():
parser = argparse.ArgumentParser()
parser.add_argument("--package-version", help="Version to use", required=True)
parser.add_argument(
"--core-version", help="Version for the core component", required=True
)
parser.add_argument(
"--core-pre-version",
"--package-pre-version",
help="Pre-release version segment or (YYYYMMDD)",
default="",
)
parser.add_argument(
"--core-post-version",
"--package-post-version",
help="Post-release version segment or (YYYYMMDD)",
default="",
)
Expand Down
69 changes: 69 additions & 0 deletions docs/releasing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Releasing iree-turbine

This project hosts the https://pypi.org/project/iree-turbine/ package, which
depends on the https://pypi.org/project/iree-compiler/ and
https://pypi.org/project/iree-runtime/ packages. Releases can either be
conducted independently, or they can be coordinated across projects by
initiating a release here.

## Building Artifacts

Build a pre-release:

```bash
./build_tools/build_release.py --package-version 2.5.0 --package-pre-version=rcYYYYMMDD
```

Build an official release:

```bash
./build_tools/build_release.py --package-version 2.5.0
```

This will download all deps, including wheels for all supported platforms and
Python versions for iree-compiler and iree-runtime. All wheels will be placed
in the `wheelhouse/` directory.

## Testing

```bash
./build_tools/post_build_release_test.sh
```

This will

1. Set up a python virtual environment using your default `python` version
2. Install wheels from the `wheelhouse/` directory
3. Run `pytest` tests

## Push

From the testing venv, verify that everything is sane:

```bash
pip freeze
```

Push IREE deps (if needed/updated):

```bash
twine upload wheelhouse/iree_compiler-* wheelhouse/iree_runtime-*
```

Push built wheels:

```bash
twine upload wheelhouse/iree_turbine-*
```

## Install from PyPI and Sanity Check

TODO: Script this

From the testing venv:

```bash
pip uninstall -y iree-turbine iree-compiler iree-runtime
pip install iree-turbine
pytest .
```
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def load_version_info():


version_info = load_version_info()
PACKAGE_VERSION = version_info["core-version"]
PACKAGE_VERSION = version_info["package-version"]

packages = find_namespace_packages(
include=[
Expand Down
4 changes: 3 additions & 1 deletion version_info.json
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{"core-version": "2.3.0rc20240621", "package-version": "0.9.7.dev1"}
{
"package-version": "2.5.0"
}

0 comments on commit 9b3fa06

Please sign in to comment.