Fix output data config in HyperparameterTuner#5791
Merged
zhaoqizqwang merged 5 commits intoaws:masterfrom Apr 23, 2026
Merged
Conversation
HyperparameterTuner._build_training_job_definition was reconstructing a new OutputDataConfig with only s3_output_path, silently dropping kms_key_id, compression_type, and other fields set on the ModelTrainer. Pass model_trainer.output_data_config directly to preserve all fields. Also update _create_mock_model_trainer in tests to use a real OutputDataConfig instead of MagicMock, and add a test verifying kms_key_id and compression_type are preserved through the tuning job definition. X-AI-Prompt: Check if HyperparameterTuner passes OutputDataConfig.kms_key_id from ModelTrainer and fix the gap X-AI-Tool: Kiro
nargokul
reviewed
Apr 22, 2026
| # Pass through the full OutputDataConfig from ModelTrainer so that | ||
| # kms_key_id, compression_type, and any other fields are preserved. | ||
| output_config = model_trainer.output_data_config or OutputDataConfig( | ||
| s3_output_path=None |
Contributor
There was a problem hiding this comment.
Why do we need to set this to None.
Collaborator
Author
There was a problem hiding this comment.
OutputDataConfig is a required field in create_hyperparameter_tuning_job. We use an empty object when we don't get the config from ModelTrainer, which is what the old code does
mollyheamazon
requested changes
Apr 22, 2026
| @@ -1,172 +0,0 @@ | |||
| Resolved template parameters: {'role_arn': base_evaluator.py:757 | |||
| 'arn:aws:iam::634683118556:role/service-role/AmazonSageMaker-Exe | |||
Contributor
There was a problem hiding this comment.
What is this file? Looks like it is committed accidentally
Collaborator
Author
There was a problem hiding this comment.
Yes this file is not used
mollyheamazon
approved these changes
Apr 23, 2026
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.
fix(tuner): pass through full OutputDataConfig from ModelTrainer
HyperparameterTuner._build_training_job_definition was reconstructing a new
OutputDataConfig with only s3_output_path, silently dropping kms_key_id,
compression_type, and other fields set on the ModelTrainer.
Pass model_trainer.output_data_config directly to preserve all fields.
Also update _create_mock_model_trainer in tests to use a real OutputDataConfig
instead of MagicMock, and add a test verifying kms_key_id and compression_type
are preserved through the tuning job definition.