Skip to content

feat(pd): improve lifecycle supervision, health checks, and multimodal support - #1412

Merged
hiworldwzj merged 7 commits into
mainfrom
wzj_fix
Jul 30, 2026
Merged

feat(pd): improve lifecycle supervision, health checks, and multimodal support#1412
hiworldwzj merged 7 commits into
mainfrom
wzj_fix

Conversation

@hiworldwzj

@hiworldwzj hiworldwzj commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR improves Prefill/Decode (PD) disaggregated deployments, with a focus on container lifecycle management, topology-aware health reporting, connection liveness, KV transfer configuration, and multimodal correctness.

Process lifecycle and cleanup

  • supervise the HTTP server and critical LightLLM submodule processes
  • exit the launcher with a non-zero status when a managed process dies unexpectedly
  • centralize signal handling and recursive process cleanup in SubmoduleManager
  • add parent-process checks to PD KV manager, KV transfer, and status-reporting processes

PD connectivity and configuration

  • add --pd_trans_mode with nccl and nixl options; default to nccl
  • add a 15-second P/D heartbeat and remove nodes after a 30-second receive timeout
  • raise the default LIGHTLLM_WEBSOCKET_MAX_SIZE to 128 MiB
  • document proxy/NO_PROXY requirements for same-host or internal PD WebSocket traffic

Topology-aware health checks

  • add --pd_master_mode
    • elastic: ready when at least one Prefill and one Decode node are registered
    • fixed topology such as 2p1d: ready only when the exact node counts are registered
  • make PD Master /readiness reflect node readiness
  • make fixed-topology PD Master /health combine inference progress, topology readiness, and P/D node health checks

Multimodal correctness

  • initialize the tokenizer and generation configuration on PD Master
  • preload multimodal inputs at PD Master and reuse the validated payload on Prefill
  • require Prefill max_image_pixels and disable_image_resize to match PD Master
  • use torch.int64 for model input_ids so virtual multimodal token IDs fit safely
  • probabilistically isolate virtual multimodal token-ID ranges across Prefill nodes when no Config Server is available
  • document that probabilistic ranges reduce, but do not eliminate, cross-node collision risk

Deployment scripts and documentation

  • update PD deployment examples for the new transfer-mode argument
  • add test/start_scripts/qwen35/qwen35_pd_2p1d.sh
    • two TP2 Prefill nodes
    • one TP4 Decode node
    • CPU cache enabled only on Prefill
    • NCCL KV transfer and Qwen3.5 MTP configuration
    • PD Master starts after all P/D launchers

Validation

  • targeted unit tests: 25 passed
  • Qwen3.5-0.8B NCCL 2P/1D deployment reached healthy and ready state
  • PD Master, both Prefill nodes, and Decode node returned HTTP 200 from /health
  • three OpenAI-compatible multimodal chat requests returned HTTP 200 and correctly identified their images
  • Decode logs confirmed MTP execution; aggregate draft-token acceptance was approximately 38.24% for the three requests
  • graceful shutdown left no LightLLM processes or listening service ports behind

Review follow-ups before merge

  • avoid blocking forever when a submodule exits before sending its initialization result
  • strictly validate fixed pd_master_mode strings instead of accepting malformed suffixes such as 2p1x
  • initialize model_created for PD Master so /v1/models does not pass created=None to ModelCard

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@shihaobai shihaobai changed the title pd improve feat(pd): improve lifecycle supervision, health checks, and multimodal support Jul 30, 2026
@hiworldwzj
hiworldwzj merged commit d2a581f into main Jul 30, 2026
@hiworldwzj
hiworldwzj deleted the wzj_fix branch July 30, 2026 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant