ray-project / ray

Ray is a unified framework for scaling AI and Python applications. Ray consists of a core distributed runtime and a set of AI Libraries for accelerating ML workloads.
https://ray.io
Apache License 2.0
33.11k stars 5.6k forks source link

[serve] Deployment with "reconfigure()" do not respect "placement_group_bundles" defined in "deployment.options" #45886

Open vincent-pli opened 3 months ago

vincent-pli commented 3 months ago

What happened + What you expected to happen

Follow the guide here:https://github.com/ray-project/ray/blob/c4a87ee474041ab7286a41378f3f6db904e0e3c5/doc/source/serve/doc_code/vllm_openai_example.py#L117

but I found if the deployment has function: reconfigure, the placement_group_bundles will not take effect, when I remove reconfigure everything works

Versions / Dependencies

v2.20.0 Python 3.10.12 ubuntu 22.04

Reproduction script

VLLMDeployment.options(
        placement_group_bundles=pg_resources, placement_group_strategy="STRICT_PACK"
    ).bind(
        engine_args,
        parsed_args.response_role,
        parsed_args.lora_modules,
        parsed_args.chat_template,
    )

if VLLMDeployment has reconfigure function, the placement_group_bundles will not been respected.

Issue Severity

High: It blocks me from completing my task.

vincent-pli commented 3 months ago

At first, I guess I should not start vllm engine in reconfigure function, I'm not dig in to the inner logic of ray deployment, maybe at the phase reconfigure was calling the pg or bundles has not ready. but after some experimental, I found as long as reconfigure existed, even I do nothing in that function, the placement_group_bundles predefined was not works

any comment?

vincent-pli commented 3 months ago

I guess the issue is cased by incompatible between pydantic 1.x and 2.x I know ray adopted 1.x but I have to adopt 2.x since vllm addressed 2.x

lol!

vincent-pli commented 3 months ago

but why the pydantic version incompatible could infect bind() or reconfigure is still unknown, I guess we need describe it at least in document.