Skip to content

Commit fc652a9

Browse files
committed
Default validation
by default don't compute validation loss, and do not construct a validation loader, no sanity checking of it. validation loss is mostly unused, clutters output, and reduces efficiency.
1 parent 886925d commit fc652a9

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

train.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,16 @@ def make_data_loaders(
7575
batch_size=None,
7676
batch_sampler=None,
7777
)
78-
val = DataLoader(
79-
data_loader.FixedNumBatchesDataset(
80-
val_infinite, (val_size + batch_size - 1) // batch_size
81-
),
82-
batch_size=None,
83-
batch_sampler=None,
78+
val = (
79+
None
80+
if val_size == 0
81+
else DataLoader(
82+
data_loader.FixedNumBatchesDataset(
83+
val_infinite, (val_size + batch_size - 1) // batch_size
84+
),
85+
batch_size=None,
86+
batch_sampler=None,
87+
)
8488
)
8589
return train, val
8690

@@ -308,7 +312,7 @@ def main():
308312
parser.add_argument(
309313
"--validation-size",
310314
type=int,
311-
default=1000000,
315+
default=0,
312316
dest="validation_size",
313317
help="Number of positions per validation step.",
314318
)
@@ -506,6 +510,7 @@ def main():
506510
enable_progress_bar=True,
507511
enable_checkpointing=True,
508512
benchmark=True,
513+
num_sanity_val_steps=0,
509514
)
510515

511516
nnue = torch.compile(nnue, backend=args.compile_backend)

0 commit comments

Comments
 (0)