Skip to content

register_quantizer or register_quantization_config does not add new method to QuantizationMethod #38462

Closed
@Enlion91

Description

@Enlion91

System Info

transformers==4.51.3
Ascend 910B
torch==2.5.1
torch-npu==2.5.1

Who can help?

No response

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

I want to use transformers/quantizers/auto.py::register_quantization_config and register_quantizer functions to add my own quantizaiton method, but both of them would not add new method enum to the transformers/utils/quantization_config.py::QuantizationMethod, which is used to check if the new method is valid.
Therefore, thre register functions could not register the new method corretly. Users have to write code to manually add Enum to the QuantizationMethod.

Expected behavior

After registers functions called, the new method item should be added to QuantizationMethod as well.

@SunMarc @MekkCyber @ivarflakstad

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions