Skip to content

[https://nvbugs/6272598][fix] Replace the positive isinstance(..., MpiPoolSession) check with a negative…#16411

Closed
trtllm-agent wants to merge 1 commit into
NVIDIA:mainfrom
tensorrt-cicd:repair-bot-bug6272598
Closed

[https://nvbugs/6272598][fix] Replace the positive isinstance(..., MpiPoolSession) check with a negative…#16411
trtllm-agent wants to merge 1 commit into
NVIDIA:mainfrom
tensorrt-cicd:repair-bot-bug6272598

Conversation

@trtllm-agent

@trtllm-agent trtllm-agent commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Root cause: isinstance(self.mpi_session, MpiPoolSession) raises TypeError because tests/test_common/session_reuse.py monkey-patches MpiPoolSession in tensorrt_llm.executor.proxy to a factory function (not a class).
  • Fix: Replace the positive isinstance(..., MpiPoolSession) check with a negative check against (MpiCommSession, RemoteMpiCommSessionClient), mirroring the existing pattern in the same function.
  • Automated fix generated by repair-bot

Test plan

  • Verify fix on the same GPU type as the original failure
  • Check for regressions in related tests

Links

Summary by CodeRabbit

  • Bug Fixes
    • Improved worker startup monitoring across supported MPI session modes.
    • Ensured worker process identities are registered consistently, except for remote and standard MPI communication sessions.

…patch

The session-reuse test infrastructure (tests/test_common/session_reuse.py)
monkey-patches MpiPoolSession 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 a negative check against the never-patched MpiCommSession /
RemoteMpiCommSessionClient types, matching the pattern already used earlier
in the same function.

Signed-off-by: trtllm-agent <296075020+trtllm-agent@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 0d6444ae-3e94-4c55-9e1f-9cefaecf4765

📥 Commits

Reviewing files that changed from the base of the PR and between 95f9f92 and 58844a0.

📒 Files selected for processing (1)
  • tensorrt_llm/executor/proxy.py

📝 Walkthrough

Walkthrough

The worker initialization logic changes its MPI session type guard so worker_process_identities registration applies to additional session modes while excluding MpiCommSession and RemoteMpiSessionClient.

Changes

MPI startup registration

Layer / File(s) Summary
Session type registration guard
tensorrt_llm/executor/proxy.py
The len(status) == 3 startup path registers worker process identities for MPI session types other than MpiCommSession and RemoteMpiSessionClient, replacing the previous MpiPoolSession-only check.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

Suggested reviewers: cascade812, lori-ren

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the bug fix and ticket, and it clearly describes the main code change.
Description check ✅ Passed The description explains the root cause, fix, test plan, and bug link, though it doesn't follow the template headings exactly.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@cascade812

Copy link
Copy Markdown
Collaborator

This fix is already merged by PR #16444

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants