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 python bindings #421

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Add python bindings #421

wants to merge 2 commits into from

Conversation

j2kun
Copy link
Collaborator

@j2kun j2kun commented Feb 2, 2024

In-progress work adding python bindings to HEIR

@j2kun j2kun marked this pull request as draft February 2, 2024 19:31
@j2kun
Copy link
Collaborator Author

j2kun commented Feb 8, 2024

On 2024-01-26 Maksim Levental and I were exploring this on a livestream and found that the python binding support for bazel in upstream MLIR was hard-coded to tensorflow's configuration decisions (see llvm/llvm-project#79676 and https://github.com/j2kun/test_mlir_bazel_pybind). That resulted in the upstream fix to the bazel build rules getting merged and so we can proceed with adding HEIR-specific python bindings here.

@j2kun
Copy link
Collaborator Author

j2kun commented Feb 12, 2024

After another session with @makslevental, we got to the point in these two related PRs

Where we can build the python bindings, but then trying to run the hello world script results in the following error at https://github.com/llvm/llvm-project/blob/5fc28e7a8d989fffafec2301529d0164a28799b2/mlir/include/mlir/IR/StorageUniquerSupport.h#L161

LLVM ERROR: Registering an interface for an attribute/type that is not itself registered.

Putting print statements at that location to show the list of registered dialects and types, it shows only the builtin dialect types have been registered

REGISTERED Types:
builtin.builtin.tuple
builtin.builtin.f32
builtin.builtin.memref
builtin.builtin.f128
builtin.builtin.unranked_memref
builtin.builtin.none
builtin.builtin.function
builtin.builtin.unranked_tensor
builtin.builtin.vector
builtin.builtin.opaque
builtin.builtin.tensor
builtin.builtin.index
builtin.builtin.integer
builtin.builtin.f64
builtin.builtin.f80
builtin.builtin.bf16
builtin.builtin.f16
builtin.builtin.f8E4M3FN
builtin.builtin.f8E5M2FNUZ
builtin.builtin.f8E4M3FNUZ
builtin.builtin.complex
builtin.builtin.f8E5M2
builtin.builtin.tf32
builtin.builtin.f8E4M3B11FNUZ

However, the registration code in InitAllDialects runs before this without error.

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.

None yet

1 participant