Skip to content

[Examples] Fix ignore layers for Qwen2.5-VL #1658

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SorenDreano
Copy link
Contributor

SUMMARY:
Oneshot() prints the following warning:
Some layers that were to be ignored were not found in the model: {'re:visual.*'} as the vision module in Qwen2.5-vl is in model.visual

TEST PLAN:
Removing re:visual.* from the list of modules to be ignored did not result in any warning or error

fixes
Some layers that were to be ignored were not found in the model: {'re:visual.*'}
as the vision module in Qwen2.5-vl is in model.visual
Copy link

👋 Hi! Thank you for contributing to llm-compressor. Please add the ready label when the PR is ready for review.

Note: This is required to complete the testing suite, please only add the label once the PR is code complete and local testing has been performed.

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.

Summary of Changes

Hello @SorenDreano, 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 addresses and resolves a warning encountered during the quantization process for the Qwen2.5-VL model example. The issue stemmed from an incorrect regular expression pattern in the module ignore list, which was attempting to exclude layers that did not exist under that specific path. By refining this configuration, the example now runs without the previous warning, ensuring a cleaner and more accurate setup for model quantization.

Highlights

  • Configuration Fix: I've corrected the ignore list within the GPTQModifier configuration for the Qwen2.5-VL example. Specifically, the re:visual.* pattern, which was causing a warning, has been removed as it was redundant and incorrect for the model's structure.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 is currently in preview and 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 to provide feedback.

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.

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

The pull request correctly removes a redundant entry from the ignore list in the Qwen2.5-VL example, which was causing a warning. I've suggested a small improvement to make the remaining regex pattern more precise to avoid potential issues with overly broad matching.

@kylesayrs
Copy link
Collaborator

kylesayrs commented Jul 18, 2025

Hi @SorenDreano,

Thank you for your contribution! However, in this case, these ignore names are kept in place in order to support older checkpoints created prior to huggingface/transformers#37033.

Perhaps instead of removing them, we can add a comment in the example explaining why they exist.

EDIT: See @brian-dellabetta's review

@@ -73,7 +73,7 @@ def data_collator(batch):
GPTQModifier(
targets="Linear",
scheme="W4A16",
ignore=["lm_head", "re:visual.*", "re:model.visual.*"],
ignore=["lm_head", "re:model.visual.*"],
Copy link
Collaborator

@brian-dellabetta brian-dellabetta Jul 18, 2025

Choose a reason for hiding this comment

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

Since we want to catch both visual. and model.visual., we can use an OR condition in our regex like

Suggested change
ignore=["lm_head", "re:model.visual.*"],
# NOTE: catch anything beginning with `model.visual.` or `visual.`
# to account for different behavior across transformers versions
ignore=["lm_head", "re:(model\.|)visual\..*"],

This will prevent the warning from appearing

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