Shortcuts

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]

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources