-
Notifications
You must be signed in to change notification settings - Fork 621
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
Add pyproject toml #743
base: main
Are you sure you want to change the base?
Add pyproject toml #743
Conversation
@danthe3rd something wrong in CI? There is no change on dependencies and I have tested installation on my machine. CI LOG:
I added torch requirement in build system which lead it re-install torch==2.0 again, then break CI test |
CI test failed because build isolation, so need add
|
Hi, and thanks for opening this PR! I'm not sure what is the correct way of doing this. Indeed, we need pytorch to be installed first. And more than that: we need the exact same version at build-time AND run-time. I believe that's why the CI fails. |
Hi, This was somewhat recently added to torchvision in pytorch/vision#6230 , and I haven't looked into that before. There is a comment from @pmeier there mentioning possible issues with this approach (i.e., picking the wrong PyTorch, which seems to be the case here), and there was no solution found at the moment. So for now I don't have a fix for this. |
My comment pytorch/vision#6230 (comment) is still valid. I'm not familiar with the |
Hi I make a brief conclusion:
To fix this CI: |
PR Impact Conclusion:Install from wheel:no impact Install from source(from source.tar.gz or install from git repo):The installation build system will download and install a Temporary torch in isolation env and delete them after installation. After build done, if you do not meet the install requirements(requirements.txt), then install all requirements such as torch, numpy, etc. just like things to install requirements. If you already have torch install and don't want to install again in the isolation env, build in your existed env, then add flag There is no need to install torch first and then install xformers!😆 |
Following the comments from @pmeier and the potential problems that adding the Given that compiling xformers requires the exact same version of PyTorch during build time and runtime, this seems like it will cause a number of issues in the future IMO. I think we should just update our readme to first ensure that we have PyTorch installed prior to running the xformers installation command |
@fmassa the problem occurs for me with |
What does this PR do?
Fixes #740.
When install from a new environment, use Build System Requirements to install torch. Otherwise
setup.py
could not found torch.Use Case:
In a new environment, install from source code or source_dist.tar.gz, setup.py could not import torch
Can be Improve:
setup.py
topyproject.toml
related reference:
Before submitting
PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.