Skip to content

Commit 95a9740

Browse files
committed
ci: use python 3.12 venv for test-kernels install step
The Strix Halo runner uses a custom container-hook that exec's commands with a PATH where /usr/bin/python3 (Debian 3.11, PEP 668 externally managed) precedes /usr/local/bin/python3 (3.12). uv pip install --system then fails with 'externally managed' against the system 3.11. Create a venv from /usr/local/bin/python3.12 instead and prepend its bin/ to GITHUB_PATH so subsequent python and pytest invocations resolve to the venv interpreter. Signed-off-by: Matthias Gehre <matthias.gehre@amd.com>
1 parent 0b992ff commit 95a9740

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/build-rocm-wheels.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,21 +189,27 @@ jobs:
189189
190190
- name: Install wheel and test dependencies
191191
run: |
192+
# Create a venv with Python 3.12 from the CI image. The runner's
193+
# exec PATH may put Debian's PEP 668-marked /usr/bin/python3.11
194+
# first, which breaks `uv pip install --system`.
195+
uv venv --python 3.12 "$GITHUB_WORKSPACE/.venv"
196+
echo "$GITHUB_WORKSPACE/.venv/bin" >> "$GITHUB_PATH"
197+
source "$GITHUB_WORKSPACE/.venv/bin/activate"
192198
# Pin torch from the nightly ROCm index *only* (no PyPI
193199
# fallback) so we always get the ROCm wheel.
194-
uv pip install --system \
200+
uv pip install \
195201
--upgrade-package torch \
196202
torch \
197203
--index-url ${{ env.PYTORCH_INDEX_URL }}
198-
uv pip install --system dist/*.whl \
204+
uv pip install dist/*.whl \
199205
pytest pytest-timeout numpy \
200206
tblib transformers huggingface_hub sentencepiece pillow \
201207
--index-url ${{ env.PYTORCH_INDEX_URL }} \
202208
--extra-index-url https://pypi.org/simple/ \
203209
--index-strategy unsafe-first-match
204210
# Nightly torchvision has operator ABI mismatch with nightly torch.
205211
# Our kernel tests don't need it; remove to prevent conftest crash.
206-
uv pip uninstall --system torchvision 2>/dev/null || true
212+
uv pip uninstall torchvision 2>/dev/null || true
207213
208214
- name: Prepare test environment
209215
run: |

0 commit comments

Comments
 (0)