Skip to content

Conversation

@smedhe
Copy link
Contributor

@smedhe smedhe commented Nov 24, 2025

This PR introduces ONNX export functionality using TorchDynamo with the following enhancements:

  • Custom Ops Registration
    Added fake registration for custom operators to enable successful graph tracing during export.

  • Dynamic Axes → Dynamic Shapes Conversion
    Implemented logic to convert dynamic axes specifications into dynamic shape handling for ONNX export.

  • Caching Utilities Integration
    Updated cache utilities to support ONNX export workflows.

  • Causal LM Models
    Verified that causal language models now successfully export and compile using the new pipeline. The generated onnx file gives correct output on onnxruntime.

  • Vision-Language Models (VLM)
    Added get_onnx_dynamic_shapes() function across 5 VLM modeling files to handle dynamic shape inference.
    Note: VLM models currently export successfully but fail during compilation (work in progress).

  • Dependencies
    Tested with:
    PyTorch: 2.9.1
    Transformers: 4.55
    Latest ONNX, onnxscript, and onnxruntime libraries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants