diff --git a/.gitignore b/.gitignore index 9bd1899..6846663 100644 --- a/.gitignore +++ b/.gitignore @@ -140,6 +140,7 @@ dmypy.json .idea/ # Lightning-Hydra-Template +configs/local/default.yaml data/ logs/ wandb/ diff --git a/README.md b/README.md index 84e2aaf..4b8d0d5 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,7 @@ The directory structure of new project looks like this: │ ├── datamodule <- Datamodule configs │ ├── experiment <- Experiment configs │ ├── hparams_search <- Hyperparameter search configs +│ ├── local <- Local configs │ ├── logger <- Logger configs │ ├── mode <- Running mode configs │ ├── model <- Model configs @@ -609,6 +610,37 @@ logger:
+### Local Configuration + +Location: [configs/local](configs/local)
+Some configurations are user/machine/installation specific (e.g. configuration of local cluster, or harddrive paths on a specific machine). For such scenarios, a file `configs/local/default.yaml` can be created which is automatically loaded but not tracked by Git. + +
+Local Slurm cluster config example + +```yaml +# @package _global_ + +defaults: + - override /hydra/launcher@_here_: submitit_slurm + +data_dir: /mnt/scratch/data/ + +hydra: + launcher: + timeout_min: 1440 + gpus_per_task: 1 + gres: gpu:1 + job: + env_set: + MY_VAR: /home/user/my/system/path + MY_KEY: asdgjhawi8y23ihsghsueity23ihwd +``` + +
+ +
+ ### Workflow 1. Write your PyTorch Lightning model (see [mnist_model.py](src/models/mnist_model.py) for example) @@ -905,12 +937,12 @@ The `config.yaml` from `.hydra` folder contains all overriden parameters and sec
- - + ### Limitations - Currently, template doesn't support k-fold cross validation, but it's possible to achieve it with Lightning Loop interface. See the [official example](https://github.com/PyTorchLightning/pytorch-lightning/blob/master/pl_examples/loop_examples/kfold.py). Implementing it requires rewriting the training pipeline. diff --git a/configs/config.yaml b/configs/config.yaml index f43095d..5936043 100644 --- a/configs/config.yaml +++ b/configs/config.yaml @@ -14,6 +14,9 @@ defaults: - experiment: null - hparams_search: null + # optional local config + - optional local: default.yaml + # enable color logging - override hydra/hydra_logging: colorlog - override hydra/job_logging: colorlog diff --git a/configs/local/.gitkeep b/configs/local/.gitkeep new file mode 100644 index 0000000..e69de29