-
-
Notifications
You must be signed in to change notification settings - Fork 267
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
Pex fails when used in conjunction with Pytorch #527
Comments
Additional info: the above code was run on Mac and breaks. On Linux PyTorch uses a However forced setting of the sharing strategy:
makes it also fail on linux. So the conclusion is that something in the Adding |
OK, root cause is I think we can work around this by subclassing ZipFile :/ And WOW - torch is a ~400MB wheel. That's getting to be the size of a docker image. |
Previously, a zipped pex would lose permission bits when exracted to the filesystem for `--not-zip-safe` pexes or `PEX_FORCE_LOCAL` runs. This was due to an underlying bug in the `zipfile` stdlib tracked here: https://bugs.python.org/issue15795 Work around the bug in `zipfile.Zipfile` by extending it and running a chmod'ing cleanup whenever `extract` or `extractall` is called. Fixes pex-tool#527
Thanks @jsirois, nice find! Thanks for the quick fix too :). The reason torch is so big is that it has a bunch of precompiled CUDA kernels inside. We've had some discussions with them in the past to make it smaller, but it seems like cutting it down further is either a lot of work or leads to cutting features. |
Previously, a zipped pex would lose permission bits when exracted to the filesystem for `--not-zip-safe` pexes or `PEX_FORCE_LOCAL` runs. This was due to an underlying bug in the `zipfile` stdlib tracked here: https://bugs.python.org/issue15795 Work around the bug in `zipfile.Zipfile` by extending it and running a chmod'ing cleanup whenever `extract` or `extractall` is called. Fixes #527
The following code:
Runs fine with a python interpreter with pytorch and numpy installed:
But fails with pex:
Relevant info from the PyTorch guys on what they're doing is here: https://pytorch.org/docs/stable/multiprocessing.html#file-system-file-system
The text was updated successfully, but these errors were encountered: