From 1d02869efb501a03d283c5b9845c9942d008c407 Mon Sep 17 00:00:00 2001 From: Jirka B Date: Tue, 24 Jun 2025 15:55:02 +0200 Subject: [PATCH 1/6] ci/gpu: drop duplicate/confusing dep. installations --- .azure/gpu-benchmarks.yml | 4 +--- .azure/gpu-tests-fabric.yml | 3 +-- .azure/gpu-tests-pytorch.yml | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.azure/gpu-benchmarks.yml b/.azure/gpu-benchmarks.yml index b77dbfc4f792a..86e51e333488b 100644 --- a/.azure/gpu-benchmarks.yml +++ b/.azure/gpu-benchmarks.yml @@ -75,9 +75,7 @@ jobs: pip list displayName: "Image info & NVIDIA" - - bash: | - pip install -e .[dev] --find-links ${TORCH_URL} - pip install setuptools==75.6.0 jsonargparse==4.35.0 + - bash: pip install -e .[dev] --find-links ${TORCH_URL} env: FREEZE_REQUIREMENTS: "1" displayName: "Install package" diff --git a/.azure/gpu-tests-fabric.yml b/.azure/gpu-tests-fabric.yml index 583451fa0cdfa..9827d88215a6e 100644 --- a/.azure/gpu-tests-fabric.yml +++ b/.azure/gpu-tests-fabric.yml @@ -112,8 +112,7 @@ jobs: - bash: | set -e extra=$(python -c "print({'lightning': 'fabric-'}.get('$(PACKAGE_NAME)', ''))") - pip install -e ".[${extra}dev]" pytest-timeout -U --extra-index-url="${TORCH_URL}" - pip install setuptools==75.6.0 jsonargparse==4.35.0 + pip install -e ".[${extra}dev]" -U --extra-index-url="${TORCH_URL}" displayName: "Install package & dependencies" - bash: | diff --git a/.azure/gpu-tests-pytorch.yml b/.azure/gpu-tests-pytorch.yml index eb76cd49e3f94..5a66c814de43b 100644 --- a/.azure/gpu-tests-pytorch.yml +++ b/.azure/gpu-tests-pytorch.yml @@ -116,7 +116,7 @@ jobs: - bash: | set -e extra=$(python -c "print({'lightning': 'pytorch-'}.get('$(PACKAGE_NAME)', ''))") - pip install -e ".[${extra}dev]" pytest-timeout -U --extra-index-url="${TORCH_URL}" + pip install -e ".[${extra}dev]" -U --extra-index-url="${TORCH_URL}" displayName: "Install package & dependencies" - bash: pip uninstall -y lightning From 6eb0a2cf5009e1790bfeb316ff4bbeed05d6aa33 Mon Sep 17 00:00:00 2001 From: Jirka B Date: Tue, 24 Jun 2025 17:09:06 +0200 Subject: [PATCH 2/6] req? --- .actions/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.actions/requirements.txt b/.actions/requirements.txt index 44548c1e0a370..0742eeb8dc353 100644 --- a/.actions/requirements.txt +++ b/.actions/requirements.txt @@ -1,3 +1,3 @@ -jsonargparse >=4.16.0, <=4.35.0 +jsonargparse requests packaging From 5c5025495b15e64d19181fe69e1a6c191eaec60a Mon Sep 17 00:00:00 2001 From: Jirka B Date: Tue, 24 Jun 2025 17:19:11 +0200 Subject: [PATCH 3/6] jsonargparse <4.27.0 --- .actions/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.actions/requirements.txt b/.actions/requirements.txt index 0742eeb8dc353..e0a1029fa1a92 100644 --- a/.actions/requirements.txt +++ b/.actions/requirements.txt @@ -1,3 +1,3 @@ -jsonargparse +jsonargparse <4.27.0 requests packaging From 2b33d0179b692b4d668523ffddd5843525089169 Mon Sep 17 00:00:00 2001 From: Jirka B Date: Tue, 24 Jun 2025 17:23:02 +0200 Subject: [PATCH 4/6] swap --- .azure/gpu-benchmarks.yml | 14 +++++++------- .azure/gpu-tests-fabric.yml | 24 ++++++++++++------------ .azure/gpu-tests-pytorch.yml | 22 +++++++++++----------- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/.azure/gpu-benchmarks.yml b/.azure/gpu-benchmarks.yml index 86e51e333488b..364d9d524f501 100644 --- a/.azure/gpu-benchmarks.yml +++ b/.azure/gpu-benchmarks.yml @@ -75,6 +75,13 @@ jobs: pip list displayName: "Image info & NVIDIA" + - bash: | + pip install -q -r .actions/requirements.txt + python .actions/assistant.py copy_replace_imports --source_dir="./tests" \ + --source_import="lightning.fabric,lightning.pytorch" \ + --target_import="lightning_fabric,pytorch_lightning" + displayName: "Adjust tests" + - bash: pip install -e .[dev] --find-links ${TORCH_URL} env: FREEZE_REQUIREMENTS: "1" @@ -86,13 +93,6 @@ jobs: python -c "import torch ; mgpu = torch.cuda.device_count() ; assert mgpu == 2, f'GPU: {mgpu}'" displayName: "Env details" - - bash: | - pip install -q -r .actions/requirements.txt - python .actions/assistant.py copy_replace_imports --source_dir="./tests" \ - --source_import="lightning.fabric,lightning.pytorch" \ - --target_import="lightning_fabric,pytorch_lightning" - displayName: "Adjust tests" - - bash: python -m pytest parity_$(PACKAGE_NAME) -v --durations=0 env: PL_RUNNING_BENCHMARKS: "1" diff --git a/.azure/gpu-tests-fabric.yml b/.azure/gpu-tests-fabric.yml index 9827d88215a6e..c6bdff6ef0a39 100644 --- a/.azure/gpu-tests-fabric.yml +++ b/.azure/gpu-tests-fabric.yml @@ -109,6 +109,18 @@ jobs: done displayName: "Adjust dependencies" + - bash: | + pip install -q -r .actions/requirements.txt + python .actions/assistant.py copy_replace_imports --source_dir="./tests/tests_fabric" \ + --source_import="lightning.fabric" \ + --target_import="lightning_fabric" + python .actions/assistant.py copy_replace_imports --source_dir="./examples/fabric" \ + --source_import="lightning.fabric" \ + --target_import="lightning_fabric" + # without succeeded this could run even if the job has already failed + condition: and(succeeded(), eq(variables['PACKAGE_NAME'], 'fabric')) + displayName: "Adjust tests & examples" + - bash: | set -e extra=$(python -c "print({'lightning': 'fabric-'}.get('$(PACKAGE_NAME)', ''))") @@ -129,18 +141,6 @@ jobs: condition: and(succeeded(), eq(variables['PACKAGE_NAME'], 'fabric')) displayName: "Testing: Fabric doctests" - - bash: | - pip install -q -r .actions/requirements.txt - python .actions/assistant.py copy_replace_imports --source_dir="./tests/tests_fabric" \ - --source_import="lightning.fabric" \ - --target_import="lightning_fabric" - python .actions/assistant.py copy_replace_imports --source_dir="./examples/fabric" \ - --source_import="lightning.fabric" \ - --target_import="lightning_fabric" - # without succeeded this could run even if the job has already failed - condition: and(succeeded(), eq(variables['PACKAGE_NAME'], 'fabric')) - displayName: "Adjust tests & examples" - - bash: python -m coverage run --source ${COVERAGE_SOURCE} -m pytest tests_fabric/ -v --durations=50 workingDirectory: tests/ displayName: "Testing: fabric standard" diff --git a/.azure/gpu-tests-pytorch.yml b/.azure/gpu-tests-pytorch.yml index 5a66c814de43b..047d0c179912c 100644 --- a/.azure/gpu-tests-pytorch.yml +++ b/.azure/gpu-tests-pytorch.yml @@ -113,6 +113,17 @@ jobs: done displayName: "Adjust dependencies" + - bash: | + python .actions/assistant.py copy_replace_imports --source_dir="./tests/tests_pytorch" \ + --source_import="lightning.fabric,lightning.pytorch" \ + --target_import="lightning_fabric,pytorch_lightning" + python .actions/assistant.py copy_replace_imports --source_dir="./examples/pytorch/basics" \ + --source_import="lightning.fabric,lightning.pytorch" \ + --target_import="lightning_fabric,pytorch_lightning" + # without succeeded this could run even if the job has already failed + condition: and(succeeded(), eq(variables['PACKAGE_NAME'], 'pytorch')) + displayName: "Adjust tests & examples" + - bash: | set -e extra=$(python -c "print({'lightning': 'pytorch-'}.get('$(PACKAGE_NAME)', ''))") @@ -143,17 +154,6 @@ jobs: condition: and(succeeded(), eq(variables['PACKAGE_NAME'], 'pytorch')) displayName: "Testing: PyTorch doctests" - - bash: | - python .actions/assistant.py copy_replace_imports --source_dir="./tests/tests_pytorch" \ - --source_import="lightning.fabric,lightning.pytorch" \ - --target_import="lightning_fabric,pytorch_lightning" - python .actions/assistant.py copy_replace_imports --source_dir="./examples/pytorch/basics" \ - --source_import="lightning.fabric,lightning.pytorch" \ - --target_import="lightning_fabric,pytorch_lightning" - # without succeeded this could run even if the job has already failed - condition: and(succeeded(), eq(variables['PACKAGE_NAME'], 'pytorch')) - displayName: "Adjust tests & examples" - - bash: | bash .actions/pull_legacy_checkpoints.sh cd tests/legacy From bb119184421cb732e9771ae3012c750b4761f5a6 Mon Sep 17 00:00:00 2001 From: Jirka B Date: Tue, 24 Jun 2025 17:26:16 +0200 Subject: [PATCH 5/6] jsonargparse >=4.27.0 --- .actions/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.actions/requirements.txt b/.actions/requirements.txt index e0a1029fa1a92..2db0ca9d05f91 100644 --- a/.actions/requirements.txt +++ b/.actions/requirements.txt @@ -1,3 +1,3 @@ -jsonargparse <4.27.0 +jsonargparse >=4.27.0 requests packaging From 31e06303ffaf8b0ff83fd1015c6b582dc25ca37b Mon Sep 17 00:00:00 2001 From: Jirka B Date: Tue, 24 Jun 2025 17:28:54 +0200 Subject: [PATCH 6/6] -U --- .actions/requirements.txt | 2 +- .azure/gpu-benchmarks.yml | 2 +- .azure/gpu-tests-fabric.yml | 2 +- .azure/gpu-tests-pytorch.yml | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.actions/requirements.txt b/.actions/requirements.txt index 2db0ca9d05f91..0742eeb8dc353 100644 --- a/.actions/requirements.txt +++ b/.actions/requirements.txt @@ -1,3 +1,3 @@ -jsonargparse >=4.27.0 +jsonargparse requests packaging diff --git a/.azure/gpu-benchmarks.yml b/.azure/gpu-benchmarks.yml index 364d9d524f501..d01594ea83bdb 100644 --- a/.azure/gpu-benchmarks.yml +++ b/.azure/gpu-benchmarks.yml @@ -76,7 +76,7 @@ jobs: displayName: "Image info & NVIDIA" - bash: | - pip install -q -r .actions/requirements.txt + pip install -U -q -r .actions/requirements.txt python .actions/assistant.py copy_replace_imports --source_dir="./tests" \ --source_import="lightning.fabric,lightning.pytorch" \ --target_import="lightning_fabric,pytorch_lightning" diff --git a/.azure/gpu-tests-fabric.yml b/.azure/gpu-tests-fabric.yml index c6bdff6ef0a39..5fc2b5a27cd92 100644 --- a/.azure/gpu-tests-fabric.yml +++ b/.azure/gpu-tests-fabric.yml @@ -110,7 +110,7 @@ jobs: displayName: "Adjust dependencies" - bash: | - pip install -q -r .actions/requirements.txt + pip install -U -q -r .actions/requirements.txt python .actions/assistant.py copy_replace_imports --source_dir="./tests/tests_fabric" \ --source_import="lightning.fabric" \ --target_import="lightning_fabric" diff --git a/.azure/gpu-tests-pytorch.yml b/.azure/gpu-tests-pytorch.yml index 047d0c179912c..f899b01091668 100644 --- a/.azure/gpu-tests-pytorch.yml +++ b/.azure/gpu-tests-pytorch.yml @@ -114,6 +114,7 @@ jobs: displayName: "Adjust dependencies" - bash: | + pip install -U -q -r .actions/requirements.txt python .actions/assistant.py copy_replace_imports --source_dir="./tests/tests_pytorch" \ --source_import="lightning.fabric,lightning.pytorch" \ --target_import="lightning_fabric,pytorch_lightning"