Skip to content
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

How can I configure poetry to pass --no-cache-dir to pip so that it won't get an OOM signal #7250

Closed
nyaachen opened this issue Dec 26, 2022 · 4 comments
Labels
kind/question User questions (candidates for conversion to discussion)

Comments

@nyaachen
Copy link

  • [ X ] I have searched the issues of this repo and believe that this is not a duplicate.
  • [ X ] I have searched the FAQ and general documentation and believe that my question is not already covered.

Feature Request

I am using poetry to build up the prod env for a project. When I run poetry install it shows that poetry is collecting torch, and then it got a OOM signal displaying Killed. And torch is a large whl about 900M and together with some dependency about another 800M.

I searched for a solution saying that when i use poetry to collect torch it is actually using pip to collect torch.
So I tried to manually install torch by running pip3 install torch and it received a OOM signal, too.
I searched for the web and used pip3 install torch --no-cache-dir and the installation succeed, but its not installed in poetry venv.

When I tries poetry install --no-cache-dir it tells me --no-cache-dir is not an valid option for poetry.
I search for the document but did not found a method about how to pass parameters from poetry to pip. So I wonder if poetry can use any methods to pass parameter to sub pip/python process.

My machine is 1C+2G, mem report says used 355M free 1.4G.

@nyaachen nyaachen added kind/feature Feature requests/implementations status/triage This issue needs to be triaged labels Dec 26, 2022
@nyaachen
Copy link
Author

Somehow, I managed to installed torch successfully, by manually switching to the virtualenv poetry created and install torch into the virtual env.

@dimbleby
Copy link
Contributor

dimbleby commented Jan 3, 2023

poetry does not provide a way to pass parameters to pip. More discussion in #7265, #7182, #3249, and probably others

@neersighted
Copy link
Member

neersighted commented Jan 3, 2023

Poetry only uses pip as a minor implementation detail; Poetry is not a pip wrapper like Pipenv. Poetry never makes use of pip's cache.

In this case you can turn off Poetry's parallelism with poetry config installer.parallel false as well as use Poetry's --no-cache to reduce the memory overhead. There are no guarantees that this will solve your case however, downloading a 2.4Gb file in a small VM is pretty rough/dodgy as we haven't specifically optimized Poetry to behave well in such situations. Large distfiles are simply not a huge issue outside specialized niches like ML packages.

I'm going to close this for now as mostly no action possible; if with the above suggestions you still have issues, I'd suggest opening a generalized issue to examine/optimize Poetry's memory usage when downloading large (aka ML) distfiles.

@neersighted neersighted closed this as not planned Won't fix, can't repro, duplicate, stale Jan 3, 2023
@neersighted neersighted added kind/question User questions (candidates for conversion to discussion) and removed kind/feature Feature requests/implementations status/triage This issue needs to be triaged labels Jan 3, 2023
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/question User questions (candidates for conversion to discussion)
Projects
None yet
Development

No branches or pull requests

3 participants