Skip to content

Commit

Permalink
Add params["tpus"]
Browse files Browse the repository at this point in the history
  • Loading branch information
vatai committed May 20, 2020
1 parent 4f8a2e1 commit 5b088b2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions benchmarker/modules/do_tensorflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ def get_strategy(self):
strategy = tf.distribute.experimental.TPUStrategy(tpu)
worker_str = tpu.cluster_spec().as_dict()["worker"]
rep = strategy.num_replicas_in_sync
self.params["device"] = "COLAB TPU: {} ".format(worker_str)
self.params["device"] += "num_replicas_in_sync: {}".format(rep)
self.params["device"] = "COLAB TPU"
self.params["tpus"] = {
"worker_srt": worker_str,
"num_replicas_in_sync": rep,
}
elif len(gpus) > 1: # multiple GPUs in one VM
strategy = tf.distribute.MirroredStrategy(gpus)
else: # default strategy that works on CPU and single GPU
Expand Down

0 comments on commit 5b088b2

Please sign in to comment.