Closed seanmor5 closed 3 years ago
Awesome job @seanmor5!
A couple notes:
We should probably document those steps somewhere
About 5, should we explicit list which headers we want to keep?
@josevalim Steps 1-4 can be resolved by remapping paths into the top-level include generated in the tarball, I am doing it now and it should be fixed soon.
For 5, the problem is I don't know what headers are actually required - and some of them may end up being target and platform dependent.
@seanmor5 I see. How many MBs of headers are we talking about here?
Compressed the total size of the tarball is 90MB. Uncompressed the include
dir is 178MB and the .so is 286MB
I've fixed all the above issues and was able to pass all of the test/exla/defn_expr_test.exs
tests. I had to get rid of references to AOT compilation as that is not included in this setup and will not work with this approach. There is a test which crashes on a shape check that I am looking into. Both of those issues are directly related to EXLA though and not necessarily tied into the extension
Amazing! The build succeeded for me locally and also in a CI setup both on Ubuntu and macOS. Worth noting that the CI finished notably faster than building EXLA (example).
FTR initially I run into errors regarding python version locally and resolved this with export PYTHON_BIN_PATH=/usr/bin/python3.9
.
Merging this as a consequence of #2, we can also revisit the Tensorflow versioning later.
Builds a tarball with XLA dependencies including all required headers and a single shared-object which can be linked in to other executables to make use of TensorFlow XLA without Bazel, Python, NumPy, and the rest of the TensorFlow build stuff.
As is this works, but I had to a do some troubleshooting manually that should be automated:
xla_data.pb.h
cannot findport_def.inc
.port_def.inc
is apparently a file from Google protobuf. I fixed this by finding the location of my TensorFlow installation and then adding-I$(TF_INCLUDE_DIR)
. We need to find a way to ensure that's packaged into the tarball without depending on a global TF installgrpcpp/grpcpp.h
not found inpjrt/distributed/channel.h
. GRPCPP is included in aninclude
dir which somehow gets mapped inside the top-levelinclude
dir, this can be fixed by moving GRPCPP frominclude/include/grpcpp
toinclude/grpcpp
. We can automate this with some bazel magic I think.llvm/target/TargetMachine.h
not found inxla/service/cpu
. Anllvm
folder exists in the top-level include, but XLA is actually looking for the contents ofllvm/include/llvm
- so movingllvm/include/llvm
to top-level include directory fixes this. Again this is a problem with how Bazel is mapping some of these paths/includesxla/client/lib/lu_decomposition.h
not found. For some reason this header gets lost? I guess we can copy it in somehow - that's what I did.The current rules package A LOT of transitive headers and dependencies. Honestly not sure which ones are necessary. I manually deleted like 80% of the folders generated inside
include
and everything worked just fine, but I'm not sure if that's going to base the case in every circumstance.