-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmeasure_floating_point_accuracy.py
More file actions
38 lines (23 loc) · 1.03 KB
/
measure_floating_point_accuracy.py
File metadata and controls
38 lines (23 loc) · 1.03 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
"""Verify a given checkpoint."""
import torch
import hydra
import time
import logging
import fullbatch
import os
os.environ["HYDRA_FULL_ERROR"] = "1"
log = logging.getLogger(__name__)
@hydra.main(config_path="config", config_name="cfg", version_base="1.1")
def main_launcher(cfg):
fullbatch.utils.job_startup(main_process, cfg, log, "floating-point evaluation")
def main_process(process_idx, local_group_size, cfg):
local_time = time.time()
setup = fullbatch.utils.system_startup(process_idx, local_group_size, cfg)
trainloader, validloader = fullbatch.data.construct_dataloader(cfg.data, cfg.impl, cfg.hyp, cfg.dryrun)
model = fullbatch.models.construct_model(cfg.model, cfg.data.channels, cfg.data.classes)
model = fullbatch.models.prepare_model(model, cfg, process_idx, setup)
fullbatch.training.training._measure_implementation_noise(model, trainloader, validloader, setup, cfg)
if cfg.impl.setup.dist:
torch.distributed.destroy_process_group()
if __name__ == "__main__":
main_launcher()