# [ONNX][Autotune] Integrated quantization does not preserve AutoTune Q/DQ placement on ViT
メンテナーはふだん 2 日以内に返信
@ajrasane がすでに取り組んでいます。
2026年8月17日 から。
評価
この issue はまだ評価されていません。
説明
[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
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NVIDIA/Model-Optimizer のほかの issue
-
[Bug] modelopt-mcp: all launcher subprocesses hang when the server runs as a stdio MCP server — missing stdin=DEVNULL対応中かも @ChenhanYu が 12 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
NVIDIA/Model-Optimizer#2551 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
Puzzletron Progress 6/8 (calculating one block scores) takes 10 to 20 times more than in tutorial再び着手できるかも @tejasng053 が 18 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
NVIDIA/Model-Optimizer#1667 ·
メンテナーはふだん 2 日以内に返信
-
難易度 3/5 半日 初心者へのやさしさ 72/100
NVIDIA/Model-Optimizer#2810 ·
メンテナーはふだん 2 日以内に返信
-
test_cast_fp4_impl_gpu_mem is flaky on Jetson Thor: mem_get_info reports system-wide memory on integrated GPUs対応中かも @LinCanNerd が 6 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 25/100
NVIDIA/Model-Optimizer#2706 ·
メンテナーはふだん 2 日以内に返信
-
test_cuda_pack_reconstruction_matches_pytorch_at_scale[iq1_m] fails on Jetson Thor: exact ties exceed the blocks // 1000 bound対応中かも @LinCanNerd が 6 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
NVIDIA/Model-Optimizer#2705 ·
メンテナーはふだん 2 日以内に返信
NVIDIA/Model-Optimizer の issue をすべて見る
似ている issue
-
documentation pkg: sphinx-needs
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
useblocks/sphinx-needs#2255 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 60/100
home-assistant/core#186538 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
btclib-org/btclib-secp256k1#1181 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
pyrite-wiki/pyrite#917 ·
メンテナーはふだん 1 日以内に返信