Skip to content

Commit 0d8f539

Browse files
author
Mohamed Zeidan
committed
chore(train): shorten inline comments
1 parent 9b97644 commit 0d8f539

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

‎sagemaker-train/src/sagemaker/train/model_trainer.py‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -594,11 +594,7 @@ def _create_training_job_args(
594594

595595
final_input_data_config = list(existing_channels.values()) + new_channels
596596

597-
# Heterogeneous clusters: SageMaker enforces an all-or-nothing rule -- if any
598-
# channel is assigned to instance groups, every channel must be. The SDK-managed
599-
# channels (recipe/code/sm_drivers) are not user-configurable, so when a user
600-
# assigns instance groups to any of their channels we assign the managed channels
601-
# to the full set of instance groups to satisfy the rule.
597+
# Assign SDK-managed channels to instance groups when the user uses them (see helper).
602598
managed_channel_instance_group_names = self._resolve_managed_channel_instance_groups(
603599
final_input_data_config
604600
)
@@ -927,8 +923,7 @@ def _resolve_managed_channel_instance_groups(
927923
return None
928924

929925
def _channel_has_instance_groups(channel: Union[Channel, InputData]) -> bool:
930-
# A Channel wraps its S3DataSource in a DataSource; an InputData may hold an
931-
# S3DataSource directly on its data_source attribute.
926+
# Channel nests its S3DataSource under data_source; InputData may hold it directly.
932927
s3_data_source = None
933928
if isinstance(channel, Channel):
934929
if channel.data_source:
@@ -976,9 +971,7 @@ def create_input_data_channel(
976971
"""
977972
from sagemaker.core.helper.pipeline_variable import PipelineVariable
978973

979-
# Only pass instance_group_names through when provided so that channels built without
980-
# heterogeneous-cluster assignment keep the field unset (Unassigned), matching the
981-
# prior default behavior.
974+
# Pass the field only when provided, so it stays unset (Unassigned) by default.
982975
instance_group_kwargs = (
983976
{"instance_group_names": instance_group_names}
984977
if instance_group_names is not None

0 commit comments

Comments
 (0)