[https://nvbugs/6462303][fix] Import MpiPoolSession under a second private alias (_RealMpiPoolSession)…#16497
Closed
trtllm-agent wants to merge 1 commit into
Closed
Conversation
…instance check The recently added `isinstance(self.mpi_session, MpiPoolSession)` check in proxy._start_executor_workers relied on the module-level `MpiPoolSession` name. However, the test-suite session-reuse infra (tests/test_common/ session_reuse.py) monkey-patches that same module-level symbol to a factory *function* for pool reuse. isinstance() against a non-class then raises "TypeError: isinstance() arg 2 must be a type, a tuple of types, or a union", breaking every LLM(...) construction while the pool cache is active. Bind the real class under a private alias that the test infra never patches, and use it for the isinstance check. Construction still goes through the patched `MpiPoolSession` name, so pool reuse continues to work. Also remove the now-obsolete waiver. Signed-off-by: trtllm-agent <296075020+trtllm-agent@users.noreply.github.com>
trtllm-agent
requested review from
brnguyen2,
cascade812,
mikeiovine,
schetlur-nv,
yiqingy0,
yuanjingx87 and
yufeiwu-nv
July 16, 2026 11:49
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThe worker startup path now checks against the original ChangesMPI worker initialization
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Collaborator
|
Closing this as it's superseded by #16444 |
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
isinstance(self.mpi_session, MpiPoolSession)used the module-levelMpiPoolSessionname, which the test-suite session-reuse infra monkey-patches to a factory function;isinstance()against a non-class raisesTypeError.MpiPoolSessionunder a second private alias (_RealMpiPoolSession) that the test infra never patches, and use it for the isinstance check; construction still uses the patched name so pool reuse is preserved. Waiver removed.Test plan
Links
Summary by CodeRabbit