From bbac4612ea3b38610b596559cedb0540496c72cf Mon Sep 17 00:00:00 2001 From: trtllm-agent <296075020+trtllm-agent@users.noreply.github.com> Date: Thu, 16 Jul 2026 02:25:02 -0700 Subject: [PATCH] [nvbugs/6463829][fix] use is_comm_session predicate to survive symbol rebind The session-reuse test infrastructure (tests/test_common/session_reuse.py) monkey-patches the module-level MpiPoolSession symbol in tensorrt_llm.executor.proxy with a factory function to enable pool reuse across LLM instances. This broke isinstance(self.mpi_session, MpiPoolSession) in _start_executor_workers with: TypeError: isinstance() arg 2 must be a type, a tuple of types, or a union Switch to the polymorphic MpiSession.is_comm_session() predicate, which is a method call on the instance and does not depend on the module-level MpiPoolSession symbol staying bound to the class. Negating it selects the same set of local-pool sessions (MpiPoolSession-and-subclasses) as the original isinstance check. Remove the two waivers now that both parametrize variants of the test pass. Signed-off-by: trtllm-agent <296075020+trtllm-agent@users.noreply.github.com> --- tensorrt_llm/executor/proxy.py | 5 ++++- tests/integration/test_lists/waives.txt | 2 -- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tensorrt_llm/executor/proxy.py b/tensorrt_llm/executor/proxy.py index 11451bad5b67..909059e5f026 100644 --- a/tensorrt_llm/executor/proxy.py +++ b/tensorrt_llm/executor/proxy.py @@ -573,7 +573,10 @@ def mpi_done_callback(future: concurrent.futures.Future): raise RuntimeError( "Executor worker returned error") from ready_signal - if isinstance(self.mpi_session, MpiPoolSession) and len(status) == 3: + # Use the polymorphic predicate: the module-level ``MpiPoolSession`` + # symbol may be rebound to a factory at runtime by test infrastructure, + # breaking ``isinstance``. + if not self.mpi_session.is_comm_session() 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..fb8ef1af8f0e 100644 --- a/tests/integration/test_lists/waives.txt +++ b/tests/integration/test_lists/waives.txt @@ -378,8 +378,6 @@ 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) perf/test_perf.py::test_perf[bart_large_cnn-plugin-float16-bs:8-input_output_len:60,20] SKIP # (https://nvidia.slack.com/archives/C059LSY62BT/p1704525727177449) perf/test_perf.py::test_perf[flan_t5_base-bench-float16-input_output_len:128,20] SKIP