Skip to content

Commit 174c518

Browse files
authored
fix[nvbug/5286515]: trtllm-llmapi-launch on single node single gpu (#4428)
* add test Signed-off-by: Superjomn <[email protected]> * fix Signed-off-by: Superjomn <[email protected]> --------- Signed-off-by: Superjomn <[email protected]>
1 parent bc6a69e commit 174c518

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

tensorrt_llm/llmapi/mpi_session.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,6 @@ def __reduce__(self):
179179
class MpiCommSession(MpiSession):
180180

181181
def __init__(self, comm=None, n_workers: int = 1):
182-
if not external_mpi_comm_available(n_workers):
183-
raise RuntimeError('The LLM instance should be launched by mpirun.')
184-
185182
self.comm = comm
186183
self.n_workers = n_workers
187184
self.thread_pool: Optional[ThreadPoolExecutor] = None

tests/unittest/llmapi/test_llm_multi_gpu.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,8 @@ def test_llm_multi_node(engine_from_checkpoint: tempfile.TemporaryDirectory):
315315

316316

317317
@skip_single_gpu
318-
def test_llm_multi_node_pytorch():
319-
nworkers = 2
318+
@pytest.mark.parametrize("nworkers", [1, 2])
319+
def test_llm_multi_node_pytorch(nworkers: int):
320320
test_case_file = os.path.join(os.path.dirname(__file__), "run_llm.py")
321321
os.path.join(os.path.dirname(__file__), "launch.py")
322322
command = f"mpirun --allow-run-as-root -n {nworkers} trtllm-llmapi-launch python3 {test_case_file} --model_dir {llama_model_path} --tp_size {nworkers} --use_pytorch"

0 commit comments

Comments
 (0)