Skip to content

[https://nvbugs/5979673][fix] Unwaive test_agent_multi_backends.py::test_run_with_different_env - #14939

Merged
Shixiaowei02 merged 2 commits into
NVIDIA:mainfrom
Shixiaowei02:user/xiaoweis/pin-nixl-cu13_2
Jun 4, 2026
Merged

[https://nvbugs/5979673][fix] Unwaive test_agent_multi_backends.py::test_run_with_different_env#14939
Shixiaowei02 merged 2 commits into
NVIDIA:mainfrom
Shixiaowei02:user/xiaoweis/pin-nixl-cu13_2

Conversation

@Shixiaowei02

@Shixiaowei02 Shixiaowei02 commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Improvements
    • Enhanced CUDA version detection for disaggregated inference operations to support multiple CUDA versions.
  • Tests
    • Resolved a known issue in disaggregated agent multi-backend testing, removing the associated test waiver.

Description

Test Coverage

PR Checklist

Please review the following before submitting your PR:

  • PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.

  • PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.

  • Test cases are provided for new code paths (see test instructions)

  • If PR introduces API changes, an appropriate PR label is added - either api-compatible or api-breaking. For api-breaking, include BREAKING in the PR title.

  • Any new dependencies have been scanned for license and vulnerabilities

  • CODEOWNERS updated if ownership changes

  • Documentation updated as needed

  • Update tava architecture diagram if there is a significant design change in PR.

  • The reviewers assigned automatically/manually are appropriate for the PR.

  • Please check this after reviewing the above items as appropriate for this PR.

GitHub Bot Help

To see a list of available CI bot commands, please comment /bot help.

The trtllm dev environment used to install the meta `nixl` package,
which provides a top-level `nixl/__init__.py` shim that redirects to
`nixl_cu13` / `nixl_cu12`. After
NVIDIA#14436 switched the
dependency to `nixl-cu13` directly, the meta shim is no longer present,
so `from nixl import nixl_agent, ...` in
`tensorrt_llm/_torch/disaggregation/nixl/_agent_py.py` raises
`ModuleNotFoundError: No module named 'nixl'` at import time, which in
turn breaks
`test_agent_multi_backends::test_run_with_different_env[1]` during
collection of the spawned subprocess pytest.

Resolve the symbols from `nixl_cu13` (or `nixl_cu12`) first and fall
back to the meta-package only when neither CUDA-specific package is
installed.

Signed-off-by: Shixiaowei02 <39303645+Shixiaowei02@users.noreply.github.com>
This case (TRTLLM_USE_PY_NIXL_KVCACHE=1) was waived under nvbugs/5979673
because the meta `nixl` package pulled the latest `nixl-cu12` wheel,
whose `_bindings.so` referenced symbols absent from the source-built
0.9.0 `libnixl.so`. With `nixl-cu13==0.9.0` directly pinned in
requirements-dev.txt, the bindings and the libnixl in the container are
ABI-consistent again, so the test is expected to pass.

Signed-off-by: Shixiaowei02 <39303645+Shixiaowei02@users.noreply.github.com>
@Shixiaowei02
Shixiaowei02 requested a review from a team as a code owner June 4, 2026 05:29
@Shixiaowei02

Copy link
Copy Markdown
Collaborator Author

/bot skip --comment "CI had already passed in /LLM/main/L0_MergeRequest_PR pipeline #40891 before handling the waive file conflicts."

@Shixiaowei02
Shixiaowei02 requested a review from chuangz0 June 4, 2026 05:30
@Shixiaowei02 Shixiaowei02 changed the title [None][fix] Unwaive test_agent_multi_backends.py::test_run_with_different_env[1] [https://nvbugs/5979673][fix] Unwaive test_agent_multi_backends.py::test_run_with_different_env[1] Jun 4, 2026
@Shixiaowei02
Shixiaowei02 requested a review from bo-nv June 4, 2026 05:31
@Shixiaowei02 Shixiaowei02 changed the title [https://nvbugs/5979673][fix] Unwaive test_agent_multi_backends.py::test_run_with_different_env[1] [https://nvbugs/5979673][fix] Unwaive test_agent_multi_backends.py::test_run_with_different_env Jun 4, 2026
@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR updates the NIXL module dependency import logic to support CUDA-specific package variants with automatic fallback, and removes a corresponding test waiver that is no longer needed following the import fix.

Changes

NIXL Dependency Import and Test Waiver

Layer / File(s) Summary
NIXL dynamic CUDA-aware import fallback
tensorrt_llm/_torch/disaggregation/nixl/_agent_py.py
Module imports attempt nixl_cu13, then nixl_cu12, then nixl in sequence, with explicit ImportError if none are found. The symbols nixl_agent, nixl_agent_config, and nixl_xfer_handle are bound from the successfully imported package.
Test waiver removal
tests/integration/test_lists/waives.txt
Waiver entry for unittest/disaggregated/test_agent_multi_backends.py::test_run_with_different_env[1] is removed, indicating the test now passes with the updated import logic.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • NVIDIA/TensorRT-LLM#14854: Modifies tests/integration/test_lists/waives.txt with additional waived test changes.
  • NVIDIA/TensorRT-LLM#14545: Directly related waiver removal for the same unittest/disaggregated/test_agent_multi_backends.py::test_run_with_different_env[1] test case.
  • NVIDIA/TensorRT-LLM#14896: Related test waiver list modifications in tests/integration/test_lists/waives.txt.

Suggested reviewers

  • tburt-nv
  • dpitman-nvda
  • yuanjingx87
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is mostly empty, containing only the template structure without filling in the required Description and Test Coverage sections. Fill in the Description section explaining the NIXL import fix and test unwaival, and list the relevant tests (test_agent_multi_backends.py::test_run_with_different_env[1]) in Test Coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically identifies the main change: unwaiving a previously skipped test by addressing the underlying NIXL import issue.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tensorrt_llm/_torch/disaggregation/nixl/_agent_py.py`:
- Around line 17-21: The loop that probes NIXL candidates uses
importlib.import_module(_candidate) and currently catches ImportError broadly,
which may hide failures inside a module; change the except clause to catch
ModuleNotFoundError as e, inspect e.name (or e.args[0]) and only continue when
the missing module equals the candidate string (_candidate); for any other
ModuleNotFoundError or any other ImportError/exception raised by
importlib.import_module, re-raise it so real import-time errors inside the
candidate are not swallowed; ensure this logic references _candidate and
_nixl_mod in the same block.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 5b508712-758f-48fc-9d99-846e9df16b48

📥 Commits

Reviewing files that changed from the base of the PR and between b7ca2a6 and a1625b1.

📒 Files selected for processing (2)
  • tensorrt_llm/_torch/disaggregation/nixl/_agent_py.py
  • tests/integration/test_lists/waives.txt
💤 Files with no reviewable changes (1)
  • tests/integration/test_lists/waives.txt

Comment thread tensorrt_llm/_torch/disaggregation/nixl/_agent_py.py
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #51980 [ skip ] triggered by Bot. Commit: a1625b1 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #51980 [ skip ] completed with state SUCCESS. Commit: a1625b1
Skipping testing for commit a1625b1

Link to invocation

@Shixiaowei02
Shixiaowei02 enabled auto-merge (squash) June 4, 2026 06:14
@Shixiaowei02
Shixiaowei02 requested a review from liji-nv June 4, 2026 06:14
@Shixiaowei02
Shixiaowei02 merged commit 864240b into NVIDIA:main Jun 4, 2026
16 of 21 checks passed
@Shixiaowei02
Shixiaowei02 deleted the user/xiaoweis/pin-nixl-cu13_2 branch June 4, 2026 06:15
yufeiwu-nv pushed a commit to yufeiwu-nv/TensorRT-LLM that referenced this pull request Jun 4, 2026
…est_run_with_different_env (NVIDIA#14939)

Signed-off-by: Shixiaowei02 <39303645+Shixiaowei02@users.noreply.github.com>
yufeiwu-nv pushed a commit to yufeiwu-nv/TensorRT-LLM that referenced this pull request Jun 4, 2026
…est_run_with_different_env (NVIDIA#14939)

Signed-off-by: Shixiaowei02 <39303645+Shixiaowei02@users.noreply.github.com>
Signed-off-by: yufeiwu-nv <230315618+yufeiwu-nv@users.noreply.github.com>
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