get_quantizer_mode¶
- torchtune.training.get_quantizer_mode(quantizer: Optional[Callable]) Optional[str] [source]¶
Given a quantizer object, returns a string that specifies the type of quantization.
For example, in the case of int4 weight only quantization, we’ll return “4w”. If the quantizer is not recognized as a known quantizer, we’ll return None.
Currently supported:
Int8DynActInt4WeightQuantizer
: “8da4w”Int4WeightOnlyQuantizer
: “4w”Int8DynActInt4WeightQATQuantizer
: “8da4w-qat”Int4WeightOnlyQATQuantizer
: “4w-qat”
- Parameters:
quantizer (Optional[Callable]) – A callable object that implements the quantize method.
- Returns:
The quantization mode.
- Return type:
Optional[str]