axolotl-ai-cloud / axolotl

Go ahead and axolotl questions
https://axolotl-ai-cloud.github.io/axolotl/
Apache License 2.0
7.91k stars 870 forks source link

Conflicting dependencies in version 0.4.0 #1238

Closed eryk-mazus closed 9 months ago

eryk-mazus commented 9 months ago

Please check that this issue hasn't been reported before.

Expected Behavior

I tried to install axolotl by following instructions for developers from README:

git clone https://github.com/OpenAccess-AI-Collective/axolotl
cd axolotl

pip3 install packaging
pip3 install -e '.[flash-attn,deepspeed]'

and then in alternative way:

pip3 install "axolotl[flash-attn,deepspeed] @ git+https://github.com/OpenAccess-AI-Collective/axolotl"

In both cases I get the error attached below:

Current behaviour

ERROR: Cannot install axolotl and axolotl[deepspeed,flash-attn]==0.4.0 because these package versions have conflicting dependencies.

The conflict is caused by:
    axolotl[deepspeed,flash-attn] 0.4.0 depends on torch==2.1.0
    accelerate 0.26.1 depends on torch>=1.10.0
    flash-attn 2.5.0 depends on torch
    optimum 1.16.2 depends on torch>=1.11
    deepspeed 0.13.1 depends on torch
    trl 0.7.9 depends on torch>=1.4.0
    xformers 0.0.24 depends on torch==2.2.0
    axolotl[deepspeed,flash-attn] 0.4.0 depends on torch==2.1.0
    accelerate 0.26.1 depends on torch>=1.10.0
    flash-attn 2.5.0 depends on torch
    optimum 1.16.2 depends on torch>=1.11
    deepspeed 0.13.1 depends on torch
    trl 0.7.9 depends on torch>=1.4.0
    xformers 0.0.23.post1 depends on torch==2.1.2
    axolotl[deepspeed,flash-attn] 0.4.0 depends on torch==2.1.0
    accelerate 0.26.1 depends on torch>=1.10.0
    flash-attn 2.5.0 depends on torch
    optimum 1.16.2 depends on torch>=1.11
    deepspeed 0.13.1 depends on torch
    trl 0.7.9 depends on torch>=1.4.0
    xformers 0.0.23 depends on torch==2.1.1

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

Steps to reproduce

I just followed the instructions on fresh instance.

Config yaml

No response

Possible solution

No response

Which Operating Systems are you using?

Python Version

3.10.13

axolotl branch-commit

main

Acknowledgements

winglian commented 9 months ago

Might be related to xformers. I haven't seen this issue with our automated ci builds, but some of the problem arises from the latest torch 2.2.0 release

winglian commented 9 months ago

@eryk-mazus what version of torch do you already have installed?

eryk-mazus commented 9 months ago

I'm using a docker image with pytorch 2.1.0

winglian commented 9 months ago

Have you tried the axolotl images? https://hub.docker.com/r/winglian/axolotl/tags

dctanner commented 9 months ago

Just bumped into this issue today on a fresh ubuntu 22.04 using today's main branch.

winglian commented 9 months ago

Try upgrading to torch 2.1.2. I think torch 2.1.1 may be unsupported in the current dependency tree.

dctanner commented 9 months ago

The issue seems to be caused by a new version of xformers released yesterday.

I fixed it by first installing torch==2.1.1. manualy Edited setup.py line to be 0.0.23:

            _install_requires.append("xformers==0.0.23")

pip3 install -e '.[flash-attn,deepspeed]'

eryk-mazus commented 9 months ago

Have you tried the axolotl images? https://hub.docker.com/r/winglian/axolotl/tags

I can confirm that 'winglian/axolotl:main-py3.10-cu121-2.1.1' works without any issues.

OlivierH71 commented 2 months ago

in my case, I ended-up with commenting the install_requires of torch in setup.py like this:

torch_version = version("torch")
#_install_requires.append(f"torch=={torch_version}")

That command sounds crazy as if there is a previous version installed of torch, THIS installed version it is considered as required but may be incompatible with other library requirements and forbid its install/upgrade.

winglian commented 2 months ago

What version of torch did you originally have installed? We try to pin the existing version of torch otherwise it always tries to upgrade everyone to 2.4.0.