Skip to content

[Docs][wip] Improve Ray documentation. #20040

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

Draft
wants to merge 25 commits into
base: main
Choose a base branch
from

Conversation

crypdick
Copy link

@crypdick crypdick commented Jun 24, 2025

Purpose

Polishes and expands upon the Ray documentation.

Copy link

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

🚀

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.

Summary of Changes

Hello @crypdick, 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 focuses on significantly improving the documentation and clarity of examples related to Ray integration within the project. My changes aim to provide users with more comprehensive explanations, clearer code comments, and better guidance for deploying and utilizing vLLM with Ray for various use cases, including Kubernetes deployment, batch inference, and advanced RLHF setups.

Highlights

  • Documentation Expansion (Kubernetes): I've updated the Kubernetes deployment documentation (docs/deployment/k8s.md) to include a direct link to KubeRay, providing users with another relevant resource for deploying vLLM on Kubernetes.
  • Enhanced Ray Data Example Clarity: The examples/offline_inference/batch_llm_inference.py script's introductory docstring has been significantly rewritten. It now offers a more detailed and polished explanation of how Ray Data facilitates data-parallel batch inference with vLLM, highlighting features like streaming execution, automatic sharding, and optimized continuous batching.
  • Improved RLHF Example Explanations: I've thoroughly revised the examples/offline_inference/rlhf.py example. This includes a comprehensive new module-level docstring detailing the RLHF setup, GPU separation, and the steps involved in generating text and synchronizing model weights. Additionally, I've added and clarified numerous inline comments and docstrings for classes and key code sections to enhance understanding.
  • Detailed RLHF Co-location Example: The examples/offline_inference/rlhf_colocate.py example now features an extensively rewritten module-level docstring that clearly explains the concept of co-locating vLLM workers and training actors on the same GPUs using Ray placement groups and CUDA IPC. Class docstrings and inline comments have also been added or improved to provide deeper insights into the configuration and process.
  • Multi-Node Serving Script Documentation: I've added a comprehensive header and inline comments to the examples/online_serving/multi-node-serving.sh script. This documentation clarifies its purpose, usage, subcommands (leader, worker), and provides a brief introduction to Ray, making it much easier for users to understand and utilize for setting up multi-node vLLM serving.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 is currently in preview and 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 to provide feedback.

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.

@mergify mergify bot added the documentation Improvements or additions to documentation label Jun 24, 2025
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

The pull request improves the Ray documentation and enhances the clarity of several examples by adding more descriptive comments and updating docstrings. The changes make the examples easier to understand and use.

2. Create a `RayService` that runs vLLM.

```bash
# FIXME create this yaml before merging PR
Copy link
Author

Choose a reason for hiding this comment

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

memo to self

crypdick and others added 20 commits June 24, 2025 20:44
Signed-off-by: Ricardo Decal <[email protected]>
Signed-off-by: Ricardo Decal <[email protected]>
Signed-off-by: Ricardo Decal <[email protected]>
Signed-off-by: Ricardo Decal <[email protected]>
Signed-off-by: Ricardo Decal <[email protected]>
Signed-off-by: Ricardo Decal <[email protected]>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Ricardo Decal <[email protected]>
Signed-off-by: Ricardo Decal <[email protected]>
@crypdick crypdick force-pushed the docs/improve-ray-documentation branch from 434106c to fe99bd9 Compare June 25, 2025 03:44
@crypdick
Copy link
Author

@gemini-code-assist please review again

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

The pull request significantly improves the Ray-related documentation across various files, enhancing clarity, detail, and structure. New documentation pages for Anyscale and KubeRay are added, and existing pages like distributed_serving.md, offline_inference.md, and openai_compatible_server.md are updated with more comprehensive explanations and new sections on Ray Data LLM and Ray Serve LLM. The docstrings and comments in example Python and Bash scripts are also greatly improved, making them easier to understand and use. Overall, these changes contribute positively to the project's documentation quality.

Signed-off-by: Ricardo Decal <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant