-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
[core] [3/N] Use uv as package manager #48611
Conversation
Great progress! Here are two test cases I'm using to try this out: In [1]: import ray
In [2]: ray.init(runtime_env={"uv": ["emoji"]})
2024-11-06 13:41:00,419 INFO worker.py:1812 -- Started a local Ray instance. View the dashboard at http://127.0.0.1:8265
Out[2]: RayContext(dashboard_url='127.0.0.1:8265', python_version='3.11.4', ray_version='3.0.0.dev0', ray_commit='{{RAY_COMMIT_SHA}}')
In [3]: @ray.remote
...: def f():
...: import emoji
...: return emoji.emojize('Ray and UV is :thumbs_up:')
...:
In [4]: ray.get(f.remote()) In [1]: import ray
In [2]: ray.init(runtime_env={"uv": ["openai-whisper"]})
2024-11-06 13:45:16,284 INFO worker.py:1812 -- Started a local Ray instance. View the dashboard at http://127.0.0.1:8265
Out[2]: RayContext(dashboard_url='127.0.0.1:8265', python_version='3.11.4', ray_version='3.0.0.dev0', ray_commit='{{RAY_COMMIT_SHA}}')
In [3]:
In [3]: @ray.remote
...: def f():
...: import whisper
...: return str(whisper.load_model("turbo"))
...:
In [4]: ray.get(f.remote()) Currently failing with
(which is probably expected since you marked it as "draft"). Once it is working I'm also happy to test it on workspaces :) |
e0a7f80
to
af8e53b
Compare
af8e53b
to
d485d30
Compare
Signed-off-by: dentiny <dentinyhao@gmail.com>
d485d30
to
ab6b4e9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG
python/ray/tests/test_runtime_uv.py
Outdated
# 1. Install specialized version of `uv`. | ||
# 2. Options for `uv install`. | ||
# 3. Use requirement files for packages. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most pip integration test can have a uv counterpart. Consider reusing the tests by using @pytest.mark.parametrize
. This also shows people can just change pip
to uv
and things will just work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I considered that, but choose to rewrite in these reasons:
- (major) uv and pip are not 100% compatible, which means we will have a number of if-else branches
- For example, we need to add uv-specific tests at the end
- I've seen a few community discussions on leveraging uv features, I'm afraid the split will become larger and larger
- (major/minor) pip and uv installation process is different: we consider pip installed by default, while have to install uv ourselves, which means, we need to do extra checking for
uv
- (minor) Not all the features are implemented for
uv
for now, so quite a lot of existing pip-based tests will be skipped;
Signed-off-by: dentiny <dentinyhao@gmail.com>
Signed-off-by: dentiny <dentinyhao@gmail.com>
Signed-off-by: dentiny <dentinyhao@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last few comments.
Signed-off-by: dentiny <dentinyhao@gmail.com>
Signed-off-by: dentiny <dentinyhao@gmail.com>
…hjiang/uv-installation
This PR integrates `uv` into existing runtime env system, which uses `uv` to setup environment for better performance. TODO list: - [ ] Add `uv` to public documentation --------- Signed-off-by: dentiny <dentinyhao@gmail.com> Co-authored-by: Jiajun Yao <jeromeyjj@gmail.com>
This PR integrates `uv` into existing runtime env system, which uses `uv` to setup environment for better performance. TODO list: - [ ] Add `uv` to public documentation --------- Signed-off-by: dentiny <dentinyhao@gmail.com> Co-authored-by: Jiajun Yao <jeromeyjj@gmail.com> Signed-off-by: mohitjain2504 <mohit.jain@dream11.com>
This PR integrates
uv
into existing runtime env system, which usesuv
to setup environment for better performance.TODO list:
uv
to public documentation