File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -3818,6 +3818,7 @@ def _distribution_configuration(self, distribution):
3818
3818
3819
3819
mpi_enabled = False
3820
3820
smdataparallel_enabled = False
3821
+ p5_enabled = False
3821
3822
if "instance_groups" in distribution :
3822
3823
distribution_config ["sagemaker_distribution_instance_groups" ] = distribution [
3823
3824
"instance_groups"
@@ -3862,10 +3863,11 @@ def _distribution_configuration(self, distribution):
3862
3863
elif isinstance (self .instance_type , str ):
3863
3864
p5_enabled = "p5.48xlarge" in self .instance_type
3864
3865
else :
3865
- raise ValueError (
3866
- "Invalid object type for instance_type argument. Expected "
3867
- f"{ type (str )} or { type (ParameterString )} but got { type (self .instance_type )} ."
3868
- )
3866
+ if self .instance_groups is not None :
3867
+ for instance in self .instance_groups :
3868
+ if "p5.48xlarge" in instance ._to_request_dict ()["InstanceType" ]:
3869
+ p5_enabled = True
3870
+
3869
3871
img_uri = "" if self .image_uri is None else self .image_uri
3870
3872
for unsupported_image in Framework .UNSUPPORTED_DLC_IMAGE_FOR_SM_PARALLELISM :
3871
3873
if (
You can’t perform that action at this time.
0 commit comments