DeepSpeed icon indicating copy to clipboard operation
DeepSpeed copied to clipboard

Poetry can't add DeepSpeed

Open boazdori opened this issue 2 years ago • 3 comments

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

boazdori avatar May 29 '23 14:05 boazdori

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.

loadams avatar Jun 07 '23 15:06 loadams

Logan hi, Thanks for the response. Can I use pipenv to set up the env or will it reproduce the same result? Boaz

boazdori avatar Jun 07 '23 18:06 boazdori

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.

loadams avatar Jun 12 '23 18:06 loadams

@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.

loadams avatar Jun 20 '23 23:06 loadams

Thanks, I will try Pipenv

boazdori avatar Jun 21 '23 09:06 boazdori

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!

jorgetavares avatar Sep 22 '23 11:09 jorgetavares

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?

loadams avatar Sep 22 '23 18:09 loadams

@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" {} \;

mrwyattii avatar Sep 22 '23 18:09 mrwyattii

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.

jorgetavares avatar Sep 22 '23 19:09 jorgetavares

I have build a github actions to auto build wheels you can use.

AlongWY avatar Mar 25 '24 15:03 AlongWY

@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.

loadams avatar Mar 25 '24 16:03 loadams