feat: enhance model checks for transformers pipelines#281
Merged
davidberenstein1957 merged 5 commits intomainfrom Aug 8, 2025
Merged
Conversation
Member
Author
|
@begumcig do we need to do anything special with the inference handler here? Not as far as I could see but I would love to hear your thoughts :) |
johannaSommer
requested changes
Jul 29, 2025
Member
johannaSommer
left a comment
There was a problem hiding this comment.
Love it!!! Just a few questions 🙌
9602323 to
389c900
Compare
llcnt
reviewed
Aug 4, 2025
Collaborator
llcnt
left a comment
There was a problem hiding this comment.
So nice to support LM pipelines :)
I only have one question regarding save/load functionality: did you re-ran the gpu tests? Or try to save and re-load a pipeline smashed with hqq ? (I wonder if we need to add the save_pipeline_info function inside hqq custom saved function)
johannaSommer
approved these changes
Aug 5, 2025
Member
johannaSommer
left a comment
There was a problem hiding this comment.
Wonderful, looks good from my side! 🙌
- Added new functions to check for transformers pipelines with causal and seq2seq language models. - Updated existing quantization and compilation algorithms to utilize the new pipeline checks. - Enhanced the `PrunaAlgorithmBase` class to apply algorithms directly to transformers pipelines. - Updated tests and fixtures to include transformers pipeline scenarios for better coverage.
…ers pipelines - Renamed `_apply_to_model_within_pipeline` to `_apply_to_model_within_transformers_pipeline` for consistency across various algorithms. - Updated references in quantization and compilation classes to use the new method name. - Enhanced test fixtures to support a more generalized method for obtaining transformers pipelines for specific tasks.
…ts and signature - Updated the `track_usage` decorator to accept a callable directly, improving type safety with TypeVar. - Enhanced the wrapper function to extract `smash_config` from the function's signature, ensuring better handling of arguments. - Preserved the original function's type hints and signature for improved compatibility and clarity.
- Updated the `load_hqq` function to ensure proper handling of model paths and added support for loading tokenizer alongside the model. - Enhanced the `save_model_hqq` function to save the tokenizer when saving a transformers pipeline model. - Improved code clarity and maintainability by ensuring consistent handling of model and tokenizer paths.
8eaf9ad to
308adf2
Compare
Member
Author
|
@llcnt you were right. I fixed it now. |
…luation - Updated `save_model_hqq` to check for the presence of a tokenizer before saving, preventing potential errors. - Modified model loading in `EnvironmentalImpactStats` to ensure the save path is converted to a string, enhancing compatibility. - Refactored the `track_usage` decorator to streamline argument handling and improve clarity in function usage tracking.
llcnt
approved these changes
Aug 8, 2025
Collaborator
llcnt
left a comment
There was a problem hiding this comment.
Thx for the hqq fix :) LGTM!
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.
Description
Related Issue
Fixes #276
Type of Change
How Has This Been Tested?
Checklist
Additional Notes