Fix ROCm torch wheel not replacing CPU torch

uv pip install without --reinstall-package silently skips the ROCm wheel
when CPU torch already satisfies torch>=2.0.0, leaving a CPU installation
in .venv-rocm and causing a broken import at startup.

https://claude.ai/code/session_0168pSswiaoEf6LEx6UQWfBu
This commit is contained in:
Claude
2026-05-04 09:33:12 +00:00
parent bb6da662de
commit 5c5d739bf1
+1 -1
View File
@@ -105,7 +105,7 @@ elif $ROCM_MODE; then
fi
uv sync --no-sources
echo "--> Installing PyTorch ROCm 6.2 wheel..."
uv pip install torch --index-url https://download.pytorch.org/whl/rocm6.2
uv pip install torch --index-url https://download.pytorch.org/whl/rocm6.2 --reinstall-package torch
if [[ -n "$LOCK_BACKUP" ]]; then
cp "$LOCK_BACKUP" uv.lock
rm -f "$LOCK_BACKUP"