File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -573,7 +573,18 @@ def mpi_done_callback(future: concurrent.futures.Future):
573573 raise RuntimeError (
574574 "Executor worker returned error" ) from ready_signal
575575
576- if isinstance (self .mpi_session , MpiPoolSession ) and len (status ) == 3 :
576+ self ._register_worker_processes (status )
577+
578+ def _register_worker_processes (self , status : tuple ) -> None :
579+ """Register identities returned by locally spawned MPI workers.
580+
581+ Test session reuse replaces this module's ``MpiPoolSession`` class
582+ reference with a factory, so identify pool-backed sessions by excluding
583+ the external communication session types.
584+ """
585+ if not isinstance (
586+ self .mpi_session ,
587+ (MpiCommSession , RemoteMpiCommSessionClient )) and len (status ) == 3 :
577588 worker_process_identities : List [WorkerProcessIdentity ] = status [2 ]
578589 self ._worker_process_monitor .register (worker_process_identities )
579590
Original file line number Diff line number Diff line change @@ -447,9 +447,7 @@ test_e2e.py::test_multi_nodes_eval[MiniMax-M2-tp16-mmlu] SKIP (https://nvbugs/63
447447test_e2e.py::test_multi_nodes_eval[MiniMax-M3-tp16-mmlu] SKIP (https://nvbugs/6373561)
448448test_e2e.py::test_ptp_quickstart_advanced_deepseek_r1_w4afp8_8gpus[DeepSeek-R1-W4AFP8-DeepSeek-R1/DeepSeek-R1-W4AFP8] SKIP (https://nvbugs/5836830)
449449unittest/_torch/misc/test_share_tensor.py::TestShareTensor::test_share_tensor_different_dtypes SKIP (https://nvbugs/6418021)
450- unittest/_torch/modeling -k "modeling_out_of_tree" SKIP (https://nvbugs/6426847)
451450unittest/_torch/modeling -k "modeling_qwen" SKIP (https://nvbugs/6433376)
452- unittest/_torch/modeling/test_modeling_out_of_tree.py::TestOutOfTree::test_llm_api[True] SKIP (https://nvbugs/6426847)
453451unittest/_torch/modeling/test_modeling_qwen3_5_vl.py::test_qwen35_dense_vl_resolves_mamba_ssm_cache_dtype SKIP (https://nvbugs/6433376)
454452unittest/_torch/modules/moe/test_moe_backend.py::test_moe_backend[act=Relu2-e60_k4_h2048_i1408-seq=8-dtype=torch.bfloat16-backend=TRTLLM-quant=NVFP4-routing=Renormalize] SKIP (https://nvbugs/5989912)
455453unittest/_torch/modules/moe/test_moe_module.py::test_configurable_moe_single_gpu -k "TRTLLM" SKIP (https://nvbugs/6464169)
Original file line number Diff line number Diff line change 1616
1717import asyncio
1818import queue as _queue
19+ from unittest .mock import Mock
1920
2021import pytest
2122
2223from tensorrt_llm .executor import EngineDeadError
24+ from tensorrt_llm .executor import proxy as proxy_module
2325from tensorrt_llm .executor .proxy import GenerationExecutorProxy
2426from tensorrt_llm .executor .result import GenerationResult
2527
@@ -97,6 +99,20 @@ def test_handle_worker_death_broadcasts_event_driven():
9799 assert proxy ._error_queue .get_nowait () is cause
98100
99101
102+ def test_register_worker_processes_with_session_reuse_factory (monkeypatch ):
103+ """Session reuse replaces proxy.MpiPoolSession with a factory function."""
104+ pool_session = object ()
105+ monkeypatch .setattr (proxy_module , "MpiPoolSession" , lambda n_workers : pool_session )
106+ proxy = _bare_proxy ()
107+ proxy .mpi_session = proxy_module .MpiPoolSession (1 )
108+ proxy ._worker_process_monitor = Mock ()
109+ identities = [object ()]
110+
111+ proxy ._register_worker_processes ((proxy .READY_SIGNAL , None , identities ))
112+
113+ proxy ._worker_process_monitor .register .assert_called_once_with (identities )
114+
115+
100116def test_result_step_raises_on_engine_dead ():
101117 res = GenerationResult .__new__ (GenerationResult )
102118 res .queue = _queue .Queue ()
You can’t perform that action at this time.
0 commit comments