Skip to content

Commit 9c433ca

Browse files
committed
uvpip
1 parent dadf8f8 commit 9c433ca

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

.lightning/workflows/fabric.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,16 @@ run: |
5656
# Verify UV installation
5757
command -v uv || (echo "UV not found in PATH" && exit 1)
5858
59+
# Alias to use system Python for all uv pip commands
60+
shopt -s expand_aliases 2>/dev/null || true
61+
alias uvpip="uv pip --system"
62+
5963
whereis nvidia
6064
nvidia-smi
6165
python --version
6266
uv --version
63-
uv pip install --system fire wget packaging
64-
uv pip list --system
67+
uvpip install fire wget packaging
68+
uvpip list
6569
set -ex
6670
6771
CUDA_VERSION="${image##*cuda}" # Remove everything up to and including "cuda"
@@ -72,30 +76,29 @@ run: |
7276
echo "Torch URL: ${TORCH_URL}"
7377
COVERAGE_SOURCE=$(python -c 'n = "$(PACKAGE_NAME)" ; print(dict(fabric="lightning_fabric").get(n, n))')
7478
echo "collecting coverage for: ${COVERAGE_SOURCE}"
75-
TORCH_VER=$(python -c "import torch; print(torch.__version__.rsplit('.', 1)[0])")
7679
7780
if [ "${python_version}" == "3.10" ]; then
7881
echo "Set oldest versions"
79-
uv pip uninstall --system -y deepspeed
80-
uv pip install --system --upgrade "lightning-utilities[cli]"
82+
uvpip uninstall -y deepspeed
83+
uvpip install --upgrade "lightning-utilities[cli]"
8184
cd requirements/fabric
8285
python -m lightning_utilities.cli requirements set-oldest --req_files "['base.txt', 'strategies.txt']"
8386
python -m lightning_utilities.cli requirements prune-pkgs --packages deepspeed --req_files strategies.txt
8487
cd ../..
85-
uv pip install --system "cython<3.0" wheel # for compatibility
88+
uvpip install "cython<3.0" wheel # for compatibility
8689
fi
8790
8891
echo "Adjust torch versions in requirements files"
8992
PYTORCH_VERSION=$(python -c "import torch; print(torch.__version__.split('+')[0])")
90-
uv pip install --system wget packaging
93+
uvpip install wget packaging
9194
python -m wget https://raw.githubusercontent.com/Lightning-AI/utilities/main/scripts/adjust-torch-versions.py
9295
for fpath in `ls requirements/**/*.txt`; do \
9396
python ./adjust-torch-versions.py $fpath ${PYTORCH_VERSION}; \
9497
done
9598
9699
if [ "${PACKAGE_NAME}" == "fabric" ]; then
97100
echo "Replaced PL imports"
98-
uv pip install --system --upgrade -r .actions/requirements.txt
101+
uvpip install --upgrade -r .actions/requirements.txt
99102
python .actions/assistant.py copy_replace_imports --source_dir="./tests/tests_fabric" \
100103
--source_import="lightning.fabric" \
101104
--target_import="lightning_fabric"
@@ -105,7 +108,7 @@ run: |
105108
fi
106109
107110
extra=$(python -c "print({'lightning': 'fabric-'}.get('$(PACKAGE_NAME)', ''))")
108-
uv pip install --system -e ".[${extra}dev]" --upgrade --find-links="${TORCH_URL}"
111+
uvpip install -e ".[${extra}dev]" --upgrade --find-links="${TORCH_URL}"
109112
110113
python requirements/collect_env_details.py
111114
python -c "import torch ; mgpu = torch.cuda.device_count() ; assert mgpu >= 2, f'GPU: {mgpu}'"

0 commit comments

Comments
 (0)