From c27c90c6f0436eb76724d153b7d70de2df2a995a Mon Sep 17 00:00:00 2001 From: Scott Todd Date: Thu, 14 Nov 2024 08:18:35 -0800 Subject: [PATCH] Add `--pre` flag to pip installs for using nightly versions. (#19145) Progress on https://github.com/iree-org/iree/issues/18938. Pip will only install "pre-release" versions if `--pre` is set or the version is set explicitly: https://pip.pypa.io/en/stable/cli/pip_install/#pre-release-versions. The `rc` part of our `rcYYYYMMDD` suffix used in the nightly packages is considered a "Pre-release segment" in the version string: https://packaging.python.org/en/latest/specifications/version-specifiers/#public-version-identifiers. Also switched sample Colab notebooks to use the new package names. I tested these lightly, but did not fully regenerate them, so the embedded logs still reference old versions of packages: * Manually ran a few notebooks from my branch like https://colab.research.google.com/github/ScottTodd/iree/blob/release-pre/samples/colab/tensorflow_edge_detection.ipynb * Ran the 'samples' workflow on my fork: https://github.com/ScottTodd/iree/actions/runs/11828250281 --- .github/workflows/samples.yml | 1 + docs/website/docs/developers/debugging/integration-tests.md | 4 ++-- .../snippets/_iree-compiler-from-release.md | 4 ++-- .../snippets/_iree-runtime-from-release.md | 4 ++-- docs/website/docs/guides/ml-frameworks/onnx.md | 3 ++- docs/website/docs/guides/ml-frameworks/tensorflow.md | 1 + docs/website/docs/guides/ml-frameworks/tflite.md | 1 + docs/website/docs/reference/bindings/python.md | 5 +++-- experimental/web/generate_web_metrics.sh | 2 +- samples/colab/low_level_invoke_function.ipynb | 2 +- samples/colab/tensorflow_edge_detection.ipynb | 2 +- samples/colab/tensorflow_hub_import.ipynb | 4 ++-- samples/colab/tensorflow_mnist_training.ipynb | 4 ++-- samples/colab/tensorflow_resnet.ipynb | 4 ++-- samples/colab/tflite_text_classification.ipynb | 4 ++-- samples/dynamic_shapes/tensorflow_dynamic_shapes.ipynb | 4 ++-- samples/dynamic_shapes/test.sh | 1 + samples/variables_and_state/variables_and_state.ipynb | 4 ++-- 18 files changed, 30 insertions(+), 24 deletions(-) diff --git a/.github/workflows/samples.yml b/.github/workflows/samples.yml index 61af0eb1a27c..c39e8acf3cfa 100644 --- a/.github/workflows/samples.yml +++ b/.github/workflows/samples.yml @@ -86,6 +86,7 @@ jobs: python3 -m pip install \ --find-links https://iree.dev/pip-release-links.html \ --upgrade \ + --pre \ iree-base-compiler \ iree-base-runtime - name: "Setup emsdk" diff --git a/docs/website/docs/developers/debugging/integration-tests.md b/docs/website/docs/developers/debugging/integration-tests.md index bf40d1b4e26c..f56fadcfff61 100644 --- a/docs/website/docs/developers/debugging/integration-tests.md +++ b/docs/website/docs/developers/debugging/integration-tests.md @@ -71,9 +71,9 @@ All steps here assume starting from the IREE root directory. Install distributed packages ```bash - # Install packages from nightly releases + # Install packages from nightly pre-releases # This should work for most cases, as the importers change infrequently - python -m pip install \ + python -m pip install --pre \ iree-base-compiler iree-base-runtime iree-tools-tf iree-tools-tflite \ --find-links https://iree.dev/pip-release-links.html ``` diff --git a/docs/website/docs/guides/deployment-configurations/snippets/_iree-compiler-from-release.md b/docs/website/docs/guides/deployment-configurations/snippets/_iree-compiler-from-release.md index e81dd411ea71..18c055e5ad2c 100644 --- a/docs/website/docs/guides/deployment-configurations/snippets/_iree-compiler-from-release.md +++ b/docs/website/docs/guides/deployment-configurations/snippets/_iree-compiler-from-release.md @@ -9,13 +9,13 @@ === ":material-alert: Nightly releases" - Nightly releases are published on + Nightly pre-releases are published on [GitHub releases](https://github.com/iree-org/iree/releases). ``` shell python -m pip install \ --find-links https://iree.dev/pip-release-links.html \ - --upgrade iree-base-compiler + --upgrade --pre iree-base-compiler ``` !!! tip diff --git a/docs/website/docs/guides/deployment-configurations/snippets/_iree-runtime-from-release.md b/docs/website/docs/guides/deployment-configurations/snippets/_iree-runtime-from-release.md index e93cde864e31..c72aff7bdea4 100644 --- a/docs/website/docs/guides/deployment-configurations/snippets/_iree-runtime-from-release.md +++ b/docs/website/docs/guides/deployment-configurations/snippets/_iree-runtime-from-release.md @@ -9,11 +9,11 @@ === ":material-alert: Nightly releases" - Nightly releases are published on + Nightly pre-releases are published on [GitHub releases](https://github.com/iree-org/iree/releases). ``` shell python -m pip install \ --find-links https://iree.dev/pip-release-links.html \ - --upgrade iree-base-runtime + --upgrade --pre iree-base-runtime ``` diff --git a/docs/website/docs/guides/ml-frameworks/onnx.md b/docs/website/docs/guides/ml-frameworks/onnx.md index 918359043e18..5be3190d13c3 100644 --- a/docs/website/docs/guides/ml-frameworks/onnx.md +++ b/docs/website/docs/guides/ml-frameworks/onnx.md @@ -70,13 +70,14 @@ graph LR === ":material-alert: Nightly releases" - Nightly releases are published on + Nightly pre-releases are published on [GitHub releases](https://github.com/iree-org/iree/releases). ``` shell python -m pip install \ --find-links https://iree.dev/pip-release-links.html \ --upgrade \ + --pre \ iree-base-compiler[onnx] \ iree-base-runtime ``` diff --git a/docs/website/docs/guides/ml-frameworks/tensorflow.md b/docs/website/docs/guides/ml-frameworks/tensorflow.md index e064ff954db8..253dd57ab263 100644 --- a/docs/website/docs/guides/ml-frameworks/tensorflow.md +++ b/docs/website/docs/guides/ml-frameworks/tensorflow.md @@ -80,6 +80,7 @@ graph LR python -m pip install \ --find-links https://iree.dev/pip-release-links.html \ --upgrade \ + --pre \ iree-base-compiler \ iree-base-runtime \ iree-tools-tf diff --git a/docs/website/docs/guides/ml-frameworks/tflite.md b/docs/website/docs/guides/ml-frameworks/tflite.md index 913809657ad1..9e96da45c15a 100644 --- a/docs/website/docs/guides/ml-frameworks/tflite.md +++ b/docs/website/docs/guides/ml-frameworks/tflite.md @@ -75,6 +75,7 @@ graph LR python -m pip install \ --find-links https://iree.dev/pip-release-links.html \ --upgrade \ + --pre \ iree-base-compiler \ iree-base-runtime \ iree-tools-tflite diff --git a/docs/website/docs/reference/bindings/python.md b/docs/website/docs/reference/bindings/python.md index f024c423388a..f23907d19ef0 100644 --- a/docs/website/docs/reference/bindings/python.md +++ b/docs/website/docs/reference/bindings/python.md @@ -83,15 +83,16 @@ To use IREE's Python bindings, you will first need to install iree-base-runtime ``` -=== ":material-alert: Nightly releases" +=== ":material-alert: Nightly pre-releases" - Nightly releases are published on + Nightly pre-releases are published on [GitHub releases](https://github.com/iree-org/iree/releases). ``` shell python -m pip install \ --find-links https://iree.dev/pip-release-links.html \ --upgrade \ + --pre \ iree-base-compiler \ iree-base-runtime ``` diff --git a/experimental/web/generate_web_metrics.sh b/experimental/web/generate_web_metrics.sh index 57adefb6f0f1..b7049f5e834e 100644 --- a/experimental/web/generate_web_metrics.sh +++ b/experimental/web/generate_web_metrics.sh @@ -65,7 +65,7 @@ trap "deactivate 2> /dev/null" EXIT # Skip package installs when you want by commenting this out. Freezing to a # specific version when iterating on metrics is useful, and fetching is slow. -python -m pip install --upgrade \ +python -m pip install --upgrade --pre \ --find-links https://iree.dev/pip-release-links.html \ iree-base-compiler iree-tools-tflite diff --git a/samples/colab/low_level_invoke_function.ipynb b/samples/colab/low_level_invoke_function.ipynb index f0e65d241f59..f8756835b9da 100644 --- a/samples/colab/low_level_invoke_function.ipynb +++ b/samples/colab/low_level_invoke_function.ipynb @@ -66,7 +66,7 @@ "outputId": "0339165a-a35f-4b46-9cf8-f22adc69a7fe" }, "source": [ - "!python -m pip install iree-compiler iree-runtime -f https://iree.dev/pip-release-links.html" + "!python -m pip install --pre iree-base-compiler iree-base-runtime -f https://iree.dev/pip-release-links.html" ], "execution_count": 2, "outputs": [ diff --git a/samples/colab/tensorflow_edge_detection.ipynb b/samples/colab/tensorflow_edge_detection.ipynb index a0a26d6e3aa3..a65c88ca1b09 100644 --- a/samples/colab/tensorflow_edge_detection.ipynb +++ b/samples/colab/tensorflow_edge_detection.ipynb @@ -78,7 +78,7 @@ "outputId": "b6126fa9-b170-45dc-c0fd-8081e7ab2732" }, "source": [ - "!python -m pip install iree-compiler iree-runtime iree-tools-tf -f https://iree.dev/pip-release-links.html" + "!python -m pip install --pre iree-base-compiler iree-base-runtime iree-tools-tf -f https://iree.dev/pip-release-links.html" ], "execution_count": 3, "outputs": [ diff --git a/samples/colab/tensorflow_hub_import.ipynb b/samples/colab/tensorflow_hub_import.ipynb index 7cc5801a1a61..a41848f67667 100644 --- a/samples/colab/tensorflow_hub_import.ipynb +++ b/samples/colab/tensorflow_hub_import.ipynb @@ -77,7 +77,7 @@ }, "source": [ "%%capture\n", - "!python -m pip install iree-compiler iree-runtime iree-tools-tf -f https://iree.dev/pip-release-links.html" + "!python -m pip install --pre iree-base-compiler iree-base-runtime iree-tools-tf -f https://iree.dev/pip-release-links.html" ], "execution_count": 11, "outputs": [] @@ -510,4 +510,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/samples/colab/tensorflow_mnist_training.ipynb b/samples/colab/tensorflow_mnist_training.ipynb index 44931d3add7c..8f15261b45a2 100644 --- a/samples/colab/tensorflow_mnist_training.ipynb +++ b/samples/colab/tensorflow_mnist_training.ipynb @@ -83,7 +83,7 @@ }, "source": [ "%%capture\n", - "!python -m pip install iree-compiler iree-runtime iree-tools-tf -f https://iree.dev/pip-release-links.html" + "!python -m pip install --pre iree-base-compiler iree-base-runtime iree-tools-tf -f https://iree.dev/pip-release-links.html" ], "execution_count": 21, "outputs": [] @@ -638,4 +638,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/samples/colab/tensorflow_resnet.ipynb b/samples/colab/tensorflow_resnet.ipynb index 73d0a5e824ba..f3b00fdcc5a7 100644 --- a/samples/colab/tensorflow_resnet.ipynb +++ b/samples/colab/tensorflow_resnet.ipynb @@ -77,7 +77,7 @@ "outputId": "51635ebb-cf05-4b5a-f2ef-a0e3c935d113" }, "source": [ - "!python -m pip install iree-compiler iree-runtime iree-tools-tf -f https://iree.dev/pip-release-links.html" + "!python -m pip install --pre iree-base-compiler iree-base-runtime iree-tools-tf -f https://iree.dev/pip-release-links.html" ], "execution_count": 3, "outputs": [ @@ -352,4 +352,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/samples/colab/tflite_text_classification.ipynb b/samples/colab/tflite_text_classification.ipynb index 33432ef24874..76482cc3a526 100644 --- a/samples/colab/tflite_text_classification.ipynb +++ b/samples/colab/tflite_text_classification.ipynb @@ -53,7 +53,7 @@ "source": [ "%%capture\n", "!python -m pip install --upgrade tensorflow\n", - "!python -m pip install iree-compiler iree-runtime iree-tools-tflite -f https://iree.dev/pip-release-links.html\n", + "!python -m pip install --pre iree-base-compiler iree-base-runtime iree-tools-tflite -f https://iree.dev/pip-release-links.html\n", "!python -m pip install tflite-runtime-nightly" ] }, @@ -486,4 +486,4 @@ }, "nbformat": 4, "nbformat_minor": 0 -} \ No newline at end of file +} diff --git a/samples/dynamic_shapes/tensorflow_dynamic_shapes.ipynb b/samples/dynamic_shapes/tensorflow_dynamic_shapes.ipynb index ac94b273d182..fa7448d75f0b 100644 --- a/samples/dynamic_shapes/tensorflow_dynamic_shapes.ipynb +++ b/samples/dynamic_shapes/tensorflow_dynamic_shapes.ipynb @@ -177,7 +177,7 @@ }, "source": [ "%%capture\n", - "!python -m pip install iree-compiler iree-runtime iree-tools-tf -f https://iree.dev/pip-release-links.html" + "!python -m pip install --pre iree-base-compiler iree-base-runtime iree-tools-tf -f https://iree.dev/pip-release-links.html" ], "execution_count": 6, "outputs": [] @@ -505,4 +505,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/samples/dynamic_shapes/test.sh b/samples/dynamic_shapes/test.sh index f89162626659..242889b7e0e1 100755 --- a/samples/dynamic_shapes/test.sh +++ b/samples/dynamic_shapes/test.sh @@ -33,6 +33,7 @@ trap "deactivate 2> /dev/null" EXIT python -m pip install \ --find-links https://iree.dev/pip-release-links.html \ --upgrade \ + --pre \ iree-base-compiler # 3. Compile `dynamic_shapes.mlir` using `iree-compile`. diff --git a/samples/variables_and_state/variables_and_state.ipynb b/samples/variables_and_state/variables_and_state.ipynb index f095f8bf2ce5..aa2648b29f92 100644 --- a/samples/variables_and_state/variables_and_state.ipynb +++ b/samples/variables_and_state/variables_and_state.ipynb @@ -182,7 +182,7 @@ }, "source": [ "%%capture\n", - "!python -m pip install iree-compiler iree-runtime iree-tools-tf -f https://iree.dev/pip-release-links.html" + "!python -m pip install --pre iree-base-compiler iree-base-runtime iree-tools-tf -f https://iree.dev/pip-release-links.html" ], "execution_count": 6, "outputs": [] @@ -504,4 +504,4 @@ ] } ] -} \ No newline at end of file +}