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.
Description:
This PR addresses a compatibility issue between the llmcompressor's TRL example and the recently updated TRL library. The TRL library recently introduced the
SFTConfig
class to define sparse fine-tuning arguments. ThisSFTConfig
class inherits from HF Transformers'TrainingArguments
, which led to errors when llmcompressor'sTrainingArguments
were used for initialization.To resolve this, we have implemented our own
SFTConfig
class within the llmcompressor framework. OurSFTConfig
class is designed to acceptLLMCompressor.transformers.TrainingArguments
, ensuring seamless integration and compatibility.Key Changes:
SFTConfig
class that inherits fromLLMCompressor.transformers.TrainingArguments
.__init__
method of ourSFTTrainer
to instantiate and pass our customSFTConfig
to the superclass constructors (__init__
methods).This fix ensures that the llmcompressor's TRL example runs smoothly without encountering initialization errors, providing a more robust and error-free user experience.
Testing:
The fixes were tested by running
examples/trl_mixin/ex_trl_constant.py
and the output (truncated) is as follows: