Skip to content

Conversation

@MekkCyber
Copy link
Contributor

What does this PR do?

This pr adds support for bitsandbytes quantization, and loading bnb quantized models in transformers.

Some quantized Llama4 models can be found here :

@github-actions github-actions bot marked this pull request as draft April 7, 2025 15:32
@github-actions
Copy link
Contributor

github-actions bot commented Apr 7, 2025

Hi 👋, thank you for opening this pull request! The pull request is converted to draft by default. The CI will be paused while the PR is in draft mode. When it is ready for review, please click the Ready for review button (at the bottom of the PR page). This will assign reviewers and trigger CI.

Comment on lines 307 to 308
self.quantization_config.quant_method == QuantizationMethod.COMPRESSED_TENSORS
or self.quantization_config.quant_method == QuantizationMethod.BITS_AND_BYTES
Copy link
Member

Choose a reason for hiding this comment

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

Let's create update the mapping to add another keys about quant methods that require this change

@MekkCyber MekkCyber marked this pull request as ready for review April 7, 2025 15:55
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.

Nice, last thing is to make sure that this is restricted for now only for pre_quantized models. We can change that in the future if this is needed.

@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.

@MekkCyber MekkCyber merged commit f830105 into main Apr 7, 2025
21 checks passed
@MekkCyber MekkCyber deleted the add_bnb branch April 7, 2025 18:34
@SunMarc
Copy link
Member

SunMarc commented Apr 9, 2025

let's do the patch attribute that i talked about before this change breaks other bnb models !

cyr0930 pushed a commit to cyr0930/transformers that referenced this pull request Apr 18, 2025
zucchini-nlp pushed a commit to zucchini-nlp/transformers that referenced this pull request May 14, 2025
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