-
Notifications
You must be signed in to change notification settings - Fork 12
/
large.yaml
430 lines (404 loc) · 14.2 KB
/
large.yaml
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
# @package _global_
constants:
seed: 42
raise_train_error: true # Whether the code should raise an error if it crashes during training
entity: multitask-gnn
datacache_path: "/localdata/neurips2023-large/"
accelerator:
type: ipu # cpu or ipu or gpu
config_override:
datamodule:
args:
ipu_dataloader_training_opts:
mode: async
max_num_nodes_per_graph: 30 # train max nodes: 20, max_edges: 54
max_num_edges_per_graph: 100
ipu_dataloader_inference_opts:
mode: async
max_num_nodes_per_graph: 35 # valid max nodes: 51, max_edges: 118
max_num_edges_per_graph: 100
# Data handling-related
batch_size_training: 30
batch_size_inference: 30
predictor:
metrics_every_n_train_steps: 1000
optim_kwargs:
loss_scaling: 1024
trainer:
trainer:
precision: 16-true
accumulate_grad_batches: 2
ipu_config:
- deviceIterations(30) # IPU would require large batches to be ready for the model.
- replicationFactor(16)
# - enableProfiling("graph_analyser") # The folder where the profile will be stored
# - enableExecutableCaching("pop_compiler_cache")
- TensorLocations.numIOTiles(128)
- _Popart.set("defaultBufferingDepth", 96)
- Precision.enableStochasticRounding(True)
# - Precision.enableFloatingPointExceptions(True)
ipu_inference_config:
# set device iteration and replication factor to 1 during inference
# gradient accumulation was set to 1 in the code
- deviceIterations(1)
- replicationFactor(1)
- Precision.enableStochasticRounding(False)
# accelerator:
# type: cpu # cpu or ipu or gpu
# config_override:
# datamodule:
# args:
# batch_size_training: 64
# batch_size_inference: 256
# trainer:
# trainer:
# precision: 32
# accumulate_grad_batches: 1
datamodule:
module_type: "MultitaskFromSmilesDataModule"
# module_type: "FakeDataModule" # Option to use generated data
args: # Matches that in the test_multitask_datamodule.py case.
task_specific_args: # To be replaced by a new class "DatasetParams"
l1000_vcap:
df: null
df_path: graphium/data/neurips2023/large-dataset/LINCS_L1000_VCAP_0-2_th2.csv.gz
# wget https://storage.googleapis.com/graphium-public/datasets/neurips_2023/Large-dataset/LINCS_L1000_VCAP_0-4.csv.gz
# or set path as the URL directly
smiles_col: "SMILES"
label_cols: geneID-* # geneID-* means all columns starting with "geneID-"
# sample_size: 2000 # use sample_size for test
task_level: graph
splits_path: graphium/data/neurips2023/large-dataset/l1000_vcap_random_splits.pt # Download with `wget https://storage.googleapis.com/graphium-public/datasets/neurips_2023/Large-dataset/l1000_vcap_random_splits.pt`
epoch_sampling_fraction: 1.0
l1000_mcf7:
df: null
df_path: graphium/data/neurips2023/large-dataset/LINCS_L1000_MCF7_0-2_th2.csv.gz
# wget https://storage.googleapis.com/graphium-public/datasets/neurips_2023/Large-dataset/LINCS_L1000_MCF7_0-4.csv.gz
# or set path as the URL directly
smiles_col: "SMILES"
label_cols: geneID-* # geneID-* means all columns starting with "geneID-"
# sample_size: 2000 # use sample_size for test
task_level: graph
splits_path: graphium/data/neurips2023/large-dataset/l1000_mcf7_random_splits.pt # Download with `wget https://storage.googleapis.com/graphium-public/datasets/neurips_2023/Large-dataset/l1000_mcf7_random_splits.pt`
epoch_sampling_fraction: 1.0
pcba_1328:
df: null
df_path: graphium/data/neurips2023/large-dataset/PCBA_1328_1564k.parquet
# wget https://storage.googleapis.com/graphium-public/datasets/neurips_2023/Large-dataset/PCBA_1328_1564k.parquet
# or set path as the URL directly
smiles_col: "SMILES"
label_cols: assayID-* # assayID-* means all columns starting with "assayID-"
# sample_size: 2000 # use sample_size for test
task_level: graph
splits_path: graphium/data/neurips2023/large-dataset/pcba_1328_random_splits.pt # Download with `wget https://storage.googleapis.com/graphium-public/datasets/neurips_2023/Large-dataset/pcba_1328_random_splits.pt`
epoch_sampling_fraction: 1.0
pcqm4m_g25:
df: null
df_path: graphium/data/neurips2023/large-dataset/PCQM4M_G25_N4.parquet
# wget https://storage.googleapis.com/graphium-public/datasets/neurips_2023/Large-dataset/PCQM4M_G25_N4.parquet
# or set path as the URL directly
smiles_col: "ordered_smiles"
label_cols: graph_* # graph_* means all columns starting with "graph_"
# sample_size: 2000 # use sample_size for test
task_level: graph
splits_path: graphium/data/neurips2023/large-dataset/pcqm4m_g25_n4_random_splits.pt # Download with `wget https://storage.googleapis.com/graphium-public/datasets/neurips_2023/Large-dataset/pcqm4m_g25_n4_random_splits.pt`
label_normalization:
normalize_val_test: True
method: "normal"
epoch_sampling_fraction: 1.0
pcqm4m_n4:
df: null
df_path: graphium/data/neurips2023/large-dataset/PCQM4M_G25_N4.parquet
# wget https://storage.googleapis.com/graphium-public/datasets/neurips_2023/Large-dataset/PCQM4M_G25_N4.parquet
# or set path as the URL directly
smiles_col: "ordered_smiles"
label_cols: node_* # node_* means all columns starting with "node_"
# sample_size: 2000 # use sample_size for test
task_level: node
splits_path: graphium/data/neurips2023/large-dataset/pcqm4m_g25_n4_random_splits.pt # Download with `wget https://storage.googleapis.com/graphium-public/datasets/neurips_2023/Large-dataset/pcqm4m_g25_n4_random_splits.pt`
seed: 42
label_normalization:
normalize_val_test: True
method: "normal"
epoch_sampling_fraction: 1.0
# Featurization
prepare_dict_or_graph: pyg:graph
featurization_n_jobs: 30
featurization_progress: True
featurization_backend: "loky"
dataloading_from: disk
processed_graph_data_path: ${constants.datacache_path}
featurization:
# OGB: ['atomic_num', 'degree', 'possible_formal_charge', 'possible_numH' (total-valence),
# 'possible_number_radical_e', 'possible_is_aromatic', 'possible_is_in_ring',
# 'num_chiral_centers (not included yet)']
atom_property_list_onehot: [atomic-number, group, period, total-valence]
atom_property_list_float: [degree, formal-charge, radical-electron, aromatic, in-ring]
# OGB: ['possible_bond_type', 'possible_bond_stereo', 'possible_is_in_ring']
edge_property_list: [bond-type-onehot, stereo, in-ring]
add_self_loop: False
explicit_H: False # if H is included
use_bonds_weights: False
pos_encoding_as_features: # encoder dropout 0.18
pos_types:
lap_eigvec:
pos_level: node
pos_type: laplacian_eigvec
num_pos: 8
normalization: "none" # nomrlization already applied on the eigen vectors
disconnected_comp: True # if eigen values/vector for disconnected graph are included
lap_eigval:
pos_level: node
pos_type: laplacian_eigval
num_pos: 8
normalization: "none" # nomrlization already applied on the eigen vectors
disconnected_comp: True # if eigen values/vector for disconnected graph are included
rw_pos: # use same name as pe_encoder
pos_level: node
pos_type: rw_return_probs
ksteps: 16
num_workers: 32 # -1 to use all
persistent_workers: True # if use persistent worker at the start of each epoch.
# Using persistent_workers false might make the start of each epoch very long.
architecture:
model_type: FullGraphMultiTaskNetwork
mup_base_path: null
pre_nn: # Set as null to avoid a pre-nn network
out_dim: 64
hidden_dims: 256
depth: 2
activation: relu
last_activation: none
dropout: &dropout 0.1
normalization: &normalization layer_norm
last_normalization: *normalization
residual_type: none
pre_nn_edges: null
pe_encoders:
out_dim: 32
pool: "sum" #"mean" "max"
last_norm: None #"batch_norm", "layer_norm"
encoders: #la_pos | rw_pos
la_pos: # Set as null to avoid a pre-nn network
encoder_type: "laplacian_pe"
input_keys: ["laplacian_eigvec", "laplacian_eigval"]
output_keys: ["feat"]
hidden_dim: 64
out_dim: 32
model_type: 'DeepSet' #'Transformer' or 'DeepSet'
num_layers: 2
num_layers_post: 1 # Num. layers to apply after pooling
dropout: 0.1
first_normalization: "none" #"batch_norm" or "layer_norm"
rw_pos:
encoder_type: "mlp"
input_keys: ["rw_return_probs"]
output_keys: ["feat"]
hidden_dim: 64
out_dim: 32
num_layers: 2
dropout: 0.1
normalization: "layer_norm" #"batch_norm" or "layer_norm"
first_normalization: "layer_norm" #"batch_norm" or "layer_norm"
gnn: # Set as null to avoid a post-nn network
in_dim: 64 # or otherwise the correct value
out_dim: &gnn_dim 768
hidden_dims: *gnn_dim
depth: 4
activation: gelu
last_activation: none
dropout: 0.1
normalization: "layer_norm"
last_normalization: *normalization
residual_type: simple
virtual_node: 'none'
graph_output_nn:
graph:
pooling: [sum]
out_dim: *gnn_dim
hidden_dims: *gnn_dim
depth: 1
activation: relu
last_activation: none
dropout: *dropout
normalization: *normalization
last_normalization: "none"
residual_type: none
node:
pooling: [sum]
out_dim: *gnn_dim
hidden_dims: *gnn_dim
depth: 1
activation: relu
last_activation: none
dropout: *dropout
normalization: *normalization
last_normalization: "none"
residual_type: none
task_heads:
l1000_vcap:
task_level: graph
out_dim: 2934
hidden_dims: 128
depth: 2
activation: none
last_activation: none
dropout: *dropout
normalization: *normalization
last_normalization: "none"
residual_type: none
l1000_mcf7:
task_level: graph
out_dim: 2934
hidden_dims: 128
depth: 2
activation: none
last_activation: none
dropout: *dropout
normalization: *normalization
last_normalization: "none"
residual_type: none
pcba_1328:
task_level: graph
out_dim: 1328
hidden_dims: 64
depth: 2
activation: relu
last_activation: none
dropout: *dropout
normalization: *normalization
last_normalization: "none"
residual_type: none
pcqm4m_g25:
task_level: graph
out_dim: 25
hidden_dims: 32
depth: 2
activation: relu
last_activation: none
dropout: *dropout
normalization: *normalization
last_normalization: "none"
residual_type: none
pcqm4m_n4:
task_level: node
out_dim: 4
hidden_dims: 32
depth: 2
activation: relu
last_activation: none
dropout: *dropout
normalization: *normalization
last_normalization: "none"
residual_type: none
#Task-specific
predictor:
metrics_on_progress_bar:
l1000_vcap: []
l1000_mcf7: []
pcba_1328: []
pcqm4m_g25: []
pcqm4m_n4: []
metrics_on_training_set:
l1000_vcap: []
l1000_mcf7: []
pcba_1328: []
pcqm4m_g25: []
pcqm4m_n4: []
loss_fun:
l1000_vcap:
name: hybrid_ce_ipu
n_brackets: 3
alpha: 0.5
l1000_mcf7:
name: hybrid_ce_ipu
n_brackets: 3
alpha: ${predictor.loss_fun.l1000_vcap.alpha}
pcba_1328: bce_logits_ipu
pcqm4m_g25: mae_ipu
pcqm4m_n4: mae_ipu
random_seed: ${constants.seed}
optim_kwargs:
lr: 1.e-4 # warmup can be scheduled using torch_scheduler_kwargs
# weight_decay: 1.e-7
torch_scheduler_kwargs:
module_type: WarmUpLinearLR
max_num_epochs: &max_epochs 100
warmup_epochs: 10
verbose: False
scheduler_kwargs:
# monitor: &monitor qm9/mae/train
# mode: min
# frequency: 1
target_nan_mask: null # null: no mask, 0: 0 mask, ignore-flatten, ignore-mean-per-label
multitask_handling: flatten # flatten, mean-per-label
# Task-specific
metrics:
l1000_vcap: &classif_metrics
- name: auroc
metric: auroc
num_classes: 3
task: multiclass
target_to_int: True
target_nan_mask: -1000
ignore_index: -1000
multitask_handling: mean-per-label
threshold_kwargs: null
- name: avpr
metric: averageprecision
num_classes: 3
task: multiclass
target_to_int: True
target_nan_mask: -1000
ignore_index: -1000
multitask_handling: mean-per-label
threshold_kwargs: null
l1000_mcf7: *classif_metrics
pcba_1328:
# use auroc and averageprecision (non_ipu version) so tha nans are handled correctly
- name: auroc
metric: auroc
task: binary
multitask_handling: mean-per-label
target_nan_mask: ignore
threshold_kwargs: null
- name: avpr
metric: averageprecision
task: binary
multitask_handling: mean-per-label
target_nan_mask: ignore
threshold_kwargs: null
pcqm4m_g25: &pcqm_metrics
- name: mae
metric: mae_ipu
target_nan_mask: null
multitask_handling: mean-per-label
threshold_kwargs: null
- name: pearsonr
metric: pearsonr_ipu
threshold_kwargs: null
target_nan_mask: null
multitask_handling: mean-per-label
- name: r2
metric: r2_score_ipu
threshold_kwargs: null
target_nan_mask: null
multitask_handling: mean-per-label
pcqm4m_n4: *pcqm_metrics
trainer:
seed: ${constants.seed}
logger:
save_dir: logs/neurips2023-large/
name: ${constants.name}
project: ${constants.name}
model_checkpoint:
dirpath: models_checkpoints/${constants.name}/
filename: ${constants.name}
# monitor: *monitor
# mode: *mode
# save_top_k: 1
save_last: True
trainer:
max_epochs: ${predictor.torch_scheduler_kwargs.max_num_epochs}
min_epochs: 1
check_val_every_n_epoch: 20