Open
Conversation
for more information, see https://pre-commit.ci
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to add initial support for the gemma4 model family by adapting block input caching/quantization flow to handle variable block shapes and extra cached inputs.
Changes:
- Allow wrapper blocks to forward positional args through to decoder layers.
- Add a predefined fixed-attribute lookup for special model types (
gemma4). - Extend caching/quantization to support variable-shaped block groupings and extra per-block cached inputs.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| auto_round/wrapper.py | Forwards positional args through WrapperMultiblock.forward to improve model compatibility. |
| auto_round/special_model_handler.py | Introduces predefined fixed attributes (e.g., gemma4) retrievable from model.config.model_type. |
| auto_round/compressors/base.py | Uses fixed attributes to alter block caching/quantization for variable block shapes and additional cached inputs. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
for more information, see https://pre-commit.ci
Contributor
Author
|
TODO @n1ck-guo I'll leave it to you 1 consolidate with your pr. While this pr is more general, it costs large vram during calibration. 2 Add an argument to the API to allow users to configure this, since it’s not easy to determine whether a model has variable block inputs. One possible approach is to probe with sample data, but that would require loading all the blocks, which is costly. |
…into support_gemma4
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
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.
Description
Please briefly describe your main changes, the motivation.
Type of Change
Related Issues
Fixes or relates to #
Checklist Before Submitting