Skip to content

Commit

Permalink
Migrate from gpus flag (to be deprecated in PL 1.7) to `accelerator…
Browse files Browse the repository at this point in the history
…` and `devices`
  • Loading branch information
nathanpainchaud committed Aug 30, 2022
1 parent 101c212 commit 92a243b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion vital/config/trainer/default.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
_target_: pytorch_lightning.Trainer
gpus: ${sys.gpus:}
accelerator: "auto"
devices: null
enable_progress_bar: True
1 change: 0 additions & 1 deletion vital/utils/sys.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

def register_omegaconf_resolvers() -> None:
"""Registers various OmegaConf resolvers useful to query system info."""
OmegaConf.register_new_resolver("sys.gpus", lambda x=None: int(torch.cuda.is_available()))
OmegaConf.register_new_resolver("sys.num_workers", lambda x=None: os.cpu_count() - 1)
OmegaConf.register_new_resolver("sys.getcwd", lambda x=None: os.getcwd())
OmegaConf.register_new_resolver("sys.eps.np", lambda dtype: np.finfo(np.dtype(dtype)).eps)
Expand Down

0 comments on commit 92a243b

Please sign in to comment.