fix(train): send bounded HyperParameters override map for serverless customization jobs#6016
Open
jam-jee wants to merge 1 commit into
Open
fix(train): send bounded HyperParameters override map for serverless customization jobs#6016jam-jee wants to merge 1 commit into
jam-jee wants to merge 1 commit into
Conversation
…customization jobs
Serverless (SMTJ) model-customization jobs began failing at CreateTrainingJob
with a ValidationException ("hyperParameters ... Member must have length less
than or equal to 100") after the Nova release added recipe/overrides support.
_apply_recipe_to_hyperparameters flattened the entire resolved Hub recipe
(200+ leaf keys: KL config, vLLM params, LoRA settings, etc.) into the
hyper_parameters map sent to the API. The serverless HyperParameters map is an
override map capped at 100 entries, so the full flatten blew past the limit.
Fix: for the serverless path (new serverless=True flag), emit a bounded
override map containing only Hub spec-allowlisted keys plus leaves the user
explicitly changed (via overrides=, a recipe file, or .hyperparameters.*).
Unchanged recipe defaults are dropped since the base recipe is applied
server-side. Explicit user overrides of non-spec keys are still forwarded so
they are never silently dropped. Applied to RLVR/SFT/DPO/MTRL trainers; the
serverful path keeps full-recipe flattening (it renders into the recipe YAML).
Refs P467902218.
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
Refs P467902218.
Serverless (SMTJ) model-customization jobs (RLVR/SFT/DPO/MTRL) began failing at
CreateTrainingJobafter the Nova release with:A notebook that previously worked started failing (~07/06). The SDK was sending all hyperparameters — including recipe defaults the user never changed.
Root cause
The Nova release added
recipe/overridessupport and a new_apply_recipe_to_hyperparameters()step on the serverless training path. For serverless jobs it flattened the entire resolved Hub recipe (200+ leaf keys — KL config, vLLM params, LoRA settings, etc.) into thehyper_parametersmap passed toCreateTrainingJob.The serverless
HyperParametersmap is an override map capped at 100 entries by the API (the error message is a JavaMap.toString()echo of the whole map, and the "length ≤ 100" constraint is the entry-count limit). Flattening the full recipe blew past that limit. Pre-Nova, serverless only sent the bounded spec subset (to_dict()), which is why the same notebook worked before.Fix
For the serverless path (new
serverless=Trueflag on_apply_recipe_to_hyperparameters), emit a bounded override map containing only:overrides=, a recipe file, or direct.hyperparameters.*assignments).The recipe's unchanged non-spec defaults are dropped, since the base recipe is applied server-side. Crucially, explicit user overrides of non-spec keys are still forwarded — they are never silently dropped (which would train with the wrong value). This mirrors the delta approach the MTRL trainer already uses.
The serverful path is unchanged (
serverless=Falsedefault): it keeps full-recipe flattening because those values are rendered back into the recipe YAML handed toModelTrainer.from_recipe.Applied to
RLVRTrainer,SFTTrainer,DPOTrainer, andMultiTurnRLTrainer.Testing
test_serverful_recipe_validation.pycovering: unchanged non-spec defaults are dropped for serverless, explicit user overrides (incl. deeply nested) are forwarded, and the serverful path still flattens the full recipe.test_trainer_recipe_integration.pythat had locked in the pre-fix behavior (full recipe flowing into serverlesshyper_parameters) to assert the corrected override-map contract.tests/unit/trainsuite: 2152 passed, 19 skipped. (One unrelated pre-existing failure,test_model_trainer_no_from_recipe_raises, fails identically on cleanmaster— it needs AWS creds for a default-bucket lookup.)Merge Checklist
Tests
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.