From b8796b06c8f72a92581eda92126d5a9c74f24201 Mon Sep 17 00:00:00 2001 From: yupeng <507435917@qq.com> Date: Mon, 27 Oct 2025 14:52:47 +0800 Subject: [PATCH] =?UTF-8?q?[Doc][Example][Bugfix]=20Elements=20in=20local?= =?UTF-8?q?=5Fdevice=5Fids=20should=20be=20casted=20=E2=80=A6=20(#3782)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### What this PR does / why we need it? It's a tiny bugfix in the `gen_ranktable.py` script. The script is an util to help setup an example case. It is used to prepare a ranktable before disaggregated prefill deployment. Elements in `local_device_ids` list should be casted to `int` type before referred for a MOD math operation. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? No. - vLLM version: v0.11.0 - vLLM main: https://github.com/vllm-project/vllm/commit/c9461e05a4ed3557cfbf4b15ded1e26761cc39ca --------- Signed-off-by: paulyu12 <507435917@qq.com> --- examples/disaggregated_prefill_v1/gen_ranktable.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/disaggregated_prefill_v1/gen_ranktable.py b/examples/disaggregated_prefill_v1/gen_ranktable.py index 98ce9f5c..3ed8b768 100644 --- a/examples/disaggregated_prefill_v1/gen_ranktable.py +++ b/examples/disaggregated_prefill_v1/gen_ranktable.py @@ -63,7 +63,11 @@ chips_per_card = get_cmd_stdout("npu-smi info -l | grep \"Chip Count\"").split( chips_per_card = int(chips_per_card) if args.local_device_ids: - local_device_ids = args.local_device_ids.split(',') + try: + local_device_ids = [int(id_str) for id_str in args.local_device_ids.split(',')] + except ValueError: + print(f"Error: --local-device-ids must be a comma-separated list of integers. Received: '{args.local_device_ids}'") + exit(1) else: local_device_ids = [] for card_id in range(num_cards):