fix(train): surface required hyperparameters instead of dropping them - #6269
rsareddy0329 wants to merge 1 commit into
Conversation
FineTuningOptions.to_dict() builds the hyperparameters dict from self._specs but omits any None value. A spec marked required=True with no default that the user never set was therefore silently dropped from the training request, so a job could launch missing a required hyperparameter and only surface the problem via bad/failed results. Add FineTuningOptions.required_keys() and have the shared _validate_hyperparameter_values() raise a clear error listing any required hyperparameter missing from the final (post recipe/override merge) request. The check is opt-in via an options arg passed only at the post-merge leaf-trainer call sites (SFT/DPO/RLVR/RLAIF/MultiTurnRL); the pre-merge base_trainer call is left unchanged to avoid false positives. Guarded on the concrete type so mocks are ignored. Adds unit tests for required_keys() and the surfacing behavior.
|
Claude finished @rsareddy0329's task in 2m 2s —— View job PR Review: surface required hyperparameters instead of dropping them
SummaryThe change is well-targeted and correct for what it covers. A few things worth considering: 1. Gap: the serverful SMTJ path is not covered (
|
FineTuningOptions.to_dict() builds the hyperparameters dict from self._specs but omits any None value. A spec marked required=True with no default that the user never set was therefore silently dropped from the training request, so a job could launch missing a required hyperparameter and only surface the problem via bad/failed results.
Add FineTuningOptions.required_keys() and have the shared _validate_hyperparameter_values() raise a clear error listing any required hyperparameter missing from the final (post recipe/override merge) request. The check is opt-in via an options arg passed only at the post-merge leaf-trainer call sites (SFT/DPO/RLVR/RLAIF/MultiTurnRL); the pre-merge base_trainer call is left unchanged to avoid false positives. Guarded on the concrete type so mocks are ignored.
Adds unit tests for required_keys() and the surfacing behavior.
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.