Repository navigation
Conversation
Collaborator
Author
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
AwqGEMVLinear,AwqGEMVTritonLinear, and the GEMV_FAST/LLM_AWQ kernels declareSUPPORTS_DTYPES = [torch.float16], but that dtype was only checked when the module was constructed in layer-0 finalize. The AWQ search had already run by then, so a bf16 (or fp32) model paid for calibration and only then failed withNotImplementedError. This adds an up-front check at load time, before the model is loaded/calibrated, and namesdtype=torch.float16as the fix.What Changed
gptqmodel/quantization/config.py: addedAWQ_FP16_ONLY_FORMATS(GEMV, GEMV_FAST, LLM_AWQ) andAWQConfig.validate_dtype(), which raises an actionableValueErrorfor a non-fp16 target dtype while leaving GEMM/MARLIN/BITBLAS untouched.gptqmodel/models/auto.py:GPTQModel.from_pretrained()(and thereforeGPTQModel.load()) resolves the effective target dtype (explicitdtype, modelrequire_dtype, otherwiseauto_dtype) after the config/model definition is read and beforemodel_definition.from_pretrained()is called. The guard runs before any model construction or calibration.tests/test_awq_gemv_dtype_4394.py: regression tests for GEMV/GEMV_FAST/LLM_AWQ rejection, fp16 acceptance, GEMM/MARLIN/BITBLAS unaffected, load-time rejection before model load, explicit fp16 pass-through, and therequire_dtypeoverride.Tests
CPU-only, no model downloads. The compiled CUDA AWQ extensions are not built in this container, so the native GEMV/GEMV_FAST/LLM_AWQ kernels themselves were not executed; the fix is validated through the config/load-time guard and the existing CPU config tests.
Model Support / Module Plan
N/A — no new model types or registry entries.
Fixes #4394