Skip to content

Conversation

@JohnLiu97Huawei
Copy link
Contributor

@JohnLiu97Huawei JohnLiu97Huawei commented Dec 23, 2025

This pull request refactors the logic for initializing server clusters in lm_service/apis/vllm/proxy.py to improve clarity and correctness when handling different server types based on the is_pd_merged flag. The changes streamline which server types are initialized and adjust the conditions for skipping certain types.

Cluster initialization logic improvements:

  • Refactored _init_cluster_with_addr_list to explicitly construct the list of active server types based on the is_pd_merged flag, replacing the previous loop and conditional logic for skipping server types.
  • Updated _init_cluster_with_metastore to skip both P_INSTANCE and D_INSTANCE when is_pd_merged is true, ensuring only relevant server types are initialized.


for server_type in SERVER_PARAMS_MAP:
if (self.is_pd_merged and server_type == ServerType.P_INSTANCE) or (
if (
Copy link
Collaborator

Choose a reason for hiding this comment

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

能不能写个active_map,或者优化一下if判断

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

self.is_pd_merged = self.metastore_client.is_pd_merged
init_params = locals()
for server_type in SERVER_PARAMS_MAP:
if (self.is_pd_merged and server_type == ServerType.P_INSTANCE) or (
Copy link
Collaborator

Choose a reason for hiding this comment

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

为什么只改一部分?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Expanded the condition to skip both P_INSTANCE and D_INSTANCE when is_pd_merged is True, ensuring correct server type handling in the Proxy class.

Signed-off-by: John Liu BUAA <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants