Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[onnx/ort] Convert transformer optimizations using custom-ops to functions for optimizer/rewriter usage #1766

Open
9 tasks
shubhambhokare1 opened this issue Jul 30, 2024 · 1 comment

Comments

@shubhambhokare1
Copy link
Contributor

shubhambhokare1 commented Jul 30, 2024

There are a few commonly used transformer-based optimizations using custom-ops in onnxruntime some of which are listed.

Custom ops to be converted to functions for ONNX Script (will add more custom ops based on findings and priority) :

Tasks

The goal is to create an infrastructure via which these custom-ops can be stored as functions for ease of usage with the optimizer and rewriter tools. If the functions are not desired in the graph, the graph can be simply inlined to get back to the original form.

Road-map for this task:

Tasks

@gramalingam Feel free to edit/add any more information that I might have missed regarding this item.

@gramalingam
Copy link
Collaborator

LGTM, thanks! What we want to do is:

  1. Define these as ONNX functions (and test/validate them)
  2. Extend the ONNX standard by adding these as function-ops
  3. Potentially use these in a rewriting-optimizer (that identifies matches to the function-body and extracts them out as either model-local functions or standard ONNX ops, if they have been added to the ONNX standard as in step 2).

For steps 1 and 2, the corresponding custom op definition in ORT is also a helpful starting point.

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

No branches or pull requests

2 participants