elixir-nx / xla

Pre-compiled XLA extension
Apache License 2.0
83 stars 21 forks source link

Build basic MLIR C-API libraries #69

Open mofeing opened 5 months ago

mofeing commented 5 months ago

I'm interested in using your XLA builds in Julia for the MLIR.jl project, but we need the MLIR-C API to be included.

This PR adds the following Bazel targets:

Adding these targets shouldn't increase the size of the binary, since they are just some C-wrappers over the C++ code.

josevalim commented 5 months ago

Wouldn’t it make more sense to have a build of MLIR without XLA? :)

mofeing commented 5 months ago

We already have that, and while we would like a XLA without LLVM/MLIR (which we could link to Julia's LLVM), I guess it's not entirely possible because libxla_extension.so exports all symbols.

That's why I'm trying with this other option of using libxla_extension also as our MLIR lib.

josevalim commented 5 months ago

If they export all symbols, I guess they would conflict with each other when loading the .so? I am asking because we might be going on a similar path soon. :)