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 diff --git a/.azure/gpu-benchmarks.yml b/.azure/gpu-benchmarks.yml index b77dbfc4f792a..d01594ea83bdb 100644 --- a/.azure/gpu-benchmarks.yml +++ b/.azure/gpu-benchmarks.yml @@ -76,8 +76,13 @@ jobs: displayName: "Image info & NVIDIA" - bash: | - pip install -e .[dev] --find-links ${TORCH_URL} - pip install setuptools==75.6.0 jsonargparse==4.35.0 + 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" + displayName: "Adjust tests" + + - bash: pip install -e .[dev] --find-links ${TORCH_URL} env: FREEZE_REQUIREMENTS: "1" displayName: "Install package" @@ -88,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 583451fa0cdfa..5fc2b5a27cd92 100644 --- a/.azure/gpu-tests-fabric.yml +++ b/.azure/gpu-tests-fabric.yml @@ -109,11 +109,22 @@ jobs: done displayName: "Adjust dependencies" + - bash: | + 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" + 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)', ''))") - 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: | @@ -130,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 eb76cd49e3f94..f899b01091668 100644 --- a/.azure/gpu-tests-pytorch.yml +++ b/.azure/gpu-tests-pytorch.yml @@ -113,10 +113,22 @@ jobs: done 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" + 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)', ''))") - 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 @@ -143,17 +155,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