[bugfix] fix ray start failed: local_world_size cannot little than visible device count error (#4457)

### What this PR does / why we need it?
Fix the ray start failed bug: local_world_size cannot little than
visible device count error
detail see issue #4456.

This fix code is copied from vllm fixing modify, PR:
[#28873](https://github.com/vllm-project/vllm/pull/28873)


- vLLM version: v0.11.2
- vLLM main: https://github.com/vllm-project/vllm/commit/v0.11.2

---------

Signed-off-by: leo-pony <nengjunma@outlook.com>
This commit is contained in:
Nengjun Ma
2025-11-27 21:18:32 +08:00
committed by GitHub
parent 1cae3e4a49
commit 89a1a65300
3 changed files with 16 additions and 6 deletions

View File

@@ -329,6 +329,8 @@ class TestNPUWorker(TestBase):
worker.model_config = MagicMock()
worker.parallel_config = MagicMock()
worker.parallel_config.local_world_size = 0
worker.parallel_config.data_parallel_size = 1
worker.model_config.seed = 42
# Test _init_device