Skip to content

Conversation

eicherseiji
Copy link
Contributor

Why are these changes needed?

Need to pin Ray 2.46 + trust_remote_code: False, otherwise, will fail with PicklingError due to vllm-project/vllm#18640

 ForkingPickler(file, protocol).dump(obj)
(ServeController pid=13343) _pickle.PicklingError: Can't pickle <class 'transformers_modules.deepseek-ai.DeepSeek-R1.56d4cbbb4d29f4355bab4b9a39ccb717a14ad5ad.configuration_deepseek.DeepseekV3Config'>: it's not the same object as transformers_modules.deepseek-ai.DeepSeek-R1.56d4cbbb4d29f4355bab4b9a39ccb717a14ad5ad.configuration_deepseek.DeepseekV3Config
(ServeController pid=13343) ERROR 2025-07-25 13:09:56,075 controller 13343 -- Failed to update the deployments ['LLMDeployment:deepseek'].
(download_model_f

Newer Ray versions (up to and including 2.48) have other bugs that prevent deploying DeepSeek.

Related issue number

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(
    • Tested by Kunling (pending his review)

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 @eicherseiji, 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 addresses critical compatibility issues preventing the successful deployment of the DeepSeek example with Ray Serve. By specifically pinning the Ray version and adjusting a key configuration parameter, I've ensured the example functions correctly, mitigating known PicklingError and other deployment failures.

Highlights

  • Dependency Pinning: I've pinned the ray[llm] dependency to version 2.46.0 in the DeepSeek example's installation instructions. This is crucial because newer Ray versions (up to 2.48) introduce bugs that prevent the successful deployment of DeepSeek models.
  • Configuration Adjustment: I've removed the trust_remote_code: True parameter from both the Python LLMConfig and the YAML deployment configuration for the DeepSeek example. This change is necessary to avoid PicklingError issues that arise when trust_remote_code is enabled with certain Ray versions, as detailed in a related vllm-project pull request.
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 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 or fill out our survey 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.

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 pins the Ray version to 2.46.0 and removes trust_remote_code to resolve a PicklingError when deploying DeepSeek models. I've added suggestions to the documentation to explain why this specific version is necessary and why trust_remote_code was removed, which will improve clarity and prevent future confusion.

@eicherseiji eicherseiji force-pushed the eicherseiji-pin-ray-version-deepseek-example branch from 36cd835 to 7c150ee Compare July 25, 2025 22:19
@eicherseiji eicherseiji added the go add ONLY when ready to merge, run all tests label Jul 25, 2025
@eicherseiji eicherseiji marked this pull request as ready for review July 25, 2025 22:20
@eicherseiji eicherseiji requested review from a team as code owners July 25, 2025 22:20
Copy link
Contributor

@kunling-anyscale kunling-anyscale left a comment

Choose a reason for hiding this comment

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

looks good!

Co-authored-by: angelinalg <[email protected]>
Signed-off-by: Seiji Eicher <[email protected]>
@kouroshHakha kouroshHakha changed the title Pin Ray version for DeepSeek example [Serve.llm] Pin Ray version for DeepSeek example Jul 27, 2025
@kouroshHakha kouroshHakha merged commit 7e6fc63 into master Jul 27, 2025
5 checks passed
@kouroshHakha kouroshHakha deleted the eicherseiji-pin-ray-version-deepseek-example branch July 27, 2025 03:24
krishnakalyan3 pushed a commit to krishnakalyan3/ray that referenced this pull request Jul 30, 2025
jugalshah291 pushed a commit to jugalshah291/ray_fork that referenced this pull request Sep 11, 2025
dstrodtman pushed a commit to dstrodtman/ray that referenced this pull request Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants