Dynamic PTQ recomputes activation scales from each tensor's observed range at inference
time. Padded positions enter that range, so they change the scale, so they change how the
real tokens are quantized — the attention mask stops padded positions contributing to
attention, but not to the quantization range. Static quantization removes the dependence
entirely.
SarcOjiTest2 is ~75/25 negative-skewed; MCC and ROC-AUC are the meaningful columns there.
Not an on-device ARM measurement.
1from optimum.onnxruntime import ORTModelForSequenceClassification
2from transformers import AutoTokenizer
3
4tok = AutoTokenizer.from_pretrained("Vandita/QuantizedSarcBERT-static-v2")
5model = ORTModelForSequenceClassification.from_pretrained(
6 "Vandita/QuantizedSarcBERT-static-v2", file_name="model_int8_static.onnx")
7
8inputs = tok(["Oh great, another meeting."], return_tensors="pt", padding=True)
9logits = model(**inputs).logits # batching is safe on this build