[Doc][Example][Bugfix] Elements in local_device_ids should be casted … (#3782)

### 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:
c9461e05a4

---------

Signed-off-by: paulyu12 <507435917@qq.com>
This commit is contained in:
yupeng
2025-10-27 14:52:47 +08:00
committed by GitHub
parent 638d8d1a47
commit b8796b06c8

View File

@@ -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) chips_per_card = int(chips_per_card)
if args.local_device_ids: 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: else:
local_device_ids = [] local_device_ids = []
for card_id in range(num_cards): for card_id in range(num_cards):