Skip to content

Commit 9979500

Browse files
committed
up
Signed-off-by: Rui Qiao <[email protected]>
1 parent d1822fa commit 9979500

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

vllm/distributed/utils.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,17 @@ def get_pp_indices(num_hidden_layers: int, pp_rank: int,
8080
if sum(partitions) != num_hidden_layers:
8181
raise ValueError(
8282
f"{sum(partitions)=} does not match {num_hidden_layers=}.")
83+
if envs.VLLM_USE_V1 and len(set(partitions)) != 1:
84+
raise NotImplementedError(
85+
f"Currently in V1, all pipeline parallel stages need to have "
86+
f"the same number of layers. Got {partitions=}.")
8387
start_layer = sum(partitions[:pp_rank])
8488
end_layer = start_layer + partitions[pp_rank]
8589
else:
90+
if envs.VLLM_USE_V1 and num_hidden_layers % pp_size != 0:
91+
raise NotImplementedError(
92+
f"Currently in V1, num_hidden_layers={num_hidden_layers} "
93+
f"must be divisible by pp_size={pp_size}.")
8694
layers_per_partition = num_hidden_layers // pp_size
8795
start_layer = pp_rank * layers_per_partition
8896
end_layer = start_layer + layers_per_partition

0 commit comments

Comments
 (0)