Skip to content

Fully deprecate AutoGPTQ for GPT-QModel#2385

Merged
IlyasMoutawwakil merged 21 commits into
huggingface:mainfrom
ZX-ModelCloud:compat-gptqmodel
Dec 17, 2025
Merged

Fully deprecate AutoGPTQ for GPT-QModel#2385
IlyasMoutawwakil merged 21 commits into
huggingface:mainfrom
ZX-ModelCloud:compat-gptqmodel

Conversation

@ZX-ModelCloud

@ZX-ModelCloud ZX-ModelCloud commented Nov 28, 2025

Copy link
Copy Markdown
Contributor

What does this PR do?

Remove autogptq clutter and autogptq related configs that are not worth adding backward compat.
See
transformers PR#41567
peft PR#2932

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

Who can review?

@Qubitium

Qubitium commented Nov 28, 2025

Copy link
Copy Markdown
Contributor

@SunMarc @BenjaminBossan This is the companion PR to both PEFT PR huggingface/peft#2917 and Transformer PR huggingface/transformers#41567.

Also fixes a Transformer bug (latest changes broke Optimum) in 14d5cfe

Major changes is kernel selection to gptqmodel is unified under new hf_select_quant_linear_v2 api for both gptq and pending awq.

Related Optimum quantization CI tests passing.

Signed-off-by: ZX-ModelCloud <[email protected]>
Signed-off-by: ZX-ModelCloud <[email protected]>
Signed-off-by: ZX-ModelCloud <[email protected]>

@SunMarc SunMarc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for updating the codebase and deprecating auto-gptq in optimum. Note that in the long term, we will probably not maintain this anymore and we should redirect users to appropriate lib like gptq-model. Feel free to update the docs to prompt users to direct use gptq-model.
In transformers, we only deal with quantizing ourselves if we can do it on the fly without calibration. gptq was one of the first method, so this is why it was supported through optimum but for example, we didn't do it for awq.

Signed-off-by: ZX-ModelCloud <[email protected]>
@ZX-ModelCloud ZX-ModelCloud changed the title [WIP] Fully deprecate AutoGPTQ for GPT-QModel Fully deprecate AutoGPTQ for GPT-QModel Dec 2, 2025
@ZX-ModelCloud
ZX-ModelCloud marked this pull request as ready for review December 2, 2025 09:08
@Qubitium

Qubitium commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

@IlyasMoutawwakil @SunMarc PR is now synced to Peft/Transformer pending Prs. Ready for final review for this portion. All relevant tests passing.

Signed-off-by: ZX-ModelCloud <[email protected]>
@IlyasMoutawwakil

Copy link
Copy Markdown
Member

Thanks ! can you please add GPTQModel to the gptq workflow:
https://github.com/huggingface/optimum/blob/main/.github/workflows/test_gptq.yml#L45
and run code styling in a clean env

Signed-off-by: ZX-ModelCloud <[email protected]>
Comment thread optimum/gptq/quantizer.py Outdated
def load_quantized_model(
model: nn.Module,
save_folder: str,
backend: BACKEND = BACKEND.AUTO,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

BACKEND is only defined when GPTQModel is available which breaks this file when it isn't

@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

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.

Signed-off-by: ZX-ModelCloud <[email protected]>
Comment thread tests/gptq/test_quantization.py Outdated
Comment on lines +212 to +205
backend=BACKEND.EXLLAMA_V1,
backend=BACKEND.EXLLAMA_V2,

@Qubitium Qubitium Dec 4, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@IlyasMoutawwakil Note we change the ci to test exllama v2 kernel since GPT-QModel no longer compile Exallma v1 kernel by default due to a) save on whl size b) v2 is consistently faster so there is no reason to use v1 kernel. exllama v1 kernel is still compilable from gpt-qmodel src but for the sake or fast optimum ci (install from precompiled whl), we are moving away from exallma v1 tests.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks for taking care of this !

Comment thread .github/workflows/test_gptq.yml Outdated
Comment on lines +44 to +48
- name: Install dependencies
run: |
pip install --upgrade pip uv
uv pip install .[tests]
uv pip install gptqmodel --no-build-isolation

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Qubitium @ZX-ModelCloud is there anything that needs to be fixed in the installation process her ? it fails with :

  × Failed to download and build `gptqmodel==5.4.2`
  ╰─▶ Package metadata version `5.4.2+cu128torch2.9` does not match `5.4.2`
      from the wheel filename

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@Qubitium @ZX-ModelCloud is there anything that needs to be fixed in the installation process her ? it fails with :

  × Failed to download and build `gptqmodel==5.4.2`
  ╰─▶ Package metadata version `5.4.2+cu128torch2.9` does not match `5.4.2`
      from the wheel filename

Please pin ci test to gptqmodel >= 5.6.10

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There is a bug in uv. We previously submitted and they fixed this meta match issue but now regressing in latest uv. Please use pin gptqmodel to 5.6.10 and avoid uv

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i pinned gptqmodel to 5.6.10, let's see if it works,
avoiding uv is kinda hard once you get used to its speedup gains 😅

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i pinned gptqmodel to 5.6.10, let's see if it works, avoiding uv is kinda hard once you get used to its speedup gains 😅

We will try to get this resolved with uv upstream (if we cannot resolve it on our end with setup.py hacks). Need to stick with pip for gptqmodel install for now. =(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

it worked now !
so gptqmodel needs to build the cuda/hip/sycl kernels from scratch at installation time ? did you consider using the kernels and kernel-builder libs ? would make the package more universal and solve most distribution issues.

@Qubitium

Copy link
Copy Markdown
Contributor

@IlyasMoutawwakil We may have an internal issue.

pip install "gptqmodel>=5.6.10" --no-build-isolation

also failing with same meta data parsing error...checking

@IlyasMoutawwakil IlyasMoutawwakil left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM ! thanks for simplifying this !

@Qubitium

Copy link
Copy Markdown
Contributor

@IlyasMoutawwakil uv re-enabled. We fixed uv compat. 5.6.12 releasd to pypi and prebuilt wheels are being created right now (likely take 1 hour to complete all the wheels). https://github.com/ModelCloud/GPTQModel/actions/runs/20301283813/job/58308710953

Once the wheels are done, you can trigger ci, and uv should install download the prebuilt wheel without having to build the full kernels.

Comment thread .github/workflows/test_gptq.yml Outdated
@IlyasMoutawwakil
IlyasMoutawwakil merged commit 3a85d51 into huggingface:main Dec 17, 2025
16 checks passed
@Qubitium
Qubitium deleted the compat-gptqmodel branch December 17, 2025 15:14
githubnemo added a commit to huggingface/peft that referenced this pull request Jan 29, 2026
Remove autogptq clutter and autogptq related configs that are not worth adding backward compat.

For reference, see
- huggingface/transformers#41567
- huggingface/optimum#2385


* fix gptq test

Signed-off-by: ZX-ModelCloud <[email protected]>

* remove auto_gptq

Signed-off-by: ZX-ModelCloud <[email protected]>

* call hf_select_quant_linear_v2()

Signed-off-by: ZX-ModelCloud <[email protected]>

* remove auto_awq

Signed-off-by: ZX-ModelCloud <[email protected]>

* cleanup

Signed-off-by: ZX-ModelCloud <[email protected]>

* format

Signed-off-by: ZX-ModelCloud <[email protected]>

* fix PeftAwqGPUTests

Signed-off-by: ZX-ModelCloud <[email protected]>

* update GPTQMODEL_MINIMUM_VERSION to 5.6.0

Signed-off-by: ZX-ModelCloud <[email protected]>

* update GPTQMODEL_MINIMUM_VERSION

Signed-off-by: ZX-ModelCloud <[email protected]>

* Update minimum version requirement for gptqmodel

* style

* call is_gptqmodel_available()

Signed-off-by: ZX-ModelCloud <[email protected]>

* call is_gptqmodel_available()

Signed-off-by: ZX-ModelCloud <[email protected]>

* Update minimum version for gptqmodel to 5.6.12

* When hf_device_map does not exist, infer the device_map

Signed-off-by: ZX-ModelCloud <[email protected]>

* cleanup

Signed-off-by: ZX-ModelCloud <[email protected]>

---------

Signed-off-by: ZX-ModelCloud <[email protected]>
Co-authored-by: Qubitium-ModelCloud <[email protected]>
Co-authored-by: githubnemo <[email protected]>
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.

5 participants