Skip to content
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

Better integration with Ray Serve #1821

Merged
merged 2 commits into from
Nov 29, 2023
Merged

Better integration with Ray Serve #1821

merged 2 commits into from
Nov 29, 2023

Conversation

FlorianJoncour
Copy link
Contributor

@FlorianJoncour FlorianJoncour commented Nov 28, 2023

I use several models using Ray Serve outside of Vllm.
Vllm ask for all ressources to Ray, making it impossible to use other models alongside.

So I use the gpu_memory_utilization parameter to limit the gpu ressources requested by the worker, which then allows placement_group_bundles to be used in Ray Serve deployments.

The RayWorker class has also been renamed to RayWorkerVllm to avoid ambiguities with other Ray actors.

Edit: Clarification, Vllm don't use all Vram, but requests for all ressources to Ray.

@matt-psaltis
Copy link

I think this feature fixes the underlying cause for the problem here: ray-project/ray-llm#94

Thanks @FlorianJoncour!

@FlorianJoncour
Copy link
Contributor Author

Yes it seems to be the same issue.

I almost went crazy trying to get this to work before diving into the vllm code

Copy link
Collaborator

@Yard1 Yard1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, though I would say that the rename is unnecessary :)

One important thing to note is this doesn't actually provide a hard boundary on the process memory usage, so using fractional GPUs doesn't have a 100% guarantee that OOMs will be avoided. That being said, they should be quite unlikely thanks to vLLM memory profiling.

@zhuohan123 zhuohan123 merged commit 0229c38 into vllm-project:main Nov 29, 2023
2 checks passed
@WoosukKwon
Copy link
Collaborator

@FlorianJoncour @Yard1 It seems this change causes a bug when gpu_memory_utilzation < 0.5 and tensor_parallel_size > 1:

RuntimeError: CUDA error: invalid device ordinal

I guess this is because num_gpus is set to gpu_memory_utilization? Do you have any idea to fix this?

@Yard1
Copy link
Collaborator

Yard1 commented Nov 30, 2023

@WoosukKwon I see. For now we should do:

num_gpus=self.cache_config.gpu_memory_utilization if self.parallel_config.tensor_parallel_size < 2 else 1

xjpang pushed a commit to xjpang/vllm that referenced this pull request Dec 4, 2023
Co-authored-by: FlorianJoncour <florian@zetta-sys.com>
hongxiayang pushed a commit to hongxiayang/vllm that referenced this pull request Feb 13, 2024
Co-authored-by: FlorianJoncour <florian@zetta-sys.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants