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

Add bazel configs for some C APIs and pybinds #3879

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tkocmathla
Copy link

This PR improves bazel support by adding rules for building the following:

  • C API binding for torch-mlir-c/Registration.h
  • C API binding for torch-mlir-c/Dialects.h
  • pybind11 extension module for torch dialect
  • Tablegen'd Python wrapper classes for torch ops
  • Filegroups for Python files

Closes #3787.

@tkocmathla tkocmathla marked this pull request as ready for review November 15, 2024 22:00
@tkocmathla
Copy link
Author

@sjain-stanford are you the right person to review this? this is a follow up to our discord conversation.

Copy link
Member

@sjain-stanford sjain-stanford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @tkocmathla . As it stands, there is no way to test these python interfaces. Can you please add some python test targets that depend on these (and hence are tested in CI)? You probably need a hermetic python interpreter setup in bazel as well.

@@ -923,3 +924,96 @@ cc_binary(
"@llvm-project//mlir:MlirOptLib",
],
)

# C API bindings
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For isolation and ease of maintenance, I'd suggest creating a separate python/BUILD.bazel to host everything below.

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 this pull request may close these issues.

Bazel configuration missing for Python bindings?
2 participants