Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

# [ONNX][Autotune] Integrated quantization does not preserve AutoTune Q/DQ placement on ViT

オープン
#2,123 コメント 1 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@ajrasane がすでに取り組んでいます。

2026年8月17日 から。

評価

この issue はまだ評価されていません。

説明

bug

[ONNX][Autotune] Integrated quantization does not preserve AutoTune Q/DQ placement on ViT

Description

When using ONNX Integrated AutoTune with:

python -m modelopt.onnx.quantization ... --autotune

I found that the Q/DQ placement selected during the AutoTune search is not preserved in the final calibrated INT8 ONNX model.

This also causes a noticeable TensorRT performance regression.

For autotune_schemes_per_region=50:

Model QPS Speedup P50
FP16 baseline 744.41 1.00x 1.34 ms
Standard INT8 PTQ 1019.40 1.37x 0.98 ms
Integrated AutoTune optimized_final.onnx 1045.54 1.41x 0.95 ms
Integrated final calibrated model 915.37 1.23x 1.09 ms

At the consumer-input edge level:

SAME          = 86
AUTOTUNE ONLY = 48
FINAL ONLY    = 0

So all activation boundaries in the final model are already present in the AutoTune model, but 48 AutoTune-selected boundaries disappear in the final calibrated model.

The missing boundaries follow a regular pattern:

12 x Cast -> Sqrt
12 x Div  -> Sqrt_1
12 x Div  -> Sqrt_2
11 x fc1/Add -> Gelu
 1 x Add -> final LayerNormalization

Because each Div Q/DQ is shared by two Sqrt consumers, these 48 missing consumer edges correspond exactly to the 36 missing activation Q/DQ pairs:

122 - 86 = 36

For example:

/blocks/blocks.0/attn/Cast_output_0_cast_to_fp16
    -> /blocks/blocks.0/attn/Sqrt.input[0]

/blocks/blocks.0/attn/Div_output_0
-> /blocks/blocks.0/attn/Sqrt_1.input[0]

/blocks/blocks.0/attn/Div_output_0
-> /blocks/blocks.0/attn/Sqrt_2.input[0]

/blocks/blocks.0/mlp/fc1/Add_output_0
-> /blocks/blocks.0/mlp/act/Gelu.input[0]

Expected behavior

I expected Integrated AutoTune to preserve the Q/DQ placement selected by AutoTune while using calibration data to compute the final quantization scales.

This also appears consistent with the existing integration test:

tests/gpu/onnx/quantization/test_autotune_quantization_integration.py

which compares DQ-fed (node_name, input_index) sets between standalone AutoTune and Integrated AutoTune and asserts that they are equal.

Could you please check whether the final Integrated AutoTune model is expected to preserve the exact AutoTune Q/DQ placement, and if so, fix the topology preservation for this ViT case?

I can provide the ONNX models, calibration data, topology comparison script, and full AutoTune/TensorRT logs if needed.

主要言語
Python
スター
5.2k
フォーク
736
平均マージ
4日 2時間
マージ済み PR(30日)
160

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

NVIDIA/Model-Optimizer のほかの issue

NVIDIA/Model-Optimizer の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。