Skip to content

fix: ModelTrainer and HyperparameterTuner missing environment variables (5613)#5702

Draft
aviruthen wants to merge 1 commit intoaws:masterfrom
aviruthen:fix/modeltrainer-and-hyperparametertuner-missing-5613-2
Draft

fix: ModelTrainer and HyperparameterTuner missing environment variables (5613)#5702
aviruthen wants to merge 1 commit intoaws:masterfrom
aviruthen:fix/modeltrainer-and-hyperparametertuner-missing-5613-2

Conversation

@aviruthen
Copy link
Copy Markdown
Collaborator

Description

The HyperparameterTuner in V3 SDK does not propagate the ModelTrainer's environment attribute to the training job definition. The _build_training_job_definition method in tuner.py constructs the TrainingJobDefinition for the HPT API but completely omits the environment field from the model_trainer. The word 'environment' never appears in tuner.py. The fix requires adding environment to the training job definition built by the tuner, reading it from model_trainer.environment. This affects both the single-trainer path (_build_training_job_definition) and the multi-trainer path (_build_training_job_definitions). The environment should be included as a top-level field in the HyperParameterTrainingJobDefinition, which the SageMaker HPT API supports via the Environment key.

Related Issue

Related issue: 5613

Changes Made

  • sagemaker-train/src/sagemaker/train/tuner.py
  • sagemaker-train/tests/unit/train/test_tuner.py

AI-Generated PR

This PR was automatically generated by the PySDK Issue Agent.

  • Confidence score: 85%
  • Classification: type: bug
  • SDK version target: V3

Merge Checklist

  • Changes are backward compatible
  • Commit message follows prefix: description format
  • Unit tests added/updated
  • Integration tests added (if applicable)
  • Documentation updated (if applicable)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant