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

vLLM model deployer #3032

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from

Conversation

dudeperf3ct
Copy link
Contributor

@dudeperf3ct dudeperf3ct commented Sep 20, 2024

Describe changes

This PR adds support for vLLM as a model deployer.

TODO

  • Clarity on Endpoints here for vllm. For now, I have implemented a static version as part of get_prediction_url and get_healthcheck_url of VLLMDeploymentService.
  • Ideal approach to add additional arguments specified under EngineArgs dataclass here. For now, only model and tokenizer are added.
  • Add documentation for new model deployer.

Pre-requisites

Please ensure you have done the following:

  • I have read the CONTRIBUTING.md document.
  • If my change requires a change to docs, I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • I have based my new branch on develop and the open PR is targeting develop. If your branch wasn't based on develop read Contribution guide on rebasing branch to develop.
  • If my changes require changes to the dashboard, these changes are communicated/requested.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Other (add details above)

Copy link
Contributor

coderabbitai bot commented Sep 20, 2024

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@dudeperf3ct dudeperf3ct changed the title Feature/vllm model deployer vLLM model deployer Sep 23, 2024
Copy link
Contributor

@safoinme safoinme left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution @dudeperf3ct and Great work! We've been looking forward to this and can't wait to test it out.


NAME = VLLM

REQUIREMENTS = ["vllm", "openai"]
Copy link
Contributor

Choose a reason for hiding this comment

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

can we please pin some version here to avoid conflicts and also make sure the integration will keep working

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For now, I have pinned this to the following

REQUIREMENTS = ["vllm >= 0.6.0", "openai >= 1.0.0"]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@safoinme should we add a upper bound of <0.7.0 for vllm? The library is changing rapidly and we might not be sure if the implementation will work for the next major release.


blocking: bool = True
model: Optional[str] = None
tokenizer: Optional[str] = None
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to add all other config we want here, but maybe let's start only with essential one as start
tokenizer_mode, trust_remote_code, dtype, revision, served_model_name,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added it in.

Copy link
Contributor

Choose a reason for hiding this comment

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

It would be better if we took this file out and alternatively documented to users how they would deploy models, can you please also provide a full example of a pipeline that deploys using vllm and create a PR for it in https://github.com/zenml-io/zenml-projects

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have removed it. I will create a separate PR on https://github.com/zenml-io/zenml-projects that creates the step and pipeline for using vllm.

Copy link
Contributor Author

@dudeperf3ct dudeperf3ct Sep 30, 2024

Choose a reason for hiding this comment

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

Copy link

@hyperlint-ai hyperlint-ai bot left a comment

Choose a reason for hiding this comment

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

1 files reviewed, 4 total issue(s) found.

docs/book/component-guide/model-deployers/vllm.md Outdated Show resolved Hide resolved
docs/book/component-guide/model-deployers/vllm.md Outdated Show resolved Hide resolved
docs/book/component-guide/model-deployers/vllm.md Outdated Show resolved Hide resolved
Copy link

@hyperlint-ai hyperlint-ai bot left a comment

Choose a reason for hiding this comment

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

1 files reviewed, 4 total issue(s) found.


Note:
This, and prior reviews, were resolved because we updated the style guide.
We'll leave a new review below.

docs/book/component-guide/model-deployers/vllm.md Outdated Show resolved Hide resolved
docs/book/component-guide/model-deployers/vllm.md Outdated Show resolved Hide resolved
Copy link

@hyperlint-ai hyperlint-ai bot left a comment

Choose a reason for hiding this comment

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

1 files reviewed, 5 total issue(s) found.

We noticed a change to the style guide files, We resolved the existing comments to account for any changes to your style guide.

docs/book/component-guide/model-deployers/vllm.md Outdated Show resolved Hide resolved
docs/book/component-guide/model-deployers/vllm.md Outdated Show resolved Hide resolved
@safoinme safoinme self-requested a review October 25, 2024 07:06
Returns:
The flavor logo.
"""
return "https://raw.githubusercontent.com/vllm-project/vllm/main/docs/source/assets/logos/vllm-logo-text-dark.png"
Copy link
Contributor

Choose a reason for hiding this comment

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

@schustmi can we please upload this logo to our s3 buckets in logo's path and share the URL here so it can be changed

Copy link
Contributor

Choose a reason for hiding this comment

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

description="vLLM Inference prediction service",
)
config: VLLMServiceConfig

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any specific reasons for not having endpoint implementation here? while having a static implementation for healthcheck_url and predection_url would work in same cases but it becomes invalid in case of port 8000 is not used

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the code to reflect the same.

args = parser.parse_args()
# Update the arguments in place
args.__dict__.update(self.config.model_dump())
uvloop.run(run_server(args=args))
Copy link
Contributor

Choose a reason for hiding this comment

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

One of the main added things in the LocalDaemonServiceEndpoint is looking for a free port in the local environment which then can be used when starting the server to avoid problems when the main given port is locked to some other process. check this.

we can then add port to the args to make sure that our server is starting on it, example here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @safoinme for the pointers.

I have updated the code to use endpoint configuration.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also updated the example on zenml-projects repo and tested the example.

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