Scenario

Tensor parallel refused, data parallel starved

L3SeniorIncident25 minDebuggingSystem design

RolesInference EngineeringCustomer AI Deployment

Engine
SGLang 0.5.22
Model
Qwen/Qwen3-8B
Hardware
a node with two L4 GPUs, the second shared with another team's pods

Situation

A team serves Qwen/Qwen3-8B from one L4 and wants more capacity. The node has a second L4, so the plan is to use both. The first attempt is --tp-size 2. The server dies two seconds after NCCL comes up, with a RuntimeError that says the memory capacity is unbalanced and that some GPUs may be occupied by other processes. A quick look at the node shows two small pods from another team on the second card.

The second attempt is --dp-size 2, two copies of the model behind one controller. It starts, and the team runs its load sweep. At 64 users the pair delivers less output each second than the single card did, and each first token takes many seconds. An engineer from the other team suggests that the node itself is half broken and asks for a hardware ticket. You are asked to read the logs first.

Questions

  1. What does the tensor parallel check compare, and why did the data parallel start pass where it failed?
  2. The two copies loaded the same weights. Why is one pool an eighth of the other?
  3. Under load, which rank held the queue and which one sat near idle? Which default sent the work there?
  4. Would two copies with equal pools have doubled the capacity? What would you read before you claim it?
  5. Name two fixes that keep both cards and one that does not, and say which of them the manual measured.

Commit to a cause after each listing. Write it down before you read the next one.

Evidence

1/7

what the second GPU held minutes before the start

Read the memory used on each GPU and the two processes that held it.

evidence/the-other-tenant.txt
# sglang serve --tp-size 2 on two L4s while two other pods held 3.5 GB of GPU1
# nvidia-smi --query-gpu=index,memory.used,utilization.gpu, 2026-10-17, read minutes before the start
0, 0 MiB, 0 %
1, 3506 MiB, 55 %
# GPU1 compute apps: two pods running python3 "CUDA vGPU Slice Diagnostics", 1746 MiB each

Source: manuals/sglang-101/capture/gpu/incidents/l4-tp-unbalanced-memory.txt, lines 1-5

2/7

the tensor parallel start, two seconds after NCCL came up

The RuntimeError gives three numbers: the free memory before loading, the local GPU memory and 90 percent of it.

evidence/tp2-refused.txt
# runs/l4/load/tp2/server.log, lines after the NCCL version
[2026-10-17 05:22:01 TP0] sglang is using nccl==2.30.7
[2026-10-17 05:22:03 TP0] Scheduler hit an exception: Traceback (most recent call last):
    raise RuntimeError(msg)
RuntimeError: The memory capacity is unbalanced. Some GPUs may be occupied by other processes. pre_model_load_memory=18.28375244140625, local_gpu_memory=21.70391845703125, local_gpu_memory * 0.9=19.533526611328124
[2026-10-17 05:22:03] Received sigquit from a child process. It usually means the child failed.

Source: manuals/sglang-101/capture/gpu/incidents/l4-tp-unbalanced-memory.txt, lines 7-12

3/7

the data parallel start: the weights and the pool of each rank

Compare the available memory after the weights and the token count of the two pools.

evidence/dp2-two-pools.txt
[2026-10-17 05:26:45 DP0] Load weight end. elapsed=3.61 s, type=Qwen3ForCausalLM, avail mem=6.59 GB, mem usage=15.28 GB.
[2026-10-17 05:26:45 DP1] Load weight end. elapsed=3.73 s, type=Qwen3ForCausalLM, avail mem=3.17 GB, mem usage=15.28 GB.
[2026-10-17 05:26:46 DP0] KV Cache is allocated. dtype: torch.bfloat16, #tokens: 24094, K size: 1.65 GB, V size: 1.65 GB
[2026-10-17 05:26:46 DP1] KV Cache is allocated. dtype: torch.bfloat16, #tokens: 2925, K size: 0.20 GB, V size: 0.20 GB
[2026-10-17 05:27:19 DP0] max_total_num_tokens=24094, chunked_prefill_size=4096, max_prefill_tokens=16384, max_running_requests=2048, context_len=40960, available_gpu_mem=1.36 GB
[2026-10-17 05:28:30 DP1] max_total_num_tokens=2925, chunked_prefill_size=4096, max_prefill_tokens=16384, max_running_requests=1462, context_len=40960, available_gpu_mem=0.94 GB

Source: manuals/sglang-101/capture/gpu/out-l4/server-dp2.log, lines 1-6

4/7

four decode lines of the two ranks under a load of 64 requests

Compare running requests, token usage, generation throughput and the queue of each rank.

evidence/dp2-under-load.txt
[2026-10-17 07:26:50 DP1] Decode batch, #running-req: 4, #token: 2385, token usage: 0.82, cuda graph: True, gen throughput (token/s): 25.48, #queue-req: 59
[2026-10-17 07:26:53 DP0] Decode batch, #running-req: 1, #token: 590, token usage: 0.02, cuda graph: True, gen throughput (token/s): 9.67, #queue-req: 0
[2026-10-17 07:26:56 DP1] Decode batch, #running-req: 4, #token: 2545, token usage: 0.87, cuda graph: True, gen throughput (token/s): 25.79, #queue-req: 59
[2026-10-17 07:26:59 DP0] Decode batch, #running-req: 3, #token: 1665, token usage: 0.07, cuda graph: True, gen throughput (token/s): 9.49, #queue-req: 0

Source: manuals/sglang-101/capture/gpu/out-l4/server-dp2.log, lines 7-10

5/7

what the tensor parallel check does, and why it is right

Two paragraphs from the manual.

evidence/the-check-and-the-rule.txt
Before it loads weights, each rank measures its free memory, and the group keeps the smallest value. If that value is less than 90 percent of the local free memory, the server stops {{code}}. The second card had 18.28 GB free against the 19.53 GB that the check required. No flag turns the check off at v0.5.22.

The check is right to stop. Each rank of a TP group holds the same share of weights and the same pool. The smallest card sets the size for all of them. On a shared machine, give a TP group whole GPUs. `--dp-size 2` does not have this check, because each copy sizes its own pool, so it started on the same pair.

Source: manuals/sglang-101/sections/6-1-tp-size-dp-size-and-attn-dp-size.md, lines 113-115

6/7

how the default load balancing method filled the small copy

Read how many requests sat on the small copy at a concurrency of 64.

evidence/what-round-robin-did.txt
The second card had 3.17 GB free after the weights, against 6.59 GB on the first, because the two pods held the rest. **We measured** a pool of 2,925 tokens on that copy, an eighth of the first. Four requests of 640 tokens fill it.

The controller still sent every second request to that copy, because `round_robin` does not look at pools or queues. The benchmark keeps 64 requests open at a time. At concurrency 64, 63 of them sat on the small copy, 4 running and 59 waiting. The large copy had one to three requests and used 2 to 7 percent of its pool. The client could not send it more work until the small copy gave a slot back.

Source: manuals/sglang-101/sections/6-1-tp-size-dp-size-and-attn-dp-size.md, lines 137-139

7/7

the same pair with requests routed by token count

Compare the three throughput numbers at 64 users, and read the clock caution.

evidence/routed-by-tokens.txt
At 64 users the pair gave 114.7 tok/s routed by tokens, against 41.7 with round robin and 250.9 on one L4. At 8 users it gave 92.1 against 64.2 and 112.6. The median TTFT at 64 users fell from 4,763 to 3,977 ms. The median clock at 64 users was 1,020 MHz, against 675 MHz in the round-robin run. So part of the gain can be the card.

Source: manuals/sglang-101/sections/6-1-tp-size-dp-size-and-attn-dp-size.md, lines 169-169

The answer

Show the walkthrough
  1. Read the check in the tensor parallel error. Before it loads weights, each rank measures its free memory, and the group keeps the smallest value. If that value is below 90 percent of the local free memory, the server stops. The error prints the three numbers: the free memory before loading, 18.28 GB, the local memory of the card, and 90 percent of that local memory, 19.53 GB, as the line. The second card had 3,506 MiB in use by two pods of 1,746 MiB each, and that put it under the line. No flag turns the check off at this version. The check is right to stop, because every rank of a tensor parallel group holds the same share of the weights and the same pool, so the smallest card would set the pool for both.
  2. Read why data parallel started. Each copy sizes its own pool, so there is no balance check. Both ranks loaded 15.28 GB of weights. Rank 0 then had 6.59 GB free and rank 1 had 3.17 GB, because the pods held the rest. The pools came out at 24,094 tokens against 2,925. Four requests of 640 tokens fill the small one.
  3. Read the four decode lines. Rank 1 ran 4 requests at a token usage of 0.82 to 0.87, wrote about 25 tokens per second, and had 59 requests in its queue. Rank 0 ran 1 to 3 requests at a usage of 0.02 to 0.07, wrote under 10 tokens per second, and had no queue. The controller's default method, auto, resolves to round_robin outside disaggregation, and round robin does not look at pools or queues. The benchmark keeps 64 requests open, so 63 of them sat on the small copy, 4 running and 59 waiting, and the client could not send the large copy more work until the small copy gave a slot back.
  4. Put a number on the loss. At 64 users the pair gave 41.7 tokens per second against 250.9 on one L4, and the median P99 time to the first token over three seeds was 391 seconds for the pair and 33.4 for one L4. The pair also ran at 765 and 675 MHz at the two highest loads, under the clock floor, while the single card ran at 1,320 and 1,080 MHz, so part of the loss is the clock. Up to 4 users the pair was already 16 to 41 percent slower, for a reason the manual did not isolate.
  5. Read the one fix that was measured. With --load-balance-method total_tokens, each request goes to the copy that holds the fewest tokens. The same uneven pair then gave 114.7 tokens per second at 64 users, against 41.7 with round robin and 250.9 on one card, and the median first token fell from 4,763 to 3,977 ms. The clock was 1,020 MHz in that run against 675 before, so part of that gain can be the card. The manual did not measure a pair with equal pools, and it did not measure two servers behind a gateway with weights. Its expectation is that data parallelism adds capacity only when every copy has about the same pool.
Show the resolution

The node is not broken. The second card carries another tenant, and both layouts answered that fact in their own way: the balance check stopped the first layout before it loaded, and the second layout gave one copy a pool of 2,925 tokens and then fed it every second request. The team went back to one L4 for production traffic, because it beat the pair at every load, and asked for the pods to move. With two whole cards, they will start --dp-size 2 again and accept it only after the two #tokens lines of the DP0 and DP1 ranks read about the same.

The pair of decode lines is the evidence for this reading: the rank with the small pool held 59 waiting requests while the rank with the large pool used 2 to 7 percent of its pool. Routing by token count raised the pair from 41.7 to 114.7 tokens per second at 64 users and still lost to the single card, so the pool, and not the router, is the limit to fix.

Show the wrong turns
  • “Tensor parallel is refused, so use data parallel, which starts.”

    Starting is not serving. Read the #tokens line of every rank before the load test, because each copy sizes its own pool and nobody checks them against each other.

  • “Lower the memory fraction so the tensor parallel check passes.”

    The check compares free memory before the weights load, not the fraction. The smaller card would still set the pool for both ranks.

  • “Round robin is fair, so the loss must be the hardware.”

    Round robin does not read pools or queues. At 64 open requests, 63 sat on the copy with the small pool.

  • “Fix the routing and the two copies will double throughput.”

    Routed by tokens, the pair gave 114.7 tokens per second against 250.9 for one card. The small pool is still there, and part of the gain was a higher clock.

Show the general rule

A parallel layout is a promise that every member carries an equal share. Tensor parallelism checks that promise before it loads and stops when a card is short. Data parallelism makes no check and gives each copy what its card has left, so a shared card becomes a small copy that a blind router fills first. Before you add a GPU, read what else lives on it, and after the start, read the pool line of every rank. Capacity that you did not verify per rank is a sum that does not add.

Taught in

The parallelism page of SGLang 101 records both starts and the routing fix in what happened on two L4s and data parallelism on the same pair lost, and the memory page explains why a pool is sized from the free memory of its own card in how SGLang decides the split.