-
Notifications
You must be signed in to change notification settings - Fork 516
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
Added JIT to MLIR lowering #724
Added JIT to MLIR lowering #724
Conversation
7114ed3
to
79b183d
Compare
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.
what's your general testing strategy for the backend? Are you going to write unittests with FileCheck? something like this perhaps? https://github.com/llvm/torch-mlir/blob/main/test/python/importer/jit_ir/node_import/prim.py
I don't think we have solid plans for writing tests yet, but I think |
python/torch_mlir/csrc/base_lazy_backend/mlir_lowering_context.cpp
Outdated
Show resolved
Hide resolved
2de2f11
to
4b83a47
Compare
f2c6e82
to
9a41d6c
Compare
Lowering to JIT is performed in a way similar to how it's done in the TS LTC backend. After a jit::Graph is constructed, it gets converted to a jit::Function, which is fed into the existing utility to generate an MlirModule in torch-mlir.
9a41d6c
to
f882273
Compare
f882273
to
c802a94
Compare
* Added JIT to MLIR lowering Lowering to JIT is performed in a way similar to how it's done in the TS LTC backend. After a jit::Graph is constructed, it gets converted to a jit::Function, which is fed into the existing utility to generate an MlirModule in torch-mlir. * Renamed `csrc/backend` to `csrc/base_lazy_backend`
* Added JIT to MLIR lowering Lowering to JIT is performed in a way similar to how it's done in the TS LTC backend. After a jit::Graph is constructed, it gets converted to a jit::Function, which is fed into the existing utility to generate an MlirModule in torch-mlir. * Renamed `csrc/backend` to `csrc/base_lazy_backend`
* Added JIT to MLIR lowering Lowering to JIT is performed in a way similar to how it's done in the TS LTC backend. After a jit::Graph is constructed, it gets converted to a jit::Function, which is fed into the existing utility to generate an MlirModule in torch-mlir. * Renamed `csrc/backend` to `csrc/base_lazy_backend`
* Added JIT to MLIR lowering Lowering to JIT is performed in a way similar to how it's done in the TS LTC backend. After a jit::Graph is constructed, it gets converted to a jit::Function, which is fed into the existing utility to generate an MlirModule in torch-mlir. * Renamed `csrc/backend` to `csrc/base_lazy_backend`
* Added JIT to MLIR lowering Lowering to JIT is performed in a way similar to how it's done in the TS LTC backend. After a jit::Graph is constructed, it gets converted to a jit::Function, which is fed into the existing utility to generate an MlirModule in torch-mlir. * Renamed `csrc/backend` to `csrc/base_lazy_backend`
* Added JIT to MLIR lowering Lowering to JIT is performed in a way similar to how it's done in the TS LTC backend. After a jit::Graph is constructed, it gets converted to a jit::Function, which is fed into the existing utility to generate an MlirModule in torch-mlir. * Renamed `csrc/backend` to `csrc/base_lazy_backend`
* Added JIT to MLIR lowering Lowering to JIT is performed in a way similar to how it's done in the TS LTC backend. After a jit::Graph is constructed, it gets converted to a jit::Function, which is fed into the existing utility to generate an MlirModule in torch-mlir. * Renamed `csrc/backend` to `csrc/base_lazy_backend`
* Added JIT to MLIR lowering Lowering to JIT is performed in a way similar to how it's done in the TS LTC backend. After a jit::Graph is constructed, it gets converted to a jit::Function, which is fed into the existing utility to generate an MlirModule in torch-mlir. * Renamed `csrc/backend` to `csrc/base_lazy_backend`
* Added JIT to MLIR lowering Lowering to JIT is performed in a way similar to how it's done in the TS LTC backend. After a jit::Graph is constructed, it gets converted to a jit::Function, which is fed into the existing utility to generate an MlirModule in torch-mlir. * Renamed `csrc/backend` to `csrc/base_lazy_backend`
* Added JIT to MLIR lowering Lowering to JIT is performed in a way similar to how it's done in the TS LTC backend. After a jit::Graph is constructed, it gets converted to a jit::Function, which is fed into the existing utility to generate an MlirModule in torch-mlir. * Renamed `csrc/backend` to `csrc/base_lazy_backend`
* Added JIT to MLIR lowering Lowering to JIT is performed in a way similar to how it's done in the TS LTC backend. After a jit::Graph is constructed, it gets converted to a jit::Function, which is fed into the existing utility to generate an MlirModule in torch-mlir. * Renamed `csrc/backend` to `csrc/base_lazy_backend`
* Added JIT to MLIR lowering Lowering to JIT is performed in a way similar to how it's done in the TS LTC backend. After a jit::Graph is constructed, it gets converted to a jit::Function, which is fed into the existing utility to generate an MlirModule in torch-mlir. * Renamed `csrc/backend` to `csrc/base_lazy_backend`
* Added JIT to MLIR lowering Lowering to JIT is performed in a way similar to how it's done in the TS LTC backend. After a jit::Graph is constructed, it gets converted to a jit::Function, which is fed into the existing utility to generate an MlirModule in torch-mlir. * Renamed `csrc/backend` to `csrc/base_lazy_backend`
* Added JIT to MLIR lowering Lowering to JIT is performed in a way similar to how it's done in the TS LTC backend. After a jit::Graph is constructed, it gets converted to a jit::Function, which is fed into the existing utility to generate an MlirModule in torch-mlir. * Renamed `csrc/backend` to `csrc/base_lazy_backend`
* Build JNI on Windows This change makes JNI buildable on Windows. It also cleans up the logic for determining when to build JNI and adds the necessary dependency to MainUtils Signed-off-by: Stella Stamenova <[email protected]> * Undo a change made by clang-format locally because clang-format in the builds is complaining about it Signed-off-by: Stella Stamenova <[email protected]> * Check for null Signed-off-by: Stella Stamenova <[email protected]> * Make clang-format happy Signed-off-by: Stella Stamenova <[email protected]> Co-authored-by: Kevin O'Brien <[email protected]>
This PR adds the ability to generate MLIR using a custom LTC backend.
Lowering to JIT is performed in a way similar to how it's done in the TS LTC backend. After a
jit::Graph
is constructed, it gets converted to ajit::Function
, which is fed into the existing utility to generate an MLIR in torch-mlir.Note: This PR is based on #723, but GitHub does not allow for setting the base to a fork while keeping this PR in the upstream repo, so there are several shared commits. Only the last one is specifically part of this PR.
A future PR will include an example implementation and usage of the custom backend.
Marked as draft while waiting for a dependency PR to land: #723
cc: @antoniojkim @ke1337