Skip to content
This repository was archived by the owner on Nov 3, 2023. It is now read-only.

Commit d5dda3b

Browse files
authored
Make _GPUAccelerator.get_parallel_devices fit GPUAccelerator API (#240)
The PTL Accelerator API is expected to return a List, and not None. This PR updates our _GPUAccelerator abstraction to fit this API. Signed-off-by: amogkam <[email protected]>
1 parent 1059558 commit d5dda3b

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
run: |
1717
python -m pip install --upgrade pip
1818
python -m pip install codecov
19-
python -m pip install -U yapf==0.23.0 flake8==3.9.1 flake8-comprehensions flake8-quotes
19+
python -m pip install -U -r requirements-lint.txt
2020
- name: Run format script
2121
run: |
2222
./format.sh --all

ray_lightning/accelerators/delayed_gpu_accelerator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def get_parallel_devices(devices: List[int]) -> List[torch.device]:
4242
if devices:
4343
return [torch.device("cuda", i) for i in devices]
4444
else:
45-
return None
45+
return []
4646

4747
@staticmethod
4848
def is_available() -> bool:

requirements-lint.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
flake8==3.9.1
2+
flake8-comprehensions
3+
flake8-quotes
4+
importlib_metadata==4.13.0
5+
yapf==0.23.0

requirements-test.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
fairscale
2-
flake8==3.9.1
3-
flake8-comprehensions
4-
flake8-quotes
5-
yapf==0.23.0
62
pytest
73
pytorch-lightning==1.6.4
84
lightning-bolts==0.3.3
95
ray[tune]
106
torch==1.12.0
11-
torchmetrics
7+
torchmetrics==0.9.3
128
torchvision
139
protobuf<=3.20.1
1410
jsonargparse>=4.13.2

0 commit comments

Comments
 (0)