onnx-mlir
onnx-mlir copied to clipboard
Add Python interface for compilation and one single interface for compilation and running process
An ONNX model can be compiled directly using the onnx-mlir -O3 --EmitLib
command. The resulting library can then be executed using Python. At times, it might be convenient to also compile a model directly in Python. We explores the Python methods to do so. And we also design an interface to package the compilation and operation of the model.
Can one of the admins verify this patch?
@Jiaqing-ASU great, will review once #1683 has landed... thanks for working on this
@Jiaqing-ASU great, will review once #1683 has landed... thanks for working on this
Please allow some time for me to modify some of the code in this PR after #1683 has landed. I will make this PR Ready to review
once I am done. Many thanks!
PR landed now, so you can update your changes with the latest main branch.
Can one of the admins verify this patch?
Can one of the admins verify this patch?
Can one of the admins verify this patch?
@jenkins-droid test this please
Can one of the admins verify this patch?
updating branch
Can one of the admins verify this patch?
updated the branch to run all cis
updated the branch to run all cis
@AlexandreEichenberger Thanks for the merge. I guess this will pass the tests since it works in my environment. However, this are still several things of the new constructor need to be modify. I am working on this. Maybe you could review this later. Many thanks.
yes, ping me when you feel its in a state where reviewing it make sense.
Can one of the admins verify this patch?
Can one of the admins verify this patch?
updated to restart also the jenkins
Can one of the admins verify this patch?
Can one of the admins verify this patch?
Can one of the admins verify this patch?
The "undefined symbol" issues have been fixed by making the new class a subclass of onnx_mlir::ExecutionSession instead of onnx_mlir::PyExecutionSession. It now works very well. However, for now, there are about 150 lines of redundant code in onnx_mlir::PyExecutionSession and onnx_mlir::PyCompileExecutionSession. I think this can be fixed later or maybe there are other better solutions to solve this problem. @AlexandreEichenberger Please take a look at all the code and let me know if there is anything that needs to be fixed or you have any suggestions. Many thanks!
Gave you comments on the interface itself. Will review code a bit later
No problem. Thanks for the helpful comments! I will fix all those comments one by one tomorrow. BTW, do you know why one of the checks MLIR-Windows-CI
failing? How should I fix that?
Can one of the admins verify this patch?
Can one of the admins verify this patch?
Can one of the admins verify this patch?
Can one of the admins verify this patch?
No problem. Thanks for the helpful comments! I will fix all those comments one by one tomorrow. BTW, do you know why one of the checks MLIR-Windows-CI failing? How should I fix that?
I don't have access to a window machine; I usually try to see from the failure log, if one is lucky, it is a compile error that one can typically google to find an answer. If one needs to run it, I ask some of the Microsoft folks to help. They can often tell you "oh, this is a well known difference, try this" type of comments
I don't have access to a window machine; I usually try to see from the failure log, if one is lucky, it is a compile error that one can typically google to find an answer. If one needs to run it, I ask some of the Microsoft folks to help. They can often tell you "oh, this is a well known difference, try this" type of comments
Hello @AlexandreEichenberger I took a look at the errors and also searched on Google. The error is from a warning (it shows the following warning is treated as an error
) which is called Compiler Warning (level 1) C4530. This warning is from the beginning of PYBIND11_MODULE(PyCompile, m)
. I have compared this part with the PyRuntime and they use exactly the same format. I am not sure whether I need to add /EHsc
to compile to resolve the warning or not because I did not see this stuff in the previous Runtime CMakeLists. Another interesting thing is that this kind of warning is typically from some code using C++ exception handling but I do not think PyOMCompileSession.hpp has this kind of exception handling. I guess I need some hints or help on this error. Many thanks!
Can one of the admins verify this patch?
@Jiaqing-ASU if you still have the error, ask @sstamenova to help you, there are ways to disable the warning as errors for sections of the code.