-
Notifications
You must be signed in to change notification settings - Fork 7
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
Update all dependencies. #12
Conversation
The current import was non-functional, and that only remained unnoticed because there is no BUILD dependency to JAX, so JAX isn't actually built. (The CI tests install JAX through pip, so the JAX dependency isn't needed there.) The fix consists in moving the configuration from JAX's WORKSPACE file (which is emptied when imported via `http_archive`) to the WORKSPACE file of this project (plus fixing how its dependency `ducc` is loaded). Now adding `@jax//jax` to some of the build targets actually (and successfully) builds JAX.
acaa8c7
to
3cba4bf
Compare
This PR updates the following dependencies in the WORKSPACE file to a version from around November 2: * LLVM * XLA * JAX (even though there is no actual BUILD dependency) * Enzyme The PR also adds direct dependencies to the following projects: * rules_cc (because LLVM requires a newer version than the one that XLA imports)
3cba4bf
to
68deb3f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I am done: CI passes :)
@ftynse: Could you or one of your collaborators have a look to check if I do anything stupid (in particular in how to use Bazel)?
@@ -14,10 +28,10 @@ http_archive( | |||
) | |||
|
|||
load("@llvm-raw//utils/bazel:configure.bzl", "llvm_configure") | |||
llvm_configure(name = "llvm-project", targets = ["X86", "AArch64", "AMDGPU", "ARM", "NVPTX"]) | |||
llvm_configure(name = "llvm-project", targets = LLVM_TARGETS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this ~intentionally breaks the regexes in the CI pipelines that replace the build targets depending on the CI target. This doesn't work anymore since XLA (I believe) always requires X86CodeGen
to be present, so the X86 target is always required.
It might be possible to adapt the regexes accordingly but since (one of) the pipelines are (is) signed, I didn't do that change.
|
||
py_package( | ||
name = "enzyme_jax_data", | ||
# Only include these Python packages. | ||
packages = ["@//enzyme_jax:enzyme_call.so", "@llvm-project//clang:builtin_headers_gen"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Warning: I don't understand what packages
is supposed to do. If I use the line as is, the .so
file is not included in the wheel...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it's supposed to force the so (And those headers) to be made available in the pip package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does look like CI thinks that it can no longer find them, so we may need something else here (it worked in the past so I'm not sure what would've changed, and I'm curious if putting it back fixes anything)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When it was there, CI broke. I could observe the same behavior locally: only the py files ended up in the wheel. I don't know what changed, though...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah so the problem is that the package.bzl
forces the dependencies to be included as well, so by getting rid of our version of package.bzl you've removed the ability to import the actual dependencies.
Revert back to our package.bzl and see if it works?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have also tried that. I started looking into the wheel rule because it broke, even before updating rules_python. Also, the old package.bzl doesn't have filtering logic for all I can tell.
Is there anything in the current behavior that is undesirable?
@@ -29,19 +27,15 @@ cc_library( | |||
], | |||
) | |||
|
|||
load("@rules_python//python:packaging.bzl", "py_wheel") | |||
|
|||
load(":package.bzl", "py_package") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By reading the code, I had the feeling that the package.bzl
from this repo had no effect other than calling the function of the same name in rules_python
(plus allowing but not using the prefix
parameter), so I removed it.
68deb3f
to
10f8438
Compare
I went through the packing rule again. If I revert the last commit, i.e., all changes to that rule, then the resulting python -c "from zipfile import ZipFile; from pprint import pprint; pprint(ZipFile('bazel-bin/enzyme_jax-0.0.5-py3-none-manylinux2014_x86_64.whl').namelist())" | grep \\.so
# no output Commenting out the In short, after the changes in the previous commits, only the fixes in the last commit lead to a valid wheel. (I just force-pushed an updated last commit where I remove the comment for the also-removed |
OK, I investigated more. Values in the |
10f8438
to
bdcd27b
Compare
OK, I fixed another bunch of problems. I am able to run |
ebe784a
to
12c4999
Compare
12c4999
to
0a6155d
Compare
You made it work :) Kudos! |
This PR depends on and therefore includes #10.
This PR updates the following dependencies in the WORKSPACE file to a
version from around November 2:
The PR also adds direct dependencies to the following projects:
imports)
For context: @ftynse pointed me to this repo to copy the Bazel recipe to another project that depends on JAX and I didn't make it work there yet. Since I got stuck on that project, I came back to this one to see if I can make it work here. Turns out I could. I hope that this will serve me as a good base to get the other project to work as well. I don't need this project currently, but since I grinded through making it work, you might as well benefit from it ;)