[Training] quantize_static Histogram based calibration methods expect fixed shape outputs #18792
Labels
quantization
issues related to quantization
stale
issues that have not been addressed in a while; categorized by a bot
Describe the issue
When using quantize_static on models that produce variable shaped outputs, using calibrate methods that need to collect a histogram first will run this line and fail:
onnxruntime/onnxruntime/python/tools/quantization/calibrate.py
Line 719 in d673e39
For example, I had a model which outputs (Batch Size, Sequence Length, Embedding dims)
To reproduce
Run this on a model that produces variable sized outputs:
Urgency
quantize_static still works with CalibrationMethod.MinMax, and quantize_dynamic also works. I just want to see how well the other calibration method works for my model.
ONNX Runtime Installation
Built from Source
ONNX Runtime Version or Commit ID
22.04
PyTorch Version
2.1.1
Execution Provider
Default CPU
Execution Provider Library Version
No response
The text was updated successfully, but these errors were encountered: