Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pytorch_lightning/trainer/distrib_parts.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ def single_gpu_train(self, model):

self.run_pretrain_routine(model)

def tpu_train(self, tpu_core_idx, model):
def tpu_train(self, model):
# put model on tpu
self._device = xm.xla_device(self.tpu_id) if self.tpu_id is not None else xm.xla_device()
model.to(self._device)
Expand Down
2 changes: 1 addition & 1 deletion pytorch_lightning/trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ def fit(

# train
if self.tpu_id is not None:
self.tpu_train(self.tpu_id, model)
self.tpu_train(model)
else:
xmp.spawn(self.tpu_train, args=(model,), nprocs=self.tpu_cores, start_method=start_method)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as you can see in this line, the tpu_train function is passed to this spawn function and it expect the tpu_core_idx.
It's not unused afterall.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dam... we need to get TPU test asap...
cc: @luiscape


Expand Down