Skip to content

Commit 7c5bd86

Browse files
authored
Update documentation for using nightly releases. (#567)
Hopefully this helps with issues like #544
1 parent e9bfba2 commit 7c5bd86

File tree

2 files changed

+109
-22
lines changed

2 files changed

+109
-22
lines changed

docs/nightly_releases.md

Lines changed: 106 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
# Nightly releases
22

3-
> [!WARNING]
4-
> This is still under development! See
5-
> https://github.com/nod-ai/shark-ai/issues/400.
6-
>
7-
> These instructions will be converted into a user guide once stable packages
8-
> are published to PyPI: <https://github.com/nod-ai/shark-ai/issues/359>.
9-
103
Nightly releases are uploaded to
114
https://github.com/nod-ai/shark-ai/releases/tag/dev-wheels.
125

@@ -51,11 +44,9 @@ which python3.11
5144
# /usr/bin/python3.11
5245
```
5346

54-
> [!NOTE]
55-
> Tip: manage multiple Python versions using `pyenv`
56-
> (<https://github.com/pyenv/pyenv>), or `update-alternatives` on Linux
57-
> ([guide here](https://linuxconfig.org/how-to-change-from-default-to-alternative-python-version-on-debian-linux))
58-
> , or the
47+
> [!TIP]
48+
> Manage multiple Python versions using `pyenv`
49+
> (<https://github.com/pyenv/pyenv>), or the
5950
> [Python Launcher for Windows](https://docs.python.org/3/using/windows.html#python-launcher-for-windows)
6051
> on Windows.
6152
@@ -117,3 +108,106 @@ pip install -f https://iree.dev/pip-release-links.html --upgrade --pre \
117108
iree-base-compiler iree-base-runtime --src deps \
118109
-e "git+https://github.com/iree-org/iree-turbine.git#egg=iree-turbine"
119110
```
111+
112+
## Switching between stable and nightly channels
113+
114+
The [`shark-ai` package on PyPI](https://pypi.org/project/shark-ai/) is a
115+
meta-package that pins specific stable versions of each package that share
116+
at least their major and minor versions:
117+
118+
```bash
119+
pip install shark-ai==2.9.1
120+
121+
pip freeze
122+
# ...
123+
# iree-base-compiler==2.9.0
124+
# iree-base-runtime==2.9.0
125+
# iree-turbine==2.9.0
126+
# ...
127+
# shark-ai==2.9.1
128+
# shortfin==2.9.1
129+
# ...
130+
```
131+
132+
If you attempt to update any individual package outside of those supported
133+
versions, pip will log an error but continue anyway:
134+
135+
```bash
136+
pip install --upgrade --pre \
137+
-f https://github.com/nod-ai/shark-ai/releases/expanded_assets/dev-wheels \
138+
shortfin==3.0.0rc20241118
139+
140+
# Looking in links: https://github.com/nod-ai/shark-ai/releases/expanded_assets/dev-wheels
141+
# Collecting shortfin==3.0.0rc20241118
142+
# Downloading https://github.com/nod-ai/shark-ai/releases/download/dev-wheels/shortfin-3.0.0rc20241118-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.5 MB)
143+
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.5/2.5 MB 24.3 MB/s eta 0:00:00
144+
# Installing collected packages: shortfin
145+
# Attempting uninstall: shortfin
146+
# Found existing installation: shortfin 2.9.1
147+
# Uninstalling shortfin-2.9.1:
148+
# Successfully uninstalled shortfin-2.9.1
149+
# ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
150+
# shark-ai 2.9.1 requires shortfin==2.9.1, but you have shortfin 3.0.0rc20241118 which is incompatible.
151+
# Successfully installed shortfin-3.0.0rc20241118
152+
153+
pip freeze
154+
# ...
155+
# shark-ai==2.9.1
156+
# shortfin==3.0.0rc20241118
157+
# ...
158+
```
159+
160+
Installing the `shark-ai` package again should get back to aligned versions:
161+
162+
```bash
163+
pip install shark-ai==2.9.1
164+
# ...
165+
# Installing collected packages: shortfin
166+
# Attempting uninstall: shortfin
167+
# Found existing installation: shortfin 3.0.0rc20241118
168+
# Uninstalling shortfin-3.0.0rc20241118:
169+
# Successfully uninstalled shortfin-3.0.0rc20241118
170+
# Successfully installed shortfin-2.9.1
171+
172+
pip freeze
173+
# ...
174+
# shark-ai==2.9.1
175+
# shortfin==2.9.1
176+
# ...
177+
```
178+
179+
You can also uninstall the `shark-ai` package to bypass the error and take full
180+
control of package versions yourself:
181+
182+
```bash
183+
pip uninstall shark-ai
184+
185+
pip freeze
186+
# ...
187+
# (note: no shark-ai package)
188+
# shortfin==2.9.1
189+
# ...
190+
191+
pip install --upgrade --pre \
192+
-f https://github.com/nod-ai/shark-ai/releases/expanded_assets/dev-wheels \
193+
shortfin==3.0.0rc20241118
194+
195+
# Looking in links: https://github.com/nod-ai/shark-ai/releases/expanded_assets/dev-wheels
196+
# Collecting shortfin==3.0.0rc20241118
197+
# Using cached https://github.com/nod-ai/shark-ai/releases/download/dev-wheels/shortfin-3.0.0rc20241118-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.5 MB)
198+
# Installing collected packages: shortfin
199+
# Attempting uninstall: shortfin
200+
# Found existing installation: shortfin 2.9.1
201+
# Uninstalling shortfin-2.9.1:
202+
# Successfully uninstalled shortfin-2.9.1
203+
# Successfully installed shortfin-3.0.0rc20241118
204+
205+
pip freeze
206+
# ...
207+
# (note: no shark-ai package)
208+
# shortfin==3.0.0rc20241118
209+
# ...
210+
```
211+
212+
If you ever get stuck, consider creating a fresh
213+
[virtual environment](https://docs.python.org/3/library/venv.html).

docs/user_guide.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# SHARK User Guide
22

3-
> [!WARNING]
4-
> This is still pre-release so the artifacts listed here may be broken
5-
>
6-
73
These instructions cover the usage of the latest stable release of SHARK. For a more bleeding edge release please install the [nightly releases](nightly_releases.md).
84

95
## Prerequisites
@@ -12,7 +8,6 @@ Our current user guide requires that you have:
128
- Access to a computer with an installed AMD Instinct™ MI300x Series Accelerator
139
- Installed a compatible version of Linux and ROCm on the computer (see the [ROCm compatability matrix](https://rocm.docs.amd.com/en/latest/compatibility/compatibility-matrix.html))
1410

15-
1611
## Set up Environment
1712

1813
This section will help you install Python and set up a Python environment with venv.
@@ -51,11 +46,9 @@ pip install torch torchvision torchaudio --index-url https://download.pytorch.or
5146
pip install shark-ai[apps]
5247
```
5348

54-
Temporarily, you may need an update to your `shortfin` install.
55-
Install the latest pre-release with:
56-
```
57-
pip install shortfin --upgrade --pre -f https://github.com/nod-ai/shark-ai/releases/expanded_assets/dev-wheels
58-
```
49+
> [!TIP]
50+
> To switch from the stable release channel to the nightly release channel,
51+
> see [`nightly_releases.md`](./nightly_releases.md).
5952
6053
### Test the installation.
6154

0 commit comments

Comments
 (0)