ray-project / ray

Ray is a unified framework for scaling AI and Python applications. Ray consists of a core distributed runtime and a set of AI Libraries for accelerating ML workloads.
https://ray.io
Apache License 2.0
33.23k stars 5.62k forks source link

Allow mamba to be used to install the conda environment #33596

Open deepio-oc opened 1 year ago

deepio-oc commented 1 year ago

Description

Allow mamba to be used to install the conda environment.

mamba is a reimplementation of the conda package manager in C++.

Use case

Conda can be very slow to create runtime environment. While the same environment is created much faster using mamba. It would be good if ray can allow using mamba to install conda environments in place of conda.

In our test, conda hangs forever in solving dependencies so we are not able to run ray scripts. We have tried a workaround of symlink conda to mamba and that works. If would be better if this was an option in ray runtime env.

Can submit a PR if team agrees that this would be a good way to solve the conda related slow startups.

jjyao commented 1 year ago

How mature or popular of mamba? We can definitely support it and your contribution is very welcomed!

deepio-oc commented 1 year ago

Mamba's first release(0.0.1) was 4 years ago. Today it is 1.4.2 so I think it has matured over 22 releases. It has 4.5K GitHub stars so it is gaining popularity.

For us, conda didnt even work when using an environment file but by using mamba, ray script was able to install the environment in few minutes.

antoniomdk commented 11 months ago

What about using libmamba solver? Although it has some differences with the classic solver, it won't probably require any change in Ray core. If users want to opt-in for the mamba solver, they can just install it and set it as default in their dockerfiles.

rupertcw commented 7 months ago

Hi - we would also like to use mamba to install our dependencies. What's the current status?

antoniomdk commented 7 months ago

Mamba is now the default resolver for conda.

https://github.com/conda/conda/releases/tag/23.10.0 https://www.anaconda.com/blog/a-faster-conda-for-a-growing-community

So, if your Ray cluster is using one of the latest versions of conda, you should expect a similar performance as Mamba.