Skip to content

[None][test] Guard lazy engine initialization and GPU-free imports - #21231

Merged
ruodil merged 2 commits into
NVIDIA:mainfrom
ruodil:user/ruodil/test-module-initialization
Nov 2, 2026
Merged

ruodil merged 2 commits into
NVIDIA:mainfrom
ruodil:user/ruodil/test-module-initialization

Conversation

@ruodil

@ruodil ruodil commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Guard deferred DeepGEMM PDL configuration, successful one-time setup, retry after failure, and public imports that leave CUDA contexts uninitialized. Keep the visible-GPU import check in the A10/H100 pre-merge lists.

Split the initialization module coverage out of #21095 so it can be reviewed independently. This PR contains only its tests and any associated CI-list changes.

Test Coverage

  • The preserved module coverage passed in a fresh run of the original PR snapshot: 5 CPU + 1 GPU, zero failures/errors/skips. The complete original snapshot passed 443 CPU + 9 GPU cases on RTX PRO 6000 Blackwell; this is not a runtime result for the rebased PR head.
  • Rebased on current main (b7b797a3aada): Python AST, Ruff lint/format and whitespace checks passed; repository test-list validation passed.
  • Runtime verification of the rebased head is blocked before collection: the locally available compiled TensorRT-LLM library predates current main and lacks trtllm::k3_mnnvl_fusion_allreduce. A matching build or remote CI is still required.
  • The seven split patches were checked for complete coverage of the original 22-file diff and exact recombination after the required upstream API compatibility changes.

PR Checklist

  • Reviewed the applicable repository PR checklist items; the commit includes a DCO sign-off.

Dev Engineer Review

The changes add tests for deferred DeepGEMM PDL setup, retry after setup failure, and imports that do not initialize CUDA contexts. They also add the CUDA-context test to the A10 and H100 pre-merge lists. No source behavior changes are reported. Current review findings and runtime results for the rebased head are unavailable.

QA Engineer Review

The test changes cover PDL configuration, GPU-free imports, and CUDA context state in subprocesses. The CUDA-context test appears in both the A10 and H100 test databases. CI or manual-QA list coverage for the other changed test modules is not established. Coverage verdict: needs follow-up. The author reports static checks passed, but runtime verification of the rebased head remains blocked pending a compatible build or remote CI.

Per-File QA Perspective

  • tests/integration/test_lists/test-db/l0_a10.yml: Adds unittest/others/test_import_cuda_context.py to the A10 pre-merge list.
  • tests/integration/test_lists/test-db/l0_h100.yml: Adds unittest/others/test_import_cuda_context.py to the H100 pre-merge list.
  • tests/unittest/_torch/executor/test_model_engine_initialization.py: Tests initialization state, one-time PDL setup, and retry after configuration failure. List membership is not established by the available evidence.
  • tests/unittest/others/test_import_cuda_context.py: Tests whether imports leave visible-device CUDA contexts inactive. It is listed for A10 and H100.
  • tests/unittest/others/test_import_gpu_free.py: Extends GPU-free import checks to cover deferred PDL configuration. List membership is not established by the available evidence.

Signed-off-by: Ruodi Lu <ruodil@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between cb5434e and 565bd8a.

Files selected for processing: 3
  • tests/integration/test_lists/test-db/l0_a10.yml
  • tests/integration/test_lists/test-db/l0_h100.yml
  • tests/unittest/others/test_import_gpu_free.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 9 remain after this review.

Walkthrough

The changes add tests for DeepGEMM PDL configuration and CUDA context state after imports. The A10 and H100 pre-merge test lists now include the CUDA context test.

Changes

GPU import and initialization checks

Layer / File(s) Summary
Check PDL configuration behavior
tests/unittest/_torch/executor/test_model_engine_initialization.py, tests/unittest/others/test_import_gpu_free.py
CPU-only tests check PDL configuration across model engine initializations, including retry after failure. The GPU-free import test verifies that importing model_engine does not call the PDL setter.
Check CUDA context state after imports
tests/unittest/others/test_import_cuda_context.py, tests/integration/test_lists/test-db/l0_a10.yml, tests/integration/test_lists/test-db/l0_h100.yml
A subprocess test checks CUDA context state after importing tensorrt_llm and LLM. The A10 and H100 pre-merge test lists include this test.

Priority: Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other

Suggested reviewers: litaotju

Merge Risk: Minimal · up to 565bd

The added tests cover deferred PDL setup and GPU-free imports as intended. A matching runtime build or CI run is still needed, but no merge-blocking issue is established.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title follows the repository template with the [None][test] prefix and describes two changes present in the changeset: guarding lazy engine initialization (the DeepGEMM PDL configuration tests and…
Description check Passed The description covers the purpose (splitting initialization-module test coverage out of #21095), the scope (tests and CI-list changes only), and a detailed Test Coverage section that reports local ru…
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.
Full details: Title check

Explanation

The title follows the repository template with the [None][test] prefix and describes two changes present in the changeset: guarding lazy engine initialization (the DeepGEMM PDL configuration tests and retry behavior in model engine initialization) and GPU-free imports (the import tests for CUDA context and tensorrt_llm). It is specific enough for a teammate scanning history, though it does not mention that the PR contains only tests and CI-list changes.

Full details: Description check

Explanation

The description covers the purpose (splitting initialization-module test coverage out of #21095), the scope (tests and CI-list changes only), and a detailed Test Coverage section that reports local runs, rebased checks, and the blocked runtime verification. It has a Description section and a PR Checklist section. It does not include the template's @coderabbitai summary line or the template's own guidance, and it does not state the checklist items individually. The Description section is brief, but the purpose and scope are clear, so the description is mostly complete.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 4 functions across 3 files. (2 skipped: 2 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@ruodil

ruodil commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run

Signed-off-by: Ruodi Lu <200874449+ruodil@users.noreply.github.com>
@ruodil

ruodil commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #81674 [ run ] triggered by Bot. Commit: 565bd8a Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #81674 [ run ] completed with state SUCCESS. Commit: 565bd8a
/LLM/main/L0_MergeRequest_PR pipeline #67338 completed with status: 'SUCCESS'

CI Report

Link to invocation

@JunyiXu-nv JunyiXu-nv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM from the runtime side. For the rebase: main renamed tests/unittest/_torch/executor to pyexecutor (#20669), so test_model_engine_initialization.py needs to move to tests/unittest/_torch/pyexecutor/.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

Automatically added "ci: full pre-merge approved" because this PR has satisfied the required GitHub review approvals. Unresolved review conversations and other required checks remain independent merge requirements.

@ruodil
ruodil merged commit 4b697f1 into NVIDIA:main Nov 2, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants