Skip to content

Commit

Permalink
NameError: name 'mpu' is not defined (microsoft#305)
Browse files Browse the repository at this point in the history
mpu object is bound to the class instance.. 

the if statement uses  `self.mpu'  but just `mpu` is called in the following lines.. 

This raises a NameError
  • Loading branch information
MannyKayy authored Aug 1, 2020
1 parent e50b883 commit 9d07d75
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deepspeed/pt/deepspeed_light.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,8 +650,8 @@ def deepspeed_io(self,
data_parallel_world_size = None
data_parallel_rank = None
if self.mpu is not None:
data_parallel_world_size = mpu.get_data_parallel_world_size()
data_parallel_rank = mpu.get_data_parallel_rank()
data_parallel_world_size = self.mpu.get_data_parallel_world_size()
data_parallel_rank = self.mpu.get_data_parallel_rank()

return DeepSpeedDataLoader(dataset=dataset,
batch_size=batch_size,
Expand Down

0 comments on commit 9d07d75

Please sign in to comment.