From 9e11f942c0ba142c7484ac87d95866ac09f8906a Mon Sep 17 00:00:00 2001 From: trtllm-agent <296075020+trtllm-agent@users.noreply.github.com> Date: Wed, 15 Jul 2026 03:05:42 -0700 Subject: [PATCH] [nvbugs/6450338][fix] use is_comm_session predicate to survive symbol rebind The test suite's session-reuse helper (tests/test_common/session_reuse.py) rebinds the module-level MpiPoolSession symbol in tensorrt_llm.executor.proxy to a factory function so cached pools can be handed to subsequent bare LLM(...) tests. Once the symbol is a function object, the isinstance(self.mpi_session, MpiPoolSession) check in _start_executor_workers raises TypeError: isinstance() arg 2 must be a type, a tuple of types, or a union. Switch to the polymorphic predicate self.mpi_session.is_comm_session() already defined on MpiSession. Method resolution goes through the real instance (or the _ReusableSession wrapper's __getattr__ delegation), so this works whether the module symbol is rebound or not, and it is more robust than a class-based check for a state that already has an abstract API on the base class. Also unwaive the previously-skipped TestGPTOSS::test_w4_4gpus[v1_kv_cache-ep4-trtllm-fp8]. 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, 3 insertions(+), 2 deletions(-) diff --git a/tensorrt_llm/executor/proxy.py b/tensorrt_llm/executor/proxy.py index 11451bad5b67..6118561d534b 100644 --- a/tensorrt_llm/executor/proxy.py +++ b/tensorrt_llm/executor/proxy.py @@ -573,7 +573,9 @@ 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, 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 e6fd0e0f0d8b..d44de6cf636e 100644 --- a/tests/integration/test_lists/waives.txt +++ b/tests/integration/test_lists/waives.txt @@ -89,7 +89,6 @@ accuracy/test_llm_api_pytorch.py::TestGPTOSS::test_eagle3_guided_decoding_4gpus[ accuracy/test_llm_api_pytorch.py::TestGPTOSS::test_w4_1gpu[v1_kv_cache-True-True-triton-auto] SKIP (https://nvbugs/6026676) accuracy/test_llm_api_pytorch.py::TestGPTOSS::test_w4_4gpus[v1_kv_cache-dp4-cutlass-auto] SKIP (https://nvbugs/6388142) accuracy/test_llm_api_pytorch.py::TestGPTOSS::test_w4_4gpus[v1_kv_cache-ep4-cutlass-auto] SKIP (https://nvbugs/5596343) -accuracy/test_llm_api_pytorch.py::TestGPTOSS::test_w4_4gpus[v1_kv_cache-ep4-trtllm-fp8] SKIP (https://nvbugs/6450338) accuracy/test_llm_api_pytorch.py::TestGPTOSS::test_w4_4gpus[v1_kv_cache-tp4-cutlass-auto] SKIP (https://nvbugs/5596343) accuracy/test_llm_api_pytorch.py::TestGPTOSS::test_w4_4gpus[v1_kv_cache-tp4-cutlass-fp8] SKIP (https://nvbugs/5651865) accuracy/test_llm_api_pytorch.py::TestGPTOSS::test_w4_4gpus[v2_kv_cache-dp4-cutlass-auto] SKIP (https://nvbugs/5596343)