Skip to content

Conversation

@abhishek-singh591
Copy link
Contributor

@abhishek-singh591 abhishek-singh591 commented Nov 17, 2025

ONNX Functions Export Support

Overview

This PR introduces support for exporting ONNX modules as functions, enabling more efficient model compilation and execution on hardware.

Key Changes

  • Added a new flag use_onnx_subfunctions to control ONNX function export behavior.
  • Integrated ONNX function export capability into the inference pipeline.

How to Enable ONNX Function Export

Set the flag before running inference (either during export or compile):

model.export(tmp_path, use_onnx_subfunctions=True)

Backward Compatibility

This feature is opt-in and requires an explicit environment variable. Existing workflows remain unaffected when the flag is disabled.

@vbaddi
Copy link
Contributor

vbaddi commented Nov 18, 2025

Let's keep it uniform. Can we rename use_subfunctions to use_onnx_subfunctions?

@abhishek-singh591
Copy link
Contributor Author

Let's keep it uniform. Can we rename use_subfunctions to use_onnx_subfunctions?

done.

@vbaddi
Copy link
Contributor

vbaddi commented Nov 18, 2025

Let's keep it uniform. Can we rename use_subfunctions to use_onnx_subfunctions?

done.

Please modify the PR commit message and desp. accordingly. thanks

Copy link
Contributor

@ochougul ochougul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review WIP.

abhishek-singh591 and others added 5 commits November 19, 2025 06:52
Signed-off-by: abhishek-singh591 <[email protected]>
Fix for this JIRA from Imagine team

Signed-off-by: Ann Kuruvilla <[email protected]>
Signed-off-by: abhishek-singh591 <[email protected]>
Signed-off-by: abhishek-singh591 <[email protected]>
@quic-rishinr
Copy link
Contributor

@abhishek-singh591 please rebase the PR

Copy link
Contributor

@vbaddi vbaddi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks 👍

Signed-off-by: abhishek-singh591 <[email protected]>
Signed-off-by: abhishek-singh591 <[email protected]>
Copy link
Contributor

@ochougul ochougul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. Add todo for CustomOpTransform and merge once CI is passing.

@ochougul ochougul merged commit 30c334b into quic:main Nov 19, 2025
5 checks passed
@ochougul ochougul mentioned this pull request Nov 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.21.0 enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants