Skip to content

Commit

Permalink
Check FSDP module has _device_mesh before getting it (#3091)
Browse files Browse the repository at this point in the history
  • Loading branch information
eracah authored and j316chuck committed Mar 29, 2024
1 parent d05c40d commit 3d4d506
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion composer/core/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ def fsdp_elastic_sharded_enabled(self):
@property
def fsdp_device_mesh(self):
if self.fsdp_enabled:
if not hasattr(self.model, 'model'):
if not hasattr(self.model, 'model') or not hasattr(self.model.model, '_device_mesh'):
return None
return self.model.model._device_mesh
else:
Expand Down

0 comments on commit 3d4d506

Please sign in to comment.