Skip to content

[Quantization][Refactor][Internal Naming] The naming of functions that perform registration implies that they actually perform quantization #26502

@rivkastroh

Description

@rivkastroh

In the quantize_model function, which is called from quantize_static, the first part deals with registering the tensors for quantization and the second part with the actual quantization of each tensor, but the meaning of the function names in the first part is the actual execution of quantization.
For example,
CreateQDQQuantizer(onnx_quantizer, node)
mismatch: this is a factory that selects and returns a per-node handler used in the registration phase, it does not perform quantization. The name suggests creating a “quantizer” that actually quantizes.
quantize_activation_tensor(self, tensor_name: str)
mismatch: this method only registers an activation tensor for later quantization, it does not insert Q/DQ nodes or modify tensor values. The name implies performing quantization of the activation tensor.
and so forth.

https://github.com/microsoft/onnxruntime/blob/main/onnxruntime/python/tools/quantization/qdq_quantizer.py#L551

Metadata

Metadata

Assignees

No one assigned

    Labels

    quantizationissues related to quantization

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions