PVNet 5.3.19__tar.gz → 5.3.20__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pvnet-5.3.19 → pvnet-5.3.20}/PKG-INFO +1 -1
- {pvnet-5.3.19 → pvnet-5.3.20}/PVNet.egg-info/PKG-INFO +1 -1
- {pvnet-5.3.19 → pvnet-5.3.20}/pvnet/utils.py +41 -10
- {pvnet-5.3.19 → pvnet-5.3.20}/LICENSE +0 -0
- {pvnet-5.3.19 → pvnet-5.3.20}/PVNet.egg-info/SOURCES.txt +0 -0
- {pvnet-5.3.19 → pvnet-5.3.20}/PVNet.egg-info/dependency_links.txt +0 -0
- {pvnet-5.3.19 → pvnet-5.3.20}/PVNet.egg-info/requires.txt +0 -0
- {pvnet-5.3.19 → pvnet-5.3.20}/PVNet.egg-info/top_level.txt +0 -0
- {pvnet-5.3.19 → pvnet-5.3.20}/README.md +0 -0
- {pvnet-5.3.19 → pvnet-5.3.20}/pvnet/__init__.py +0 -0
- {pvnet-5.3.19 → pvnet-5.3.20}/pvnet/datamodule.py +0 -0
- {pvnet-5.3.19 → pvnet-5.3.20}/pvnet/load_model.py +0 -0
- {pvnet-5.3.19 → pvnet-5.3.20}/pvnet/models/__init__.py +0 -0
- {pvnet-5.3.19 → pvnet-5.3.20}/pvnet/models/base_model.py +0 -0
- {pvnet-5.3.19 → pvnet-5.3.20}/pvnet/models/ensemble.py +0 -0
- {pvnet-5.3.19 → pvnet-5.3.20}/pvnet/models/late_fusion/__init__.py +0 -0
- {pvnet-5.3.19 → pvnet-5.3.20}/pvnet/models/late_fusion/basic_blocks.py +0 -0
- {pvnet-5.3.19 → pvnet-5.3.20}/pvnet/models/late_fusion/encoders/__init__.py +0 -0
- {pvnet-5.3.19 → pvnet-5.3.20}/pvnet/models/late_fusion/encoders/basic_blocks.py +0 -0
- {pvnet-5.3.19 → pvnet-5.3.20}/pvnet/models/late_fusion/encoders/encoders3d.py +0 -0
- {pvnet-5.3.19 → pvnet-5.3.20}/pvnet/models/late_fusion/late_fusion.py +0 -0
- {pvnet-5.3.19 → pvnet-5.3.20}/pvnet/models/late_fusion/linear_networks/__init__.py +0 -0
- {pvnet-5.3.19 → pvnet-5.3.20}/pvnet/models/late_fusion/linear_networks/basic_blocks.py +0 -0
- {pvnet-5.3.19 → pvnet-5.3.20}/pvnet/models/late_fusion/linear_networks/networks.py +0 -0
- {pvnet-5.3.19 → pvnet-5.3.20}/pvnet/models/late_fusion/site_encoders/__init__.py +0 -0
- {pvnet-5.3.19 → pvnet-5.3.20}/pvnet/models/late_fusion/site_encoders/basic_blocks.py +0 -0
- {pvnet-5.3.19 → pvnet-5.3.20}/pvnet/models/late_fusion/site_encoders/encoders.py +0 -0
- {pvnet-5.3.19 → pvnet-5.3.20}/pvnet/optimizers.py +0 -0
- {pvnet-5.3.19 → pvnet-5.3.20}/pvnet/training/__init__.py +0 -0
- {pvnet-5.3.19 → pvnet-5.3.20}/pvnet/training/lightning_module.py +0 -0
- {pvnet-5.3.19 → pvnet-5.3.20}/pvnet/training/plots.py +0 -0
- {pvnet-5.3.19 → pvnet-5.3.20}/pvnet/training/train.py +0 -0
- {pvnet-5.3.19 → pvnet-5.3.20}/pyproject.toml +0 -0
- {pvnet-5.3.19 → pvnet-5.3.20}/setup.cfg +0 -0
- {pvnet-5.3.19 → pvnet-5.3.20}/tests/test_datamodule.py +0 -0
- {pvnet-5.3.19 → pvnet-5.3.20}/tests/test_end2end.py +0 -0
|
@@ -5,8 +5,9 @@ from typing import TYPE_CHECKING
|
|
|
5
5
|
|
|
6
6
|
import rich.syntax
|
|
7
7
|
import rich.tree
|
|
8
|
+
import torch
|
|
8
9
|
from lightning.pytorch.utilities import rank_zero_only
|
|
9
|
-
from omegaconf import DictConfig, OmegaConf
|
|
10
|
+
from omegaconf import DictConfig, ListConfig, OmegaConf
|
|
10
11
|
|
|
11
12
|
if TYPE_CHECKING:
|
|
12
13
|
from pvnet.models.base_model import BaseModel
|
|
@@ -167,13 +168,43 @@ def validate_batch_against_config(
|
|
|
167
168
|
|
|
168
169
|
|
|
169
170
|
def validate_gpu_config(config: DictConfig) -> None:
|
|
170
|
-
"""Abort if
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
171
|
+
"""Abort if the config may use multiple GPUs.
|
|
172
|
+
|
|
173
|
+
PVNet does not currently support parallel training. This validation only
|
|
174
|
+
raises when multiple CUDA GPUs are actually available and the trainer config
|
|
175
|
+
could select more than one of them.
|
|
176
|
+
"""
|
|
177
|
+
trainer_config = config.get("trainer", {})
|
|
178
|
+
devices = trainer_config.get("devices")
|
|
179
|
+
accelerator = str(trainer_config.get("accelerator", "auto")).lower()
|
|
180
|
+
|
|
181
|
+
num_available_gpus = torch.cuda.device_count()
|
|
182
|
+
|
|
183
|
+
if num_available_gpus <= 1:
|
|
184
|
+
return
|
|
185
|
+
|
|
186
|
+
if accelerator in {"cpu", "mps", "tpu"}:
|
|
187
|
+
return
|
|
188
|
+
|
|
189
|
+
if devices == "auto":
|
|
190
|
+
msg = (
|
|
191
|
+
f"`devices: 'auto'` may use all {num_available_gpus} available GPUs. "
|
|
192
|
+
"PVNet does not support multi-GPU training. "
|
|
193
|
+
"Use a single explicit device, for example `devices: [0]`."
|
|
194
|
+
)
|
|
195
|
+
elif isinstance(devices, int) and devices > 1:
|
|
196
|
+
msg = (
|
|
197
|
+
f"Detected `devices: {devices}` with {num_available_gpus} GPUs available. "
|
|
198
|
+
"This requests multiple GPUs. PVNet does not support multi-GPU training. "
|
|
199
|
+
"If you meant to select a specific GPU, for example GPU 2, use `devices: [2]`."
|
|
179
200
|
)
|
|
201
|
+
elif isinstance(devices, (list, tuple, ListConfig)) and len(devices) > 1:
|
|
202
|
+
msg = (
|
|
203
|
+
f"Detected `devices: {list(devices)}` with {num_available_gpus} GPUs available. "
|
|
204
|
+
"This requests multiple GPUs. PVNet does not support multi-GPU training. "
|
|
205
|
+
"Use a single explicit device, for example `devices: [0]`."
|
|
206
|
+
)
|
|
207
|
+
else:
|
|
208
|
+
return
|
|
209
|
+
|
|
210
|
+
raise ValueError(msg)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|