-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Installing JAX across MacOS and Linux. #6956
Comments
seems like another duplicate of #5506 |
I'd rate it highly likely that these are in fact duplicates However so far as I know no-one has really dug into #5506: until they do and the issues are more clearly understood, perhaps we won't be absolutely certain. |
I have a workaround for exactly this :) |
Thanks! For other folks coming by, what jorenham has done is super useful for having a PyPI-compatible JAX package repository, but it doesn't solve the issue here because there aren't non-CUDA/Mac builds of jaxlib available in his package repo. I'm glad to see progress here!
|
Oh well, I was hopeful for @jorenham 's solution, but it still turns out to be thwarted by problems with poetry 1.3.2 dependency handling. Perhaps the simplest reproducing example is the following:
which fails when run on Mac with:
In case having a poetry.lock file is also useful, here is the relevant subset (I left out the numpy/scipy portion):
As you can see above, only wheels with the 0.4.4+cuda11.cudnn86 version are being included in poetry.lock. |
What if you explicitly exclude the versions you don't want, i.e. replacing |
Nice idea, thanks! The resulting poetry lock is unchanged. But, it does make the
|
I'm guessing here, but could it be that the version resolving code only considers the repository in which the first version requirement is found? I can image that there might be an implicit "one package, one repo" assumption. E.g. with |
comments from #6956 (comment) onwards are quite different from the original report (and much simpler! for those the issue is that so far as satisfying requirements goes, |
@dimbleby Out of curiosity, how should JAX handle this CUDA/no-CUDA situation in its releases? I am happy to file an issue with JAX. |
It also seems feasible for Poetry to add something like a “precise” flag that ensures that |
#7256 asking for "arbitrary equality" is close. However this too would be a stretch of the intended use: per the specs, arbitrary equality is supposed to be for handling projects with non-compliant versions - not for handling projects with versions that are compliant, but which they are overloading with extra semantics. the CUDA / non-CUDA thing seems to be difficult for several projects, see never-ending #6409 for another example. It may be that jax / torch etc could do better if they thought hard and came up with some suitable scheme using extras. Or the best thing might be to cut the gordian knot: publish separate packages |
@tbenthompson If you do file an issue, could you link it here so that I can watch it? Also, it may be worth linking jax-ml/jax#5410 so that both issues can be handled at the same time? |
The markers to specify separate versions/sources for different platforms are not working as I would've expected.
jaxlib
With jaxlib, I was able to resolve the problem via a hacky workaround.
The simple version did not work:
With this dependency spec, poetry v1.2.2 will install the +cuda version of the package regardless of the platform.
This seems to be an example of the issue discussed in #6710 and fixed in python-poetry/poetry-core#497
I worked around the issue by specifying like:
Since the version numbers are now different, the darwin install works correctly. The
source="pypi"
was also necessary.jax
With jax, I'm unable to get anything to work in a cross-platform way. As one particular example, I pinned versions to try to get something like the jaxlib hack to work:
In this case, the resolver seems to decide that I want to depend on both version:
details
I previously posted: #6955 and in the comment there, I thought I had fixed this issue, but that was just from looking at the poetry.lock file. Actual testing demonstrated I had been wrong.
Versions:
The text was updated successfully, but these errors were encountered: