(state)
| 92 | |
| 93 | |
| 94 | def log_state(state): |
| 95 | state_dict = { |
| 96 | 'epoch': state.epoch, |
| 97 | 'batch': state.batch, |
| 98 | 'commits': state.commits, |
| 99 | 'hostname': hostname, |
| 100 | 'start_rank': start_rank, |
| 101 | 'rank': hvd.rank(), |
| 102 | 'size': hvd.size(), |
| 103 | 'rendezvous': state.rendezvous} |
| 104 | with open(args.logfile, 'a') as f: |
| 105 | f.write(json.dumps(state_dict) + os.linesep) |
| 106 | |
| 107 | |
| 108 | def on_state_reset(): |
no test coverage detected
searching dependent graphs…