Skip to content

Fix AWQ tests for GPTQModel migration#44654

Merged
SunMarc merged 6 commits intohuggingface:mainfrom
jiqing-feng:awq
Mar 13, 2026
Merged

Fix AWQ tests for GPTQModel migration#44654
SunMarc merged 6 commits intohuggingface:mainfrom
jiqing-feng:awq

Conversation

@jiqing-feng
Copy link
Contributor

@jiqing-feng jiqing-feng commented Mar 13, 2026

This PR fixes the AWQ test suite to align with the GPTQModel migration (following #41567 and #42776).

Changes

  • Fix replace_with_awq_linear return value: The function now returns the model directly instead of a tuple (model, _), updated all call sites accordingly.
  • Use BaseQuantLinear for type checking: Replaced specific AwqGEMMQuantLinear / AwqGEMVQuantLinear isinstance checks with the unified gptqmodel.nn_modules.qlinear.BaseQuantLinear.
  • Remove explicit GEMM backend override in test setup: Let the model load with its default quantization config instead of forcing AwqBackend.GEMM.
  • Fix save and load test: Load a fresh model for save/reload testing to avoid corrupted buffers caused by in-place transforms from prior generate() calls on the shared model instance.
  • Update ground truth expected output: Added an additional valid expected output for bf16 inference.

@SunMarc @Qubitium

Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
@jiqing-feng jiqing-feng marked this pull request as ready for review March 13, 2026 07:32
@github-actions github-actions bot requested a review from ydshieh March 13, 2026 07:33
@github-actions
Copy link
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: autoawq

@Qubitium
Copy link
Contributor

LGTM! Allowing gptqmodel to auto load the awq kernel will also make future tests regress less since transformers no longer need to know about format=awq to correct kernel to env mappings.

Signed-off-by: jiqing-feng <jiqing.feng@intel.com>
Copy link
Member

@SunMarc SunMarc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks !

@SunMarc SunMarc enabled auto-merge March 13, 2026 16:11
@SunMarc SunMarc added this pull request to the merge queue Mar 13, 2026
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Merged via the queue into huggingface:main with commit f2f7c89 Mar 13, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants