Skip to content

Conversation

zzc0430
Copy link
Contributor

@zzc0430 zzc0430 commented Oct 13, 2025

PR type

  • Bug Fix
  • New Feature
  • Document Updates
  • More Models or Datasets Support

PR information

support gptq_v2 according to huggingface/optimum@21de42f

Experiment results

Paste your experiment result here(if needed).

Copy link
Contributor

Summary of Changes

Hello @zzc0430, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces comprehensive support for GPTQ v2 quantization, enhancing the model export capabilities. It allows users to leverage the newer GPTQ v2 method for quantizing models, providing updated documentation, a dedicated example script, and necessary code modifications to integrate this new quantization option seamlessly into the existing framework. This feature aims to improve efficiency and flexibility in model deployment.

Highlights

  • GPTQ v2 Support: Added comprehensive support for GPTQ v2 quantization, expanding the available model export options.
  • Documentation Updates: Updated both Chinese and English documentation to include installation instructions for gptqmodel and to list GPTQ v2 as a supported quantization method.
  • New Example Script: Introduced a new example shell script (gptq_v2.sh) demonstrating how to perform GPTQ v2 quantization for a model.
  • Argument Extension: Extended the quant_method argument in ExportArguments to officially recognize and accept gptq_v2.
  • Quantization Logic Integration: Modified the core quantization logic to differentiate between GPTQ and GPTQ v2, passing a specific checkpoint_format to the GPTQQuantizer based on the chosen method.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@zzc0430 zzc0430 changed the title feat: support gptq_v2 feat: support gptq_v2 quantization method Oct 13, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for gptq_v2 quantization. The changes include updating documentation, adding a new example script, and modifying the quantization logic to handle the new format. The implementation correctly passes the checkpoint_format='gptq_v2' parameter to optimum's GPTQQuantizer. The changes are logical and well-implemented. I have one minor suggestion to improve the code style in the new example script.

swift export \
--model Qwen/Qwen2.5-1.5B-Instruct \
--dataset 'AI-ModelScope/alpaca-gpt4-data-zh#500' \
'AI-ModelScope/alpaca-gpt4-data-en#500' \
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For better readability and to follow common shell scripting conventions, it's better to indent continued lines consistently (e.g., with 4 or 8 spaces) rather than aligning them with the argument value from the previous line.

Suggested change
'AI-ModelScope/alpaca-gpt4-data-en#500' \
'AI-ModelScope/alpaca-gpt4-data-en#500' \

@Jintao-Huang
Copy link
Collaborator

Hello, I'm unable to run the shell script you provided.

@Jintao-Huang Jintao-Huang merged commit 4fc8ead into modelscope:main Oct 14, 2025
1 of 2 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.

2 participants