Skip to content

Commit 1859e85

Browse files
committed
fix bad import in train_cgcnn
from {aviary->matbench_discovery} import ROOT
1 parent 0ea1ff3 commit 1859e85

File tree

5 files changed

+16
-17
lines changed

5 files changed

+16
-17
lines changed

models/bowsr/test_bowsr.py

-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@
106106

107107
slurm_job_id = os.environ.get("SLURM_JOB_ID", "debug")
108108
wandb.init(
109-
entity="janosh",
110109
project="matbench-discovery",
111110
name=f"{job_name}-{slurm_job_id}-{slurm_array_task_id}",
112111
config=run_params,

models/cgcnn/test_cgcnn.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
stores predictions to CSV.
2828
"""
2929

30-
module_dir = os.path.dirname(__file__)
3130
today = f"{datetime.now():%Y-%m-%d}"
31+
log_dir = f"{os.path.dirname(__file__)}/{today}-test"
3232
ensemble_id = "cgcnn-e_form-ensemble-1"
3333
run_name = f"{ensemble_id}-IS2RE"
3434

@@ -37,7 +37,7 @@
3737
partition="ampere",
3838
account="LEE-SL3-GPU",
3939
time="1:0:0",
40-
log_dir=module_dir,
40+
log_dir=log_dir,
4141
slurm_flags=("--nodes", "1", "--gpus-per-node", "1"),
4242
)
4343

@@ -82,7 +82,7 @@
8282
data_loader=data_loader,
8383
)
8484

85-
df.round(6).to_csv(f"{module_dir}/{today}-{run_name}-preds.csv", index=False)
85+
df.round(6).to_csv(f"{log_dir}/{today}-{run_name}-preds.csv", index=False)
8686

8787

8888
# %%

models/cgcnn/train_cgcnn.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from datetime import datetime
44

55
import pandas as pd
6-
from aviary import ROOT
76
from aviary.cgcnn.data import CrystalGraphData, collate_batch
87
from aviary.cgcnn.model import CrystalGraphConvNet
98
from aviary.core import TaskType
@@ -12,10 +11,11 @@
1211
from torch.utils.data import DataLoader
1312
from tqdm import tqdm
1413

14+
from matbench_discovery import ROOT
1515
from matbench_discovery.slurm import slurm_submit
1616

1717
"""
18-
Train a CGCNN ensemble of size n_folds on target_col of data_path.
18+
Train a CGCNN ensemble of size n_ens on target_col of data_path.
1919
"""
2020

2121
__author__ = "Janosh Riebesell"
@@ -28,7 +28,7 @@
2828
run_name = f"cgcnn-robust-{target_col}"
2929
print(f"{run_name=}")
3030
robust = "robust" in run_name.lower()
31-
n_folds = 10
31+
n_ens = 10
3232
timestamp = f"{datetime.now():%Y-%m-%d@%H-%M-%S}"
3333
today = timestamp.split("@")[0]
3434
log_dir = f"{os.path.dirname(__file__)}/{today}-{run_name}"
@@ -38,7 +38,7 @@
3838
partition="ampere",
3939
account="LEE-SL3-GPU",
4040
time="8:0:0",
41-
array=f"1-{n_folds}",
41+
array=f"1-{n_ens}",
4242
log_dir=log_dir,
4343
slurm_flags=("--nodes", "1", "--gpus-per-node", "1"),
4444
)

models/voronoi/voronoi_featurize_dataset.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
today = f"{datetime.now():%Y-%m-%d}"
1717
module_dir = os.path.dirname(__file__)
18-
18+
assert featurizer._n_jobs == 1, "set n_jobs=1 to avoid OOM errors"
1919

2020
data_name = "mp" # "mp"
2121
if data_name == "wbm":
@@ -35,15 +35,14 @@
3535
account="LEE-SL3-CPU",
3636
time=(slurm_max_job_time := "8:0:0"),
3737
array=f"1-{slurm_array_task_count}",
38+
slurm_flags=("--mem", "30G") if data_name == "mp" else (),
3839
log_dir=log_dir,
3940
)
4041

4142

4243
# %%
4344
slurm_array_task_id = int(os.environ.get("SLURM_ARRAY_TASK_ID", 0))
44-
slurm_job_id = os.environ.get("SLURM_JOB_ID", "debug")
45-
run_name = f"{job_name}-{slurm_job_id}-{slurm_array_task_id}"
46-
out_path = f"{log_dir}/{run_name}.csv.bz2"
45+
out_path = f"{log_dir}/{job_name}.csv.bz2"
4746

4847
if os.path.isfile(out_path):
4948
raise SystemExit(f"{out_path = } already exists, exciting early")
@@ -75,9 +74,10 @@
7574
if wandb.run is None:
7675
wandb.login()
7776

77+
slurm_job_id = os.environ.get("SLURM_JOB_ID", "debug")
7878
wandb.init(
7979
project="matbench-discovery",
80-
name=run_name,
80+
name=f"{job_name}-{slurm_job_id}-{slurm_array_task_id}",
8181
config=run_params,
8282
)
8383

models/wrenformer/train_wrenformer.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from matbench_discovery.slurm import slurm_submit
1010

1111
"""
12-
Train a Wrenformer ensemble of size n_folds on target_col of data_path.
12+
Train a Wrenformer ensemble of size n_ens on target_col of data_path.
1313
"""
1414

1515
__author__ = "Janosh Riebesell"
@@ -25,7 +25,7 @@
2525
# target_col = "mp_energy_per_atom"
2626
data_name = "m3gnet-trainset" if "m3gnet" in data_path else "mp"
2727
run_name = f"train-wrenformer-robust-{data_name}-{target_col}"
28-
n_folds = 10
28+
n_ens = 10
2929
timestamp = f"{datetime.now():%Y-%m-%d@%H-%M-%S}"
3030
today = timestamp.split("@")[0]
3131
dataset = "mp"
@@ -36,7 +36,7 @@
3636
partition="ampere",
3737
account="LEE-SL3-GPU",
3838
time="8:0:0",
39-
array=f"1-{n_folds}",
39+
array=f"1-{n_ens}",
4040
log_dir=log_dir,
4141
slurm_flags=("--nodes", "1", "--gpus-per-node", "1"),
4242
)
@@ -73,7 +73,7 @@
7373
target_col=target_col,
7474
task_type="regression",
7575
timestamp=timestamp,
76-
# folds=(n_folds, slurm_array_task_id),
76+
# folds=(n_ens, slurm_array_task_id),
7777
epochs=epochs,
7878
checkpoint="wandb", # None | 'local' | 'wandb',
7979
input_col=input_col,

0 commit comments

Comments
 (0)