Troubleshooting PD (Prefill-Decode) Disaggregated Deployment for Large Language Models: A Practical Guide

    This article presents a practical troubleshooting guide for PD (Prefill-Decode) disaggregated deployment of large language models. It explains why disaggregated setups often fail immediately at startup, how to recognize cascading failures caused by the "co-burial effect" in distributed logs, and how to identify the real root cause instead of the noisiest error. It covers six common failure points—communication group initialization, KV transfer role mismatch, port and proxy forwarding, parallel topology, quantized weight loading, and timeout-driven retries—along with a reusable step-by-step diagnostic workflow for bringing up multi-node inference services reliably.

    1. Scenario and Goal: Why Disaggregated Deployment Tends to “Fail on Startup”

    In a PD (Prefill-Decode) disaggregated architecture, the compute-intensive context prefill and the memory-intensive incremental decode are split across different process groups, or even different machines, and are connected through a KV cache transfer channel. The benefit is that resource profiles are matched to each phase and the two phases do not interfere with each other. The cost is a longer pipeline, more state to manage, and a significant increase in coupling points during startup.

    The reference environment abstracted for this article is as follows:

    Item Configuration
    Hardware 2 eight-card inference servers, all 8 cards used per machine
    Runtime An Ascend-adapted version of an open-source inference engine (version omitted)
    Parallelism Data parallel 4 × tensor parallel 2, 4 engine instances per node, port range 7100–7103
    Deployment 1P1D: P side listens on 36000, D side listens on 36100
    KV transfer Hybrid KV connector + load balancer proxy (1999)
    Model A quantized large-parameter MoE model (weight path redacted)

    The goal is simple: get the service up and running stably on both machines. The reality was six consecutive “fail on startup” incidents, and every time the logs pointed to the same location.

    2. The Most Valuable Lesson: The “Co-Burial Effect” in Logs

    When eight ranks start at the same time and all end up failing at the same location, the logs often look like this:

    1. (Worker_DP1_TP0_EP2) RuntimeError: [2] is setting up HCCL communicator and
    2. retrieving hcclUniqueId from [0] via c10d key-value store by key '0',
    3. but store->get('0') got error: Failed to recv, got 0 bytes.
    4. Connection was likely closed. Did the remote server shutdown or crash?
    5. (EngineCore_DP0) WARNING [shutdown] Executor: workers still running after
    6. grace period; sending SIGTERM count=2

    When six ranks all shout “connection closed,” the first reaction is usually to check the network, the MoE routing, or shared storage. That is the wrong direction. These lines are “co-burial,” not the root cause:

    • In the data parallel group, rank 0 is the head and is responsible for starting the server-side key-value store.
    • It exits first, the store shuts down with it, and all the other ranks block on reading the communication group’s unique ID, so they collectively report “remote closed.”
    • Therefore, the location with the most errors is often not the failure point.

    Three criteria are enough to identify a cascading failure on sight:

    1. The error semantics are “the peer disappeared” (received 0 bytes, connection closed), not “local validation failed.”
    2. There are logs showing a graceful shutdown timeout followed by a termination signal, which means some process is actively cleaning up.
    3. The errors are concentrated on non-zero ranks, while rank 0 and rank 1 have not a single line of error—the one that does not report an error is the culprit.

    Methodologically, this maps to a general principle: logs from the distributed startup phase must be sorted by timestamp to find the “first anomaly,” not sorted by frequency to find “the loudest one.”

    3. Six Common Pitfalls and How to Converge on a Fix

    Pitfall 1: Communication Group Initialization Order and Timeout

    Establishing the HCCL/collective communication group depends on distributing the unique ID. If the head process exits abnormally, the whole group is buried with it. Key checks: confirm the head process is alive, confirm the key-value store port is not occupied, and increase the initialization timeout so you can capture the first stack trace.

    1. # Observe process and port usage (illustrative)
    2. ss -lntp | grep -E '7100|7101|7102|7103|36000|36100|1999'

    The P side is the producer and the D side is the consumer. If the connector type, transport protocol, or serialization format differ between the two sides, the handshake will fail. The key is to keep the configuration symmetric on both ends, and to get a single hop working before adding the proxy.

    Pitfall 3: Port Range and Proxy Forwarding

    Each node’s 4 instances occupy consecutive ports, and adding a proxy can easily cause port drift or forwarding rules that do not match the actual listeners. It is recommended to fix the port allocation table and add a pre-start self-check in the startup script.

    Pitfall 4: Parallel Topology Not Matching the Card Count

    The product of data parallel × tensor parallel must match the number of actually visible cards; a commonly seen trigger is that the device visibility environment variable gets overridden.

    Pitfall 5: Quantized Weight Loading

    Quantized models are more sensitive to weight layout and operator support, and a load failure often shows up as “one rank exits first.” The key is to look at the loading log of the first rank rather than the aggregated error.

    Pitfall 6: Timeouts, Retries, and Avalanches

    When the default timeout is too small, a slow node gets judged as dead, triggering a restart of the whole group and forming a “the more you retry, the more it fails” loop. It is recommended to loosen the timeout first to locate the problem, then tighten the parameters.

    4. A Reusable Troubleshooting Workflow

    1. Sort all logs by time and lock onto the first anomaly and its rank.
    2. Distinguish “peer-disappeared” errors from “local error” errors.
    3. Verify the three static configuration items: ports, device visibility, and the parallelism product.
    4. Get a single instance on a single node working first, then scale to multiple instances and cross-machine.
    5. Finally, bring in the proxy and KV transfer, validating hop by hop.

    5. Conclusion

    The complexity of disaggregated deployment lies not in the operators but in the state coupling during startup. Mastering the criterion of “look at the first one, not the count,” combined with static configuration self-checks and hop-by-hop validation, can compress six failures into a single localization. If you need to carry production traffic, you can combine a container platform, logging service, and monitoring alerts to build a standardized pre-launch validation pipeline.