-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathexample.py
More file actions
38 lines (26 loc) · 939 Bytes
/
example.py
File metadata and controls
38 lines (26 loc) · 939 Bytes
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
from src.predictor import vTrain
from src.config import vTrainConfig
import logging
import argparse
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def main(args):
'''
Usage:
python example.py -c /path/to/config/file
e.g., python example.py -c config/validation/single/config_val_single_0818.json
'''
# Load configuration file
config = vTrainConfig.load_from_file(args.config)
# Initialize vTrain with the configuration file
sim = vTrain(config)
# Run simulation and get the results
result, breakdown = sim()
# Show the predicted single-iteration training time
pred_iter_time = max(result.values())/1000/1000
logger.info(f"predicted iteration time: {pred_iter_time:.3f} ms")
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("-c, --config", type=str, dest="config")
args = parser.parse_args()
main(args)