Skip to content

Commit 00d310e

Browse files
rohithn1bhupendrasingh
authored andcommitted
fix: Allow distributions that don't have torch_distributed explicitly stated.
1 parent 4dd0abb commit 00d310e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/sagemaker/estimator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3849,7 +3849,9 @@ def _distribution_configuration(self, distribution):
38493849
if get_mp_parameters(distribution):
38503850
distribution_config["mp_parameters"] = get_mp_parameters(distribution)
38513851
# first make sure torch_distributed is enabled if instance type is p5
3852-
torch_distributed_enabled = distribution.get("torch_distributed").get("enabled", False)
3852+
torch_distributed_enabled = False
3853+
if "torch_distributed" in distribution:
3854+
torch_distributed_enabled = distribution.get("torch_distributed").get("enabled", False)
38533855
smdistributed = distribution["smdistributed"]
38543856
smdataparallel_enabled = smdistributed.get("dataparallel", {}).get("enabled", False)
38553857
p5_enabled = "p5.48xlarge" in self.instance_type

0 commit comments

Comments
 (0)