Skip to content

Commit a9a7cce

Browse files
asumitamazonJoseJuan98
authored andcommitted
fix: Fixing the logic to return instanceCount for heterogeneousClusters (aws#3363)
We recently started supporting feature for heterogeneousClusters and missed this part where we return instanceCount from ResourceConfig -> InstanceType For heterogeneousCluster jobs the total instanceCount is sum total of the instanceCount of all the instance groups. Fixing the same.
1 parent cec0874 commit a9a7cce

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/sagemaker/session.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4987,7 +4987,12 @@ def _rule_statuses_changed(current_statuses, last_statuses):
49874987
def _logs_init(sagemaker_session, description, job):
49884988
"""Placeholder docstring"""
49894989
if job == "Training":
4990-
instance_count = description["ResourceConfig"]["InstanceCount"]
4990+
if description["ResourceConfig"]["InstanceCount"] is not None:
4991+
instance_count = description["ResourceConfig"]["InstanceCount"]
4992+
else:
4993+
instance_count = 0
4994+
for instanceGroup in description["ResourceConfig"]["InstanceGroups"]:
4995+
instance_count += instanceGroup["InstanceCount"]
49914996
elif job == "Transform":
49924997
instance_count = description["TransformResources"]["InstanceCount"]
49934998
elif job == "Processing":

0 commit comments

Comments
 (0)