gptq example: remove transformers version check#4313
Merged
Conversation
Contributor
Author
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/4313
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This was referenced Apr 22, 2026
vkuzo
added a commit
that referenced
this pull request
Apr 22, 2026
Summary: remove the hacky transformers version check, and replace it with proper workarounds: 1. ensure the user has transformers with huggingface/transformers#45573 for nvfp4 serialization to work 2. manually attach an HF quantizer to ensure deserialization works (this is required with transformers 5.0.0+). Test Plan: ``` ``` ghstack-source-id: 8376570 ghstack-comment-id: 4295746737 Pull-Request: #4313
vkuzo
added a commit
that referenced
this pull request
Apr 22, 2026
Summary: remove the hacky transformers version check, and replace it with proper workarounds: 1. ensure the user has transformers with huggingface/transformers#45573 for nvfp4 serialization to work 2. manually attach an HF quantizer to ensure deserialization works (this is required with transformers 5.0.0+). Test Plan: ``` ``` ghstack-source-id: 8376570 ghstack-comment-id: 4295746737 Pull-Request: #4313
jerryzh168
reviewed
Apr 22, 2026
| ) | ||
|
|
||
| if args.quantization != "none": | ||
| # Attach hf_quantizer so save_pretrained uses the flatten path for tensor |
Contributor
There was a problem hiding this comment.
is there a more official api for this?
Contributor
Author
There was a problem hiding this comment.
this is a non user facing hacky prototype script - works for now, we can improve later if there is a need
jerryzh168
approved these changes
Apr 22, 2026
This was referenced Apr 22, 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.
Summary:
remove the hacky transformers version check, and replace it with proper
workarounds:
fix transformers + torchao nvfp4 serialization huggingface/transformers#45573 for nvfp4
serialization to work
is required with transformers 5.0.0+).
Test Plan: