-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathexample_config.yaml
More file actions
151 lines (136 loc) · 5.92 KB
/
example_config.yaml
File metadata and controls
151 lines (136 loc) · 5.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# Experiment configuration file.
#
# There are two special blocks. The 'seml' block is required for every experiment.
# It has to contain the following values:
# executable: Name of the Python script containing the experiment. The path should be relative to the `project_root_dir`.
# For backward compatibility SEML also supports paths relative to the location of the config file.
# In case there are files present both relative to the project root and the config file,
# the former takes precedence.
# It can optionally also contain the following values:
# name: Prefix for output file and Slurm job name. Default: Collection name
# output_dir: Directory to store log files in. Default: Current directory
# conda_environment: Specifies which Anaconda virtual environment will be activated before the experiment is executed.
# Default: The environment used when queuing.
# project_root_dir: (Relative or absolute) path to the root of the project. seml will then upload all the source
# files imported by the experiment to the MongoDB. Moreover, the uploaded source files will be
# downloaded before starting an experiment, so any changes to the source files in the project
# between queueing and starting the experiment will have no effect.
#
# The special 'slurm' block contains the slurm parameters. This block and all values are optional. Possible values are:
# experiments_per_job: Number of parallel experiments to run in each Slurm job.
# Note that only experiments from the same batch share a job. Default: 1
# max_simultaneous_jobs: Maximum number of simultaneously running Slurm jobs per job array. Default: No restriction
# sbatch_options_template: Name of a custom template of `SBATCH` options. Define your own templates in `settings.py`
# under `SBATCH_OPTIONS_TEMPLATES`, e.g. for long-running jobs, CPU-only jobs, etc.
# sbatch_options: dictionary that contains custom values that will be passed to `sbatch`, specifying e.g.
# the memory and number of GPUs to be allocated (prepended dashes are not required). See
# https://slurm.schedmd.com/sbatch.html for all possible options.
#
# Parameters under 'fixed' will be used for all the experiments.
#
# Under 'grid' you can define parameters that should be sampled from a regular grid. Options are:
# - choice: List the different values you want to evaluate under 'choices' as in the example below.
# - range: Specify the min, max, and step. Parameter values will be generated using np.arange(min, max, step).
# - uniform: Specify the min, max, and num. Parameter values will be generated using
# np.linspace(min, max, num, endpoint=True)
# - loguniform: Specify min, max, and num. Parameter values will be uniformly generated in log space (base 10).
#
# Under 'random' you can specify parameters for which you want to try several random values. Specify the number
# of samples per parameter with the 'samples' value as in the examples below.
# Specify the the seed under the 'random' dict or directly for the desired parameter(s).
# Supported parameter types are:
# - choice: Randomly samples <samples> entries (with replacement) from the list in parameter['options']
# - uniform: Uniformly samples between 'min' and 'max' as specified in the parameter dict.
# - loguniform: Uniformly samples in log space between 'min' and 'max' as specified in the parameter dict.
# - randint: Randomly samples integers between 'min' (included) and 'max' (excluded).
#
# The configuration file can be nested (as the example below) so that we can run different parameter sets
# e.g. for different datasets or models.
# We take the cartesian product of all `grid` parameters on a path and sample all random parameters on the path.
# The number of random parameters sampled will be max{n_samples} of all n_samples on the path. This is done because
# we need the same number of samples from all random parameters in a configuration.
#
# More specific settings (i.e., further down the hierarchy) always overwrite more general ones.
seml:
executable: examples/example_experiment.py
name: example_experiment
output_dir: examples/logs
project_root_dir: ..
description: An example configuration.
slurm:
- experiments_per_job: 1
sbatch_options:
gres: gpu:0
mem: 1G
cpus-per-task: 1
time: 0-08:00
partition: cpu_all,cpu_large
- experiments_per_job: 4
sbatch_options:
gres: gpu:1 # num GPUs
mem: 1G # memory
cpus-per-task: 1 # num cores
time: 0-08:00 # max time, D-HH:MM
partition: gpu_gtx1080
- experiments_per_job: 16
sbatch_options:
gres: gpu:1 # num GPUs
mem: 1G # memory
cpus-per-task: 1 # num cores
time: 0-08:00 # max time, D-HH:MM
partition: gpu_a100
###### BEGIN PARAMETER CONFIGURATION ######
fixed:
max_epochs: 500
grid:
learning_rate:
type: loguniform
min: 1e-5
max: 1e-1
num: 1
random:
samples: 1
seed: 821
# SEML supports dot-notation for nested dictionaries.
regularization_params.dropout:
type: uniform
min: 0.0
max: 0.7
seed: 222
small_datasets:
grid:
dataset:
type: choice
options:
- small_dataset_1
- small_dataset_2
hidden_sizes:
type: choice
options:
- [16]
- [32, 16] # this will be parsed into a Python list.
random:
samples: 3
seed: 2223
max_epochs:
type: randint
min: 200
max: 1000
large_datasets:
fixed:
max_epochs: 1000
grid:
learning_rate:
type: choice
options:
- 0.001
dataset:
type: choice
options:
- large_dataset_1
- large_dataset_2
hidden_sizes:
type: choice
options:
- [64]
- [64, 32]