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

Bazel configuration missing for Python bindings? #3787

Open
tkocmathla opened this issue Oct 11, 2024 · 0 comments · May be fixed by #3879
Open

Bazel configuration missing for Python bindings? #3787

tkocmathla opened this issue Oct 11, 2024 · 0 comments · May be fixed by #3879

Comments

@tkocmathla
Copy link

tkocmathla commented Oct 11, 2024

I'm interested in using the torch-mlir python bindings in a project that uses Bazel as its build system. Based on the developer docs, it seems like the Bazel configs for torch-mlir are mostly focused on supporting torch-mlir-opt, and indeed I don't see any CAPI or Python binding rules in the main Bazel build file.

I think what's needed to do this is:

  • The CAPI library (from torch-mlir-c/Dialects.h). This can be built with mlir_c_api_cc_library from @llvm-project//mlir:build_defs.bzl.
  • The pybind11 extension library (from python/TorchMLIRModule.cpp).
  • A tablegen rule to generate the Python wrapper code for ops (_torch_ops_gen.py).
  • (Maybe) A convenience py_library that bundles the above and any MLIR Python dependencies.

There are examples of these in the MLIR project's Bazel file.

Is there interest in this from the maintainers? I'd be willing to contribute these changes if so.

@tkocmathla tkocmathla linked a pull request Nov 15, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant