From 01c457d844ba40a48684d36ad0c5c3e9ff8e90a9 Mon Sep 17 00:00:00 2001 From: trtllm-agent <296075020+trtllm-agent@users.noreply.github.com> Date: Thu, 16 Jul 2026 04:19:41 -0700 Subject: [PATCH] [nvbugs/6463812][fix] resolve MpiPoolSession isinstance check under test session-reuse monkey-patch The BART TP=2 CUDA-graph proxy setup failed with: TypeError: isinstance() arg 2 must be a type, a tuple of types, or a union tests/test_common/session_reuse.py rebinds tensorrt_llm.executor.proxy.MpiPoolSession to a factory function so the test suite can intercept pool construction for reuse. Once patched, the module-level name is a callable, not a class, and the isinstance(self.mpi_session, MpiPoolSession) check in _start_executor_workers raises TypeError. Import the concrete class directly from tensorrt_llm.llmapi.mpi_session inside the check site so isinstance always receives the real type, while leaving the module-level import untouched (the constructor call is what the session-reuse harness intentionally intercepts). Remove the corresponding waiver. Signed-off-by: trtllm-agent <296075020+trtllm-agent@users.noreply.github.com> --- tensorrt_llm/executor/proxy.py | 4 ++++ tests/integration/test_lists/waives.txt | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tensorrt_llm/executor/proxy.py b/tensorrt_llm/executor/proxy.py index 11451bad5b67..5b2c1de4f6e2 100644 --- a/tensorrt_llm/executor/proxy.py +++ b/tensorrt_llm/executor/proxy.py @@ -573,6 +573,10 @@ def mpi_done_callback(future: concurrent.futures.Future): raise RuntimeError( "Executor worker returned error") from ready_signal + # Re-import to bypass the test-suite monkey-patch of the module-level + # name (see tests/test_common/session_reuse.py) so isinstance always + # receives the real class rather than the factory shim. + from ..llmapi.mpi_session import MpiPoolSession if isinstance(self.mpi_session, MpiPoolSession) and len(status) == 3: worker_process_identities: List[WorkerProcessIdentity] = status[2] self._worker_process_monitor.register(worker_process_identities) diff --git a/tests/integration/test_lists/waives.txt b/tests/integration/test_lists/waives.txt index 4b6a59b069ec..02b21551d449 100644 --- a/tests/integration/test_lists/waives.txt +++ b/tests/integration/test_lists/waives.txt @@ -377,7 +377,6 @@ full:sm100/examples/test_nemotron.py::test_llm_nemotron_3_8b_1gpu[bfloat16-fp8] full:sm100/unittest/bindings SKIP (Disable for Blackwell) kv_cache/test_kv_cache_v2_scheduler.py::TestKVCacheV2Llama::test_chunked_prefill SKIP (https://nvbugs/6428002) kv_cache/test_kv_cache_v2_scheduler.py::TestKVCacheV2Llama::test_eviction_with_block_reuse SKIP (https://nvbugs/6462303) -llmapi/test_llm_api_pytorch_bart.py::test_bart_pytorch_generate_encoder_decoder_end_to_end[bf16-kv-v1-cuda-graph-on-greedy-tp2-bart-large-cnn] SKIP (https://nvbugs/6463812) llmapi/test_llm_api_pytorch_moe_lora.py::test_mixtral_moe_routed_expert_fp8_multi_lora_varying_ranks[cudagraph] SKIP (https://nvbugs/6463829) llmapi/test_llm_api_pytorch_moe_lora.py::test_mixtral_moe_routed_expert_fp8_multi_lora_varying_ranks[eager] SKIP (https://nvbugs/6463829) llmapi/test_llm_examples.py::test_llmapi_speculative_decoding_eagle3 SKIP (https://nvbugs/6075431)