-
Notifications
You must be signed in to change notification settings - Fork 374
Fix some bugs in onnxmlirtorch package #3319
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
Conversation
Signed-off-by: Tung D. Le <[email protected]>
| add_custom_target(OMCreateONNXMLIRTorchPackage | ||
| COMMAND cp -r ${CMAKE_CURRENT_SOURCE_DIR}/onnxmlirtorch ${CMAKE_CURRENT_BINARY_DIR} | ||
| COMMAND cp ${ONNX_MLIR_BIN_ROOT}/${CMAKE_BUILD_TYPE}/lib/PyRuntimeC.*.so ${CMAKE_CURRENT_BINARY_DIR}/onnxmlirtorch/src/onnxmlirtorch/ | ||
| COMMAND cp ${ONNX_MLIR_BIN_ROOT}/${CMAKE_BUILD_TYPE}/lib/PyRuntimeC.*.so ${CMAKE_CURRENT_BINARY_DIR}/onnxmlirtorch/src/onnxmlirtorch/libs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing libs folder so that OMExecutionSession was not found.
| def __init__(self, model_path, **kwargs): | ||
| self.debug = False | ||
| self.session = None | ||
| self.output_dir = tempfile.TemporaryDirectory() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to keep this temp folder, so move it to the class member. Otherwise, the temp folder is cleaned up automatically.
|
Jenkins s390x sometimes failed because of a bug that is fixed in #3302. |
Signed-off-by: Tung D. Le <[email protected]>
Signed-off-by: Tung D. Le <[email protected]>
| cache_size = 3 | ||
|
|
||
|
|
||
| glocalSessionCache = SessionCache(config.cache_size) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make it global. Otherwise, the cache is local to each pytorch call to the backend.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
|
Jenkins Linux s390x Build #17586 [push] Fix some bugs in onnxmli... started at 01:01 |
|
Jenkins Linux amd64 Build #17579 [push] Fix some bugs in onnxmli... started at 00:01 |
|
Jenkins Linux s390x Build #17586 [push] Fix some bugs in onnxmli... passed after 1 hr 33 min |
|
Jenkins Linux amd64 Build #17579 [push] Fix some bugs in onnxmli... passed after 1 hr 42 min |
I have tried to run an example
torch_compile_add.pythat usestorch.compile(mod, backend=onnxmlirtorch.onnxmlir_backend. Compilation is done in the local environment, not a docker image. I found some errors such as:and
This patch is to fix such errors and now
torch_compile_add.pyis runnable in my environment.