Skip to content

Commit e1aada0

Browse files
One config for onnx
1 parent 9a03e29 commit e1aada0

39 files changed

+1188
-1174
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ limitations under the License.
2828
- change: Install the TensorRT package for architectures other than x86_64
2929
- change: Disable conversion fallback for TensorRT paths and expose control option in custom config
3030
- change: Use torch.export.save for Torch-TRT model serialization
31+
- change: Added export_engine to OnnxConfig for improved export control
3132
- fix: Correctness command relative tolerance formula
3233
- fix: Memory management during export and conversion process for Torch
3334

examples/09_custom_configurations_for_optimize/optimize.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,17 @@ def get_onnx_config():
6464
- PyTorch -> ONNX
6565
- TorchScript Script -> ONNX
6666
- TorchScript Trace -> ONNX
67+
- Torch Dynamo -> ONNX
6768
6869
From each ONNX different TensorRT plan will be produced.
6970
"""
7071
return nav.OnnxConfig(
7172
opset=17,
7273
onnx_extended_conversion=True,
74+
export_engine=[
75+
nav.OnnxTraceExportConfig(),
76+
nav.OnnxDynamoExportConfig(),
77+
],
7378
)
7479

7580

model_navigator/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
MaxThroughputWithLatencyBudgetStrategy,
2424
MinLatencyStrategy,
2525
OnnxConfig,
26+
OnnxDynamoExportConfig,
27+
OnnxTraceExportConfig,
2628
OptimizationProfile,
2729
SelectedRuntimeStrategy,
2830
TensorFlowConfig,

model_navigator/commands/convert/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def _execute_single_conversion(
9191
max_batch_size = cls._get_conversion_max_batch_sizes(device_max_batch_size, dataloader_max_batch_size)
9292

9393
LOGGER.info(
94-
"""Search for maximal batch size disable. Execute single conversion with max_batch_size %d. """
94+
"""Search for maximal batch size disable. Execute single conversion with max_batch_size {}. """
9595
"""In order to execute fallback strategy provide `conversion_fallback=True` in custom configuration.""",
9696
max_batch_size,
9797
)

model_navigator/commands/export/exporters/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
if is_torch2_available():
2424
from . import (
25-
torch2dynamo_onnx, # noqa: F401
2625
torch2exportedprogram, # noqa: F401
2726
)
2827

model_navigator/commands/export/exporters/torch2dynamo_onnx.py

Lines changed: 0 additions & 193 deletions
This file was deleted.

0 commit comments

Comments
 (0)