fix: ModelTrainer and HyperparameterTuner missing environment variables (5613)#5702
Draft
aviruthen wants to merge 1 commit intoaws:masterfrom
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The HyperparameterTuner in V3 SDK does not propagate the ModelTrainer's
environmentattribute to the training job definition. The_build_training_job_definitionmethod in tuner.py constructs the TrainingJobDefinition for the HPT API but completely omits theenvironmentfield from the model_trainer. The word 'environment' never appears in tuner.py. The fix requires addingenvironmentto the training job definition built by the tuner, reading it frommodel_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 theEnvironmentkey.Related Issue
Related issue: 5613
Changes Made
sagemaker-train/src/sagemaker/train/tuner.pysagemaker-train/tests/unit/train/test_tuner.pyAI-Generated PR
This PR was automatically generated by the PySDK Issue Agent.
Merge Checklist
prefix: descriptionformat