onnxruntime
d1fb58b0 - Quantization tool: Allow user to override calibrator's session EP (#23559)

Commit
1 year ago
Quantization tool: Allow user to override calibrator's session EP (#23559) ### Description The quantization calibrators have `execution_providers` attributes but there is no way for a user to provide their own providers when using the `quantize` or `quantize_static` functions. This PR adds a `calibration_providers` parameter to allow users to specify the execution providers to use during calibration. It is helpful when quantizing large models which are slow to calibrate on the CPU. - Chose `calibration_providers` as the name since there is the docstrings refer to another `execution_provider` https://github.com/microsoft/onnxruntime/blob/169917b1e7f69daa687a5448526c189d1f7a4e2b/onnxruntime/python/tools/quantization/quantize.py#L204 https://github.com/microsoft/onnxruntime/blob/169917b1e7f69daa687a5448526c189d1f7a4e2b/onnxruntime/python/tools/quantization/quantize.py#L415 which are not present anywhere in the code. - Can change the name to something else if needed like calibrator_providers, and/or make it into a string instead of a providers list.
Author
Parents
Loading