KEMBAR78
[ONNX] Auto-fallback in torch.onnx.export(..., dynamo=True) with deprecation warning · Issue #151714 · pytorch/pytorch · GitHub
Skip to content

[ONNX] Auto-fallback in torch.onnx.export(..., dynamo=True) with deprecation warning #151714

@titaiwangms

Description

@titaiwangms

In the current implementation of torch.onnx.export(..., dynamo=True), certain TorchScript-based operations are not supported. To ensure a smooth user experience, we should implement an automatic fallback mechanism with a deprecation warning. This fallback should handle cases where only the TorchScript-based exporter can process the export, such as:

  1. When the input model is a torch.jit.ScriptModule or torch.jit.ScriptFunction, as these are specifically designed for TorchScript.
  2. When custom_opsets is provided, since torch.onnx.export(..., dynamo=True) uses custom_translation_table instead.
  3. When dynamic_axes is provided, because the automatic conversion of dynamic_axes to dynamic_shapes does not cover all scenarios.

Metadata

Metadata

Assignees

Labels

module: onnxRelated to torch.onnxonnx-triagedtriaged by ONNX teamtriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions