Skip to content

fix: filter full recipe template from serverless train( )#6021

Open
mujtaba1747 wants to merge 3 commits into
aws:masterfrom
mujtaba1747:master-serverless-recipe-fix
Open

fix: filter full recipe template from serverless train( )#6021
mujtaba1747 wants to merge 3 commits into
aws:masterfrom
mujtaba1747:master-serverless-recipe-fix

Conversation

@mujtaba1747

@mujtaba1747 mujtaba1747 commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Title: fix: filter full recipe template from serverless train()

Summary

  • Serverless CreateTrainingJob limits HyperParameters to 100 members, but the fully resolved
    recipe template can contain hundreds of internal leaf keys the user never touched, causing API
    validation failures.
  • Adds only_user_overrides flag to _apply_recipe_to_hyperparameters() so serverless trainers
    only forward keys the user explicitly provided (direct assignments, overrides dict, or recipe
    YAML).
  • Applies the filter in SFTTrainer, DPOTrainer, and MultiTurnRLTrainer. RLVRTrainer retains
    full recipe passthrough since it renders into a YAML file with no key-count limit.

Test plan

  • Integ and unit tests to validate new logic
  • Verify serverless training jobs (SFT, DPO, MultiTurnRL) no longer fail with "too many
    hyperparameters" when using a large recipe template
  • Confirm user-provided overrides are still forwarded correctly
  • Validate RLVRTrainer still passes the full resolved recipe (no regression for serverful
    paths)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

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