Skip to content
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

[Feature Request] Support register customize quantization method out-of-tree #35814

Open
ice-tong opened this issue Jan 21, 2025 · 2 comments
Open
Labels
Feature request Request for a new feature

Comments

@ice-tong
Copy link

ice-tong commented Jan 21, 2025

Feature request

Support register customize quantization method out-of-tree.

The usage would be as follows:

from transformers.quantizers import HfQuantizer
from transformers.quantizers import regsiter_quantization_config, register_quantizer
from transformers.utils.quantization_config import QuantizationConfigMixin


@regsiter_quantization_config("custom")
class CustomFakeQuantizationConfig(QuantizationConfigMixin):
    """The custom fake quantization config."""


@register_quantizer("custom")
class CustomFakeQuantizer(HfQuantizer):
    """The custom fake quantizer."""

Motivation

We would greatly appreciate it if HuggingFace could support registering custom quantization schemes externally. This would allow us to integrate the schemes of any LLM quantization tools and evaluate fake quantization models using the powerful combination of lm_eval + huggingface. Thank you for considering this!

Similar features have already been supported by vLLM, see:

Your contribution

If this feature request is considered, I'd happily submit a PR to implement it.

@ice-tong ice-tong added the Feature request Request for a new feature label Jan 21, 2025
@Rocketknight1
Copy link
Member

cc @SunMarc @MekkCyber

@SunMarc
Copy link
Member

SunMarc commented Jan 22, 2025

Looks like a nice feature ! Feel free to submit a PR for that ! cc @mht-sharma, I think you wanted to have something like that too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature request Request for a new feature
Projects
None yet
Development

No branches or pull requests

3 participants