feat(train): add list_hyperparameters() for pre-trainer HP discovery - #6149
Open
joshuatowner wants to merge 3 commits into
Open
feat(train): add list_hyperparameters() for pre-trainer HP discovery#6149joshuatowner wants to merge 3 commits into
joshuatowner wants to merge 3 commits into
Conversation
added 2 commits
August 3, 2026 20:21
Add a public utility function that returns available hyperparameters
for a model/technique/training_type combination without requiring a
fully constructed trainer object.
This enables tools and scripts to discover valid hyperparameter names,
defaults, and ranges before setting up training infrastructure (model
package groups, datasets, roles, etc.).
Motivation: COE 398545 identified that hardcoded HP names in downstream
consumers break when recipe templates rename parameters. Dynamic
discovery at code-generation time prevents this class of failure.
Usage:
from sagemaker.train import list_hyperparameters
hp = list_hyperparameters('model-name', 'SFT', 'LORA')
hp.get_info() # display all params
hp.get_info('learning_rate') # display one param
Switch to the same model used by ~80% of existing integ tests to avoid deprecation risk. Llama 3.2 1B is the most battle-tested model in the repo's test infrastructure.
joshuatowner
had a problem deploying
to
manual-approval
August 4, 2026 00:06 — with
GitHub Actions
Error
joshuatowner
had a problem deploying
to
manual-approval
August 4, 2026 00:06 — with
GitHub Actions
Error
joshuatowner
had a problem deploying
to
manual-approval
August 4, 2026 00:06 — with
GitHub Actions
Error
joshuatowner
marked this pull request as ready for review
August 4, 2026 02:49
joshuatowner
had a problem deploying
to
manual-approval
August 4, 2026 02:49 — with
GitHub Actions
Error
joshuatowner
force-pushed
the
list-hyperparameters
branch
from
August 4, 2026 02:54
bf0f6de to
f9d8d7d
Compare
joshuatowner
had a problem deploying
to
manual-approval
August 4, 2026 02:54 — with
GitHub Actions
Error
joshuatowner
had a problem deploying
to
manual-approval
August 4, 2026 02:54 — with
GitHub Actions
Error
joshuatowner
had a problem deploying
to
manual-approval
August 4, 2026 02:55 — with
GitHub Actions
Error
joshuatowner
requested a deployment
to
manual-approval
August 4, 2026 02:55 — with
GitHub Actions
Waiting
joshuatowner
requested a deployment
to
manual-approval
August 4, 2026 02:55 — with
GitHub Actions
Waiting
joshuatowner
requested a deployment
to
manual-approval
August 4, 2026 02:55 — with
GitHub Actions
Waiting
jam-jee
approved these changes
Aug 4, 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.
Issue #, if available:
Related to Skills AI: "Update Skills to use dynamic HP discovery instead of hardcoded parameter names"
Description of changes:
Adds
list_hyperparameters()tosagemaker.train-- a public utility function that returns aFineTuningOptionsobject for a given model/technique/training_type without requiring a fully constructed trainer.Problem: Today, discovering available hyperparameters requires constructing a full trainer object (
SFTTrainer,DPOTrainer, etc.), which in turn requires a model package group, dataset ARN, IAM role, and S3 output path. Tools and scripts that generate training code need to know valid HP names before those resources exist.Solution:
list_hyperparameters()wraps the existing internal recipe resolution logic and returns the sameFineTuningOptionsobject thattrainer.hyperparametersprovides, but without the trainer construction prerequisites.Usage:
Changes:
sagemaker-train/src/sagemaker/train/common_utils/finetune_utils.py: Addedlist_hyperparameters()functionsagemaker-train/src/sagemaker/train/__init__.py: Added lazy import forlist_hyperparameterssagemaker-train/tests/unit/train/common_utils/test_finetune_utils.py: Added 2 unit tests (basic usage, enum acceptance)Testing:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.