|
| 1 | +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. |
| 2 | +# SPDX-License-Identifier: Apache-2.0 |
| 3 | +# |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
| 15 | + |
| 16 | +"""Pattern-based Q/DQ autotuning for ONNX models. |
| 17 | +
|
| 18 | +Optimizes Q/DQ node placement in ONNX graphs to minimize TensorRT inference latency |
| 19 | +using hierarchical region analysis and pattern-based scheme reuse. |
| 20 | +""" |
| 21 | + |
| 22 | +from modelopt.onnx.quantization.autotune.common import ( |
| 23 | + AutotunerError, |
| 24 | + AutotunerNotInitializedError, |
| 25 | + Config, |
| 26 | + InsertionScheme, |
| 27 | + InvalidSchemeError, |
| 28 | + PatternCache, |
| 29 | + PatternSchemes, |
| 30 | + Region, |
| 31 | + RegionError, |
| 32 | + RegionType, |
| 33 | +) |
| 34 | + |
| 35 | +from .insertion_points import ( |
| 36 | + ChildRegionInputInsertionPoint, |
| 37 | + NodeInputInsertionPoint, |
| 38 | + RegionOutputInsertionPoint, |
| 39 | + ResolvedInsertionPoint, |
| 40 | +) |
| 41 | +from .region_pattern import RegionPattern |
| 42 | +from .region_search import CombinedRegionSearch |
| 43 | + |
| 44 | +__all__ = [ |
| 45 | + "AutotunerError", |
| 46 | + "AutotunerNotInitializedError", |
| 47 | + "ChildRegionInputInsertionPoint", |
| 48 | + "CombinedRegionSearch", |
| 49 | + "Config", |
| 50 | + "InsertionScheme", |
| 51 | + "InvalidSchemeError", |
| 52 | + "NodeInputInsertionPoint", |
| 53 | + "PatternCache", |
| 54 | + "PatternSchemes", |
| 55 | + "Region", |
| 56 | + "RegionError", |
| 57 | + "RegionOutputInsertionPoint", |
| 58 | + "RegionPattern", |
| 59 | + "RegionType", |
| 60 | + "ResolvedInsertionPoint", |
| 61 | +] |
0 commit comments