Skip to content

Commit

Permalink
Add --pre flag to pip installs for using nightly versions. (#19145)
Browse files Browse the repository at this point in the history
Progress on #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
  • Loading branch information
ScottTodd authored Nov 14, 2024
1 parent eef2c3a commit c27c90c
Show file tree
Hide file tree
Showing 18 changed files with 30 additions and 24 deletions.
1 change: 1 addition & 0 deletions .github/workflows/samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions docs/website/docs/developers/debugging/integration-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
3 changes: 2 additions & 1 deletion docs/website/docs/guides/ml-frameworks/onnx.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
1 change: 1 addition & 0 deletions docs/website/docs/guides/ml-frameworks/tensorflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions docs/website/docs/guides/ml-frameworks/tflite.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions docs/website/docs/reference/bindings/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
2 changes: 1 addition & 1 deletion experimental/web/generate_web_metrics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion samples/colab/low_level_invoke_function.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
2 changes: 1 addition & 1 deletion samples/colab/tensorflow_edge_detection.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
4 changes: 2 additions & 2 deletions samples/colab/tensorflow_hub_import.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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": []
Expand Down Expand Up @@ -510,4 +510,4 @@
]
}
]
}
}
4 changes: 2 additions & 2 deletions samples/colab/tensorflow_mnist_training.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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": []
Expand Down Expand Up @@ -638,4 +638,4 @@
]
}
]
}
}
4 changes: 2 additions & 2 deletions samples/colab/tensorflow_resnet.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -352,4 +352,4 @@
]
}
]
}
}
4 changes: 2 additions & 2 deletions samples/colab/tflite_text_classification.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
Expand Down Expand Up @@ -486,4 +486,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
}
}
4 changes: 2 additions & 2 deletions samples/dynamic_shapes/tensorflow_dynamic_shapes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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": []
Expand Down Expand Up @@ -505,4 +505,4 @@
]
}
]
}
}
1 change: 1 addition & 0 deletions samples/dynamic_shapes/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
4 changes: 2 additions & 2 deletions samples/variables_and_state/variables_and_state.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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": []
Expand Down Expand Up @@ -504,4 +504,4 @@
]
}
]
}
}

0 comments on commit c27c90c

Please sign in to comment.