Skip to content

Commit

Permalink
Bump tested IREE version to most recent nightly. (#361)
Browse files Browse the repository at this point in the history
Similar to #354, we're
approaching our 3.1.0 release across all IREE packages
(iree-org/iree#19192), so testing closer to
HEAD.

Changes needed:

* Update `FlatSymbolRefAttr` usage, similar to
nod-ai/shark-ai#732
* Allow the "Test Build Release" workflow to skip failed experimental
release downloads while IREE's macOS compiler release builds are broken
(iree-org/iree#19591)

Commit range:
iree-org/iree@iree-3.1.0rc20241220...iree-3.1.0rc20250103
  • Loading branch information
ScottTodd authored Jan 6, 2025
1 parent 78fc794 commit 4d2eaef
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 38 deletions.
100 changes: 65 additions & 35 deletions build_tools/build_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,25 @@
# indicates "fetch me a wheel that will install on this combo" vs "fetch me
# 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.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.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"],
]

# Same as above, but experimental platforms. See the `experimental` setting in
# https://github.com/iree-org/iree/blob/main/.github/workflows/build_package.yml.
IREE_EXPERIMENTAL_PLATFORM_ARGS = [
# Linux aarch64
# ["--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"],
# MacOS
["--platform", "macosx_13_0_universal2", "--python-version", "3.11"],
["--platform", "macosx_13_0_universal2", "--python-version", "3.12"],
Expand Down Expand Up @@ -86,32 +91,52 @@ def download_requirements(requirements_file, platforms=()):
exec(args)


def download_iree_binaries():
for platform_args in IREE_PLATFORM_ARGS:
print("Downloading for platform:", platform_args)
args = [
sys.executable,
"-m",
"pip",
"download",
"-d",
WHEEL_DIR,
"--no-deps",
]
args.extend(platform_args)
args += [
# 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-ci.txt",
]
exec(args)
def _download_iree_binaries_for_platform_args(
platform_args_list, is_experimental, strict_download_checks
):
for platform_args in platform_args_list:
try:
print("Downloading for platform:", platform_args)
args = [
sys.executable,
"-m",
"pip",
"download",
"-d",
WHEEL_DIR,
"--no-deps",
]
args.extend(platform_args)
args += [
# 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-ci.txt",
]
exec(args)
except:
if not is_experimental or strict_download_checks:
raise
print("Fetching for experimental platform failed, continuing")


def download_iree_binaries(strict_download_checks):
_download_iree_binaries_for_platform_args(
IREE_PLATFORM_ARGS,
is_experimental=False,
strict_download_checks=strict_download_checks,
)
_download_iree_binaries_for_platform_args(
IREE_EXPERIMENTAL_PLATFORM_ARGS,
is_experimental=True,
strict_download_checks=strict_download_checks,
)


def build_wheel(args, path):
Expand All @@ -137,15 +162,20 @@ def build_wheel(args, path):
def main():
parser = argparse.ArgumentParser()
parser.add_argument(
"--no-download", help="Disable dep download", action="store_true"
"--no-download", help="Disable all downloads", action="store_true"
)
parser.add_argument(
"--strict-download-checks",
help="Require that all downloads succeed, even for experimental platforms",
action="store_true",
)
args = parser.parse_args()

WHEEL_DIR.mkdir(parents=True, exist_ok=True)

if not args.no_download:
print("Prefetching all IREE binaries")
download_iree_binaries()
download_iree_binaries(args.strict_download_checks)
print("Prefetching torch CPU")
download_requirements(REPO_ROOT / "pytorch-cpu-requirements.txt")
print("Downloading remaining requirements")
Expand Down
4 changes: 2 additions & 2 deletions iree-requirements-ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
# Uncomment to skip versions from PyPI (so _only_ nightly versions).
# --no-index

iree-base-compiler==3.1.0rc20241220
iree-base-runtime==3.1.0rc20241220
iree-base-compiler==3.1.0rc20250103
iree-base-runtime==3.1.0rc20250103
2 changes: 1 addition & 1 deletion iree/turbine/runtime/op_reg/impl_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def load_template(self, kb: KernelBuilder, name: str, **kwargs) -> Operation:
def call_function(target_function: Operation, *operands: Value) -> Sequence[Value]:
"""Emits a util.call for a util.func target function operation."""
target_symbol = FlatSymbolRefAttr.get(
StringAttr(target_function.attributes["sym_name"]).value_bytes
StringAttr(target_function.attributes["sym_name"]).value
)
ftype = FunctionType(TypeAttr(target_function.attributes["function_type"]).value)
return Operation.create(
Expand Down

0 comments on commit 4d2eaef

Please sign in to comment.