Skip to content

Conversation

YushunXiang
Copy link

PR type

  • Bug Fix
  • New Feature
  • Document Updates
  • More Models or Datasets Support

PR information

This pull request introduces an enhancement to the deployment logic for the inference engine, specifically to support vLLM data parallelism in deploy mode. The main change is the addition of a static method to configure the inference engine with appropriate parameters when using vLLM with data parallelism.

Enhancements to vLLM deployment support:

  • Added a static method get_infer_engine to SwiftDeploy that configures the inference engine for vLLM data parallelism, ensuring that vllm_use_async_engine is enabled and setting the data_parallel_size parameter as needed. This helps prevent misconfiguration and improves support for distributed inference.
  • Updated imports to include InferArguments from swift.llm, which is required for the new method.

Solved #6097.

Experiment results

example script:

CUDA_VISIBLE_DEVICES=0,1 \
MAX_PIXELS=1003520 \
swift deploy \
    --model model/Qwen/Qwen2.5-VL-7B-Instruct \
    --infer_backend vllm \
    --vllm_data_parallel_size 2 \
    --gpu_memory_utilization 0.9 \
    --max_model_len 32768 \
    --max_new_tokens 2048 \
    --served_model_name Qwen2.5-VL-7B-Instruct \

Copy link
Contributor

Summary of Changes

Hello @YushunXiang, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances SwiftDeploy's capabilities by integrating robust support for vLLM data parallelism. It introduces a dedicated configuration method that ensures correct setup for distributed inference, validates critical parameters like asynchronous engine usage, and dynamically applies data parallel settings. This change aims to improve the stability and ease of deploying large language models with vLLM in a distributed environment.

Highlights

  • vLLM Data Parallelism Support: Introduced a new static method get_infer_engine within the SwiftDeploy class to properly configure the inference engine for vLLM data parallelism.
  • Configuration Validation: The new method includes validation to ensure that vllm_use_async_engine is enabled when vllm_data_parallel_size is greater than 1, preventing misconfigurations.
  • Dynamic Parameter Setting: Automatically sets the data_parallel_size parameter within the vLLM engine arguments, streamlining distributed inference setup.
  • Import Updates: Added the necessary import for InferArguments from swift.llm to support the new method's signature.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for vLLM data parallelism in SwiftDeploy. The changes are logical and well-implemented. I have one suggestion to simplify a part of the code for better readability and maintainability.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@YushunXiang
Copy link
Author

If the repository owner is willing to merge this code, I will add documentation.

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.

1 participant