Skip to content

[Serve][LLM] Simplify _prepare_engine_config()#53704

Merged
kouroshHakha merged 1 commit intoray-project:masterfrom
ruisearch42:get_config
Jun 17, 2025
Merged

[Serve][LLM] Simplify _prepare_engine_config()#53704
kouroshHakha merged 1 commit intoray-project:masterfrom
ruisearch42:get_config

Conversation

@ruisearch42
Copy link
Copy Markdown
Contributor

Why are these changes needed?

accelerator_type can be passed as None

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 :(

accelerator_type can be passed as None

Signed-off-by: Rui Qiao <ruisearch42@gmail.com>
Copilot AI review requested due to automatic review settings June 10, 2025 17:05
@ruisearch42 ruisearch42 requested a review from a team as a code owner June 10, 2025 17:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR simplifies the GPU engine configuration flow by removing the conditional branch that checked accelerator_type and unifying on a single remote invocation with placement-group scheduling.

  • Deleted the if self.llm_config.accelerator_type branch and its alternate GPU task setup.
  • Always uses the placement-group scheduling strategy for GPU-enabled tasks.
  • Removed the manual num_gpus=1 fallback.
Comments suppressed due to low confidence (2)

python/ray/llm/_internal/serve/deployments/llm/vllm/vllm_engine.py:357

  • The GPU remote invocation no longer specifies a GPU resource when accelerator_type is None, which could lead to tasks running without GPU access. Consider explicitly setting num_gpus=1 or verifying that the placement group always includes GPU resources.
ref = (

python/ray/llm/_internal/serve/deployments/llm/vllm/vllm_engine.py:356

  • Add a unit test for the case where llm_config.accelerator_type is None to ensure GPU allocation still works under the new unified scheduling logic.
-            if self.llm_config.accelerator_type:

@ruisearch42 ruisearch42 added the go add ONLY when ready to merge, run all tests label Jun 10, 2025
@kouroshHakha
Copy link
Copy Markdown
Contributor

@kouroshHakha
Copy link
Copy Markdown
Contributor

@ruisearch42 remind me to merge if the release tests pass.

@ruisearch42
Copy link
Copy Markdown
Contributor Author

ruisearch42 commented Jun 17, 2025

@kouroshHakha release tests passed.

@kouroshHakha kouroshHakha merged commit 0258042 into ray-project:master Jun 17, 2025
5 checks passed
elliot-barn pushed a commit that referenced this pull request Jun 18, 2025
Signed-off-by: Rui Qiao <ruisearch42@gmail.com>
Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
minerharry pushed a commit to minerharry/ray that referenced this pull request Jun 27, 2025
Signed-off-by: Rui Qiao <ruisearch42@gmail.com>
elliot-barn pushed a commit that referenced this pull request Jul 2, 2025
Signed-off-by: Rui Qiao <ruisearch42@gmail.com>
Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
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