MCPcopy
hub / github.com/horovod/horovod / log_state

Function log_state

test/integration/data/elastic_tensorflow2_main.py:85–96  ·  view source on GitHub ↗
(state)

Source from the content-addressed store, hash-verified

83
84
85def log_state(state):
86 state_dict = {
87 'epoch': state.epoch,
88 'batch': state.batch,
89 'commits': state.commits,
90 'hostname': hostname,
91 'start_rank': start_rank,
92 'rank': hvd.rank(),
93 'size': hvd.size(),
94 'rendezvous': state.rendezvous}
95 with open(args.logfile, 'a') as f:
96 f.write(json.dumps(state_dict) + os.linesep)
97
98
99@tf.function

Callers 1

trainFunction · 0.70

Calls 3

rankMethod · 0.45
sizeMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…