DeepSpeed
DeepSpeed copied to clipboard
Poetry can't add DeepSpeed
Describe the bug I am building a local project using poetry to manage dependencies poetry can't add DeepSpeed to the project part of the error seems to bee associated with torch installation installation - I have it installed. Log output AssertionError: Unable to pre-compile ops without torch installed. Please install torch before attempting to pre-compile ops This error originates from the build backend and is likely not a problem with poetry but with deepspeed (0.9.2) not supporting PEP 517 builds. You can verify this by running 'pip wheel --use-pep517 "deepspeed (==0.9.2)"'.
To Reproduce Steps to reproduce the behavior: poetry add deepspeed>=0.8.3
Expected behavior add DeepSpeed to the project
Thanks
Hi @boazdori - you're correct, this is because deepspeed is not PEP 517 compliant. We know this is something that we need to support, but we are not there yet in terms of adding this support.
For now, I don't have a timeline of when this would be supported, so I'm not sure what to offer in terms of a workaround just yet.
Logan hi, Thanks for the response. Can I use pipenv to set up the env or will it reproduce the same result? Boaz
Hi @boazdori - I believe this will work in pipenv, but haven't tested this on my own, but this is closer to venvs so it should.
@boazdori - not sure if you got this to work, but it should, closing for now, since we have other enhancements tracking our need to update to the PEP 519 standard. Feel free to re-open or open a new issue if you're hitting something else.
Thanks, I will try Pipenv
Hi @loadams, we also depend on Poetry and the latest DeepSpeed releases are still not PEP 517 compliant. We're porting our codebase to recent PyTorch and DeepSpeed is a blocker because version 0.8.0 relies on torch._six which latest PyTorch deprecated. Is there a timeline for DeepSpeed to support PEP 517? Thanks!
Hi @jorgetavares - to clarify, in order to use torch 2+, you need to use a newer version of DeepSpeed, so in order to update your system, potery requires DeepSpeed to be PEP 517 compliant?
@jorgetavares if you really must stick with the older version of DeepSpeed, you can also do a quick find/replace to make things compatible with the latest PyTorch. Here's a one-liner to do that:
find ./path/to/python/libs/site-packages/deepspeed/ -type f -exec sed -i -e "s|from torch._six import inf|from torch import inf|g" {} \;
Yes @loadams , that's the situation. However, we want to bring all packages to the most recent version possible. It's not like we want to upgrade some and keep others as is. DeepSpeed itself already has many releases since 0.8.0 so it should be also updated.
@mrwyattii thanks for the "hack" :) but I rather have DeepSpeed also updated and have things properly installed and not relying on manual fixes.
I have build a github actions to auto build wheels you can use.
@AlongWY - those are just pre-built wheels for certain environments, they don't fix the requirements of the underlying DeepSpeed codebase not being PEP 517 compliant.