Fix support for model_init_kwargs in GKD/GOLD when passed as CLI JSON string#5266
Merged
albertvillanova merged 1 commit intoMar 11, 2026
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
qgallouedec
approved these changes
Mar 10, 2026
qgallouedec
pushed a commit
that referenced
this pull request
Mar 20, 2026
songhappy
pushed a commit
to songhappy/trl
that referenced
this pull request
Apr 20, 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 support for model_init_kwargs when passed as CLI JSON string
Note that
GKDConfigandGOLDConfigboth subclassSFTConfig, but they were extending the_VALID_DICT_FIELDSclass attribute fromTrainingArgumentsinstead of the one from their direct parent. As a result,model_init_kwargs(which is defined in SFTConfig) was not included in the valid dictionary fields for these configs, causing it to be ignored when passed as a CLI JSON string.This PR ensures that
model_init_kwargsis properly recognized and parsed in theGKDConfigandGOLDConfigclasses. The main change is to ensure that these classes reference their base classSFTConfigfor valid dictionary fields instead of the externalTrainingArgumentsclass, improving consistency and maintainability.Configuration logic improvements:
_VALID_DICT_FIELDSin bothGKDConfigandGOLDConfigto referenceSFTConfig._VALID_DICT_FIELDSinstead ofTrainingArguments._VALID_DICT_FIELDS, ensuring proper inheritance and avoiding unnecessary dependency ontransformers, concretely to ensure the presence ofmodel_init_kwargs.Dependency cleanup:
TrainingArgumentsfromtrl/experimental/gkd/gkd_config.pyandtrl/experimental/gold/gold_config.pyto streamline the code and reduce external dependencies.Note
Low Risk
Low risk: updates config metadata used for CLI/JSON parsing and removes an unused
transformers.TrainingArgumentsimport, with no changes to training logic itself.Overview
Fixes
GKDConfigandGOLDConfigdict/CLI JSON parsing by deriving_VALID_DICT_FIELDSfromSFTConfig(their actual base class) instead ofTrainingArguments, somodel_init_kwargsis no longer dropped when provided via CLI.Also removes the now-unneeded
TrainingArgumentsimports from both config modules.Written by Cursor Bugbot for commit 68c101f. This will update automatically on new commits. Configure here.