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

Avoid monkey patching vLLM #297

Open
Atry opened this issue May 20, 2024 · 1 comment
Open

Avoid monkey patching vLLM #297

Atry opened this issue May 20, 2024 · 1 comment

Comments

@Atry
Copy link

Atry commented May 20, 2024

Currently, vLLM's vllm.worker.worker.Worker is replaced with openrlhf.trainer.ray.vllm_worker_wrap.WorkerWrap on fly as a monkey patch.

The monkey patch is avoidable by making init_process_group and update_weight global functions and invoke them via __ray_call__.

__ray_call__ has not been documented yet but it is expected to be documented soon since it is marked as P1 in ray-project/ray#45068.

__ray_call__ is already used in Ray to initialize NCCL group, which is similar to the OpenRLHF use case:

https://github.com/ray-project/ray/blob/4c1519be13087f4ccb47431f9ebc3dc446182775/python/ray/experimental/channel/torch_tensor_nccl_channel.py#L275-L282

@hijkzzz
Copy link
Collaborator

hijkzzz commented May 20, 2024

Thanks~

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

No branches or pull requests

2 participants