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

[WIP] Integrating vllm>=0.7.0 #209

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open

[WIP] Integrating vllm>=0.7.0 #209

wants to merge 22 commits into from

Conversation

ZSL98
Copy link

@ZSL98 ZSL98 commented Feb 5, 2025

This PR aims to integrate vllm>=0.7.0 and preserve:
Backward compatibility: 0.3.1, 0.4.2, 0.5.4, 0.6.3 are still supported
Forward compatibility: Future versions of vllm (>= 0.7.0) will be supported without requiring manual maintenance for each new release.

The integration up to now only supports the fsdp backend. We have some rough numbers (vllm generation time in seconds in an iteration) for comparison. We are happy to see that with eager mode off, the generation time is shorten with the help of cuda graph. The sleep mode of vllm helps to reduce GPU memory pressure.

  vllm 0.6.3 vllm 0.7.0 (eager=true) vllm 0.7.0 (eager=false)
Qwen2-7b 16 13.5 12
Qwen2-7b_rm 14.5 11.5 10
Qwen2-7b_seq_balance 99 97 72

To reproduce

  1. Install vllm with pip3 install vllm==0.7.0 or pip install vllm --pre --extra-index-url https://wheels.vllm.ai/nightly.
  2. Apply the following minor modifications (I have posted as an issue [Bug]: Some issues in integrating vllm with verl vllm-project/vllm#12782):
  • vllm/distributed/parallel_state.py: Comment out the assertion below:
    if (world_size
            != tensor_model_parallel_size * pipeline_model_parallel_size):
        raise RuntimeError(
            f"world_size ({world_size}) is not equal to "
            f"tensor_model_parallel_size ({tensor_model_parallel_size}) x "
            f"pipeline_model_parallel_size ({pipeline_model_parallel_size})")
  • vllm/executor/uniproc_executor.py: change local_rank = rank to local_rank = int(os.environ["LOCAL_RANK"])
  1. Try a bash run_qwen2-7b.sh under examples/ppo_trainer

Note

The test cases are currently limited, and bug-free operation is not guaranteed at this stage.

self.collective_rpc("verl_init_device")
self.collective_rpc("load_model")

def determine_num_available_blocks(self) -> Tuple[int, int]:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder why we need this function? It seems that vLLM UniProcExecutor already perform allreduce MIN.

Copy link
Author

Choose a reason for hiding this comment

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

I have removed this file.

@ZSL98 ZSL98 marked this pull request as ready for review February 6, 2025 08:54
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.

2 participants