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

How to use the onnx-mlir in my own project #1597

Open
ZizhouJia opened this issue Aug 11, 2022 · 4 comments
Open

How to use the onnx-mlir in my own project #1597

ZizhouJia opened this issue Aug 11, 2022 · 4 comments

Comments

@ZizhouJia
Copy link

I want to use the onnx-mlir as a lib rather than as a executable file. I want to known how to use the onnx-mlir in my own project. For example I want to load the onnx file and convert it into a onnx dialect format.

@AlexandreEichenberger
Copy link
Collaborator

I would look at how onnx-mlir uses MLIR, and I suspect you would end up doing something similar, including the onnx-mlir repo at the top level, and then making your own MLIR based driver and adding passes and libraries. If frontend is harder to integrate, you can contemplate running onnx-mlir -EmitONNXIR and then pass the mlir file to your driver.

I suspect someone in the community may already have done what you are looking for. So please chime in, and it would be great if out of this effort, a new docs/IntegratingIntoAnotherMLIRProject.md document would illustrate the steps that you have taken to make it work, and possibly the alternatives that you considered.

@ZizhouJia
Copy link
Author

Thank you for your replay. Another question, do you have plan to add tosa conversion support for onnx-mlir?

@AlexandreEichenberger
Copy link
Collaborator

Yes, I believe there are folks contributing the tosa conversion. It is not something we are driving at this time, please ping the authors of the TOSA PRs and see if you can help them, if that is an important use case for you.

As you know, we at IBM have spearheaded this effort and opened source so that other may use and contribute their use case and benefit from our original work. So you are strongly encouraged to contribute to the use case that matter for your project.

If you wanted to share the work, you can create an issue where folks are indicating ahead of time on which TOSA ops they are working, so as to better coordinate and prevent redundant work.

Tx for your interest.

@chenghuaWang
Copy link

@ZizhouJia Have you successfully integrated onnx-mlir into your MLIR project? I'm writing a small inference framework that needs to take onnx-mlir and convert it to VM-bytecode to this framework. Is there a good way to integrate the onnx dialect definition into my MLIR project?

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

No branches or pull requests

3 participants