-
Notifications
You must be signed in to change notification settings - Fork 2.1k
add gptqmodel support #2247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
add gptqmodel support #2247
Changes from 24 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
a69fd22
add gptqmodel support
jiqing-feng 3b87bae
enable gptqmodel tests
jiqing-feng e17c4ea
Fix Peft compat (#1)
LRL-ModelCloud 01c7429
update gptqmodel version (#2)
ZX-ModelCloud c80fffd
check model has attr 'hf_device_map'
LRL-ModelCloud e887299
update gptqmodel version
Qubitium 60c03af
revert test_common_gpu.py and test_gpu_examples.py
LRL-ModelCloud ec4d6fe
add test_gptqmodel.py
LRL-ModelCloud b54d034
PeftGPTQModelCommonTests require gptqmodel
LRL-ModelCloud 12ab8a0
cleanup
LRL-ModelCloud c8c3d8e
use peft_model.device
LRL-ModelCloud 946d1d7
format code
LRL-ModelCloud 4f11d86
update copyright notice
LRL-ModelCloud 4f13f7b
device_map is optional
LRL-ModelCloud 9fcdd02
update Makefle, add test_gptqmodel_gpu
LRL-ModelCloud 17440c4
Merge branch 'huggingface:main' into gptq
LRL-ModelCloud c206e7b
add get_gptqmodel_quant_linear to __all__
LRL-ModelCloud e0439fd
add gptq to quantization.md
Qubitium 1f79dae
Update quantization.md
Qubitium c15a302
cleanup
LRL-ModelCloud 6a3adc6
Merge remote-tracking branch 'origin/gptq' into gptq
LRL-ModelCloud 59932fd
cleanup
LRL-ModelCloud 75ddd5e
Update docs/source/developer_guides/quantization.md
Qubitium dab7a54
Update docs/source/developer_guides/quantization.md
Qubitium d5e55b6
Merge branch 'huggingface:main' into gptq
LRL-ModelCloud 540e5af
pass device_map as a keyword argument
LRL-ModelCloud fa3ab05
add optimum version check for gptqmodel compatibility
LRL-ModelCloud File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When trying to run this locally with 2 CUDA devices, I encountered a CUDA error after 50% progress:
Is this a known problem? Using 1 CUDA device or setting
CUDA_LAUNCH_BLOCKING=1resolves the error.I suspect that the error occurs at the "switch" from GPU 0 to GPU 1, since that's exactly after half the layers when using
device_map="auto".Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will double check this to see if a) accelerate specific or b) OPT specific.
accelerateso maybe this is related to accelerate or OPT modelFor next GPTQModel CI tests PR, I would recommend we move all model testings from OPT to Llama 1B. I believe OPT was chosen due to the tiny size but in our experience, but there are some strange issues with the OPT modeling code (that I can't recall) that causes strange issues here and there. We recently dropped all CI OPT tests in factor of Llama for this reason. Again, I can't seem to recall the exact reasons. =(
Basically no one uses OPT anymore and any modeling changes is heavily favoriing Llama so any fringe bugs are much less likely to occur on
llamaclass models.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed that opt is very outdated at this point, and we mainly use it since it's small, but at least for PEFT it hasn't caused any problems yet.
I ran the code above using
meta-llama/Llama-3.2-1Band again got an error after 50%:Thus it's unlikely to be related to the model architecture.
CUDA_LAUNCH_BLOCKING=1again was enough to resolve the issue.