Skip to content

Commit 203ddf3

Browse files
Rithikreddyjam-jee
authored andcommitted
fix(train): correct Networking field names in ModelTrainer intelligent defaults
Two bugs in _populate_intelligent_defaults_from_training_job_space(): 1. Networking constructor was passed `default_enable_network_isolation` which does not exist in sagemaker-core 2.x. The correct field name is `enable_network_isolation`. This caused a Pydantic ValidationError when sagemaker_config had a VpcConfig value set, making ModelTrainer unusable in SageMaker distribution 4.0 out of the box. 2. When updating an existing Networking object, `security_group_ids` was mistakenly assigned the subnets value from TRAINING_JOB_SUBNETS_PATH instead of the correct value from TRAINING_JOB_SECURITY_GROUP_IDS_PATH. Fixes #5766
1 parent 3982ca6 commit 203ddf3

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ def _populate_intelligent_defaults_from_training_job_space(self):
331331
if not self.networking:
332332
if default_enable_network_isolation is not None or default_vpc_config is not None:
333333
self.networking = Networking(
334-
default_enable_network_isolation=default_enable_network_isolation,
334+
enable_network_isolation=default_enable_network_isolation,
335335
subnets=self.config_mgr.resolve_value_from_config(
336336
config_path=TRAINING_JOB_SUBNETS_PATH
337337
),
@@ -347,8 +347,8 @@ def _populate_intelligent_defaults_from_training_job_space(self):
347347
config_path=TRAINING_JOB_SUBNETS_PATH
348348
)
349349
if self.networking.security_group_ids is None:
350-
self.networking.subnets = self.config_mgr.resolve_value_from_config(
351-
config_path=TRAINING_JOB_SUBNETS_PATH
350+
self.networking.security_group_ids = self.config_mgr.resolve_value_from_config(
351+
config_path=TRAINING_JOB_SECURITY_GROUP_IDS_PATH
352352
)
353353

354354
if not self.output_data_config:

0 commit comments

Comments
 (0)