Skip to content

[None][test] Run thop custom-op schema checks in the CPU pre-merge stage - #17322

Merged
brnguyen2 merged 2 commits into
NVIDIA:mainfrom
brnguyen2:test/register-fake-cpu-stage
Aug 6, 2026
Merged

[None][test] Run thop custom-op schema checks in the CPU pre-merge stage#17322
brnguyen2 merged 2 commits into
NVIDIA:mainfrom
brnguyen2:test/register-fake-cpu-stage

Conversation

@brnguyen2

@brnguyen2 brnguyen2 commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Description

tests/unittest/_torch/thop/parallel_hw_agnostic/test_custom_ops.py (custom-op schema checks, including test_register_fake) is fully GPU-free: it only imports tensorrt_llm and walks the torch schema registry. Today it runs only through the H100 test list, so a missing fake/meta implementation for a new C++ custom op is caught late and only on Hopper stages (this happened with a recently added op, where every non-H100 stage stayed green).

This PR marks the module cpu_only and adds it to l0_cpu.yml, so the check runs in the CPU-Generic pre-merge stages on every pipeline, independent of GPU pool availability. The l0_h100.yml directory entry is unchanged: GPU stages deselect the file via -m "not cpu_only", and the CPU-stage collection hook picks it up via the module marker, following the existing CPU-only test migration pattern (#17290).

Test Coverage

  • unittest/_torch/thop/parallel_hw_agnostic/test_custom_ops.py now collected by the CPU-Generic stages (-m cpu_only); sibling GPU-dependent files in the directory remain H100-only.

PR Checklist

  • PR title and description conventions followed
  • Test coverage: this PR is itself a test-coverage change

Dev Engineer Review

  • Added tests/unittest/_torch/thop/parallel_hw_agnostic/test_custom_ops.py to tests/integration/test_lists/test-db/l0_cpu.yml.
  • Marked the test module with pytest.mark.cpu_only.
  • The test-list entry uses the expected format and limits execution to CPU stages.
  • No code regressions or API changes identified.

Verdict: sufficient.

QA Engineer Review

  • Modified test module: tests/unittest/_torch/thop/parallel_hw_agnostic/test_custom_ops.py.
  • No test functions were added, modified, or removed.
  • The existing custom-op validation tests are covered by tests/integration/test_lists/test-db/l0_cpu.yml.
  • CPU-Generic x86 and ARM CI completed successfully.

Verdict: sufficient.

tests/unittest/_torch/thop/parallel_hw_agnostic/test_custom_ops.py only
imports tensorrt_llm and walks the torch schema registry to validate
custom-op schemas and fake-impl registration; it does not need a GPU.
Mark it cpu_only and add it to l0_cpu.yml so it runs in the CPU-Generic
pre-merge stage on every pipeline. The existing
unittest/_torch/thop/parallel_hw_agnostic directory entry in l0_h100.yml
is unchanged; the cpu_only marker deselects this file there since GPU
stages run with -m "not cpu_only".

Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>
@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run --stage-list "CPU-Generic-x86-1, CPU-Generic-arm-1"

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #64128 [ run ] triggered by Bot. Commit: 620a967 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #64128 [ run ] completed with state SUCCESS. Commit: 620a967
/LLM/main/L0_MergeRequest_PR pipeline #52050 (Partly Tested) completed with status: 'SUCCESS'

CI Report

Link to invocation

@brnguyen2
brnguyen2 marked this pull request as ready for review August 6, 2026 00:40
@brnguyen2
brnguyen2 requested review from a team as code owners August 6, 2026 00:40
@coderabbitai

coderabbitai Bot commented Aug 6, 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: 26f8b8a5-b620-4e2b-89e3-9e0474461285

📥 Commits

Reviewing files that changed from the base of the PR and between 620a967 and 0a78721.

📒 Files selected for processing (1)
  • tests/unittest/_torch/thop/parallel_hw_agnostic/test_custom_ops.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/unittest/_torch/thop/parallel_hw_agnostic/test_custom_ops.py

Walkthrough

The custom operations test is marked for CPU-only execution and added to the l0_cpu pre-merge test suite.

Changes

CPU test integration

Layer / File(s) Summary
Mark and register the CPU test
tests/unittest/_torch/thop/parallel_hw_agnostic/test_custom_ops.py, tests/integration/test_lists/test-db/l0_cpu.yml
The test module uses the cpu_only pytest marker. The test path is included in the l0_cpu test list.

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

Possibly related PRs

Suggested reviewers: qijune, stanleysun639

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the test change and its move to CPU pre-merge coverage.
Description check ✅ Passed The description explains the problem, solution, test coverage, and relevant checklist items with sufficient detail.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.

@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 `@tests/unittest/_torch/thop/parallel_hw_agnostic/test_custom_ops.py`:
- Around line 7-8: Add the standard NVIDIA copyright header at the top of
test_custom_ops.py, using 2026 as the latest meaningful modification year and
preserving the existing pytestmark declaration.
🪄 Autofix

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: 0b03b2ff-159e-4ab1-a044-2602088d3866

📥 Commits

Reviewing files that changed from the base of the PR and between a23e8de and 620a967.

📒 Files selected for processing (2)
  • tests/integration/test_lists/test-db/l0_cpu.yml
  • tests/unittest/_torch/thop/parallel_hw_agnostic/test_custom_ops.py

Comment thread tests/unittest/_torch/thop/parallel_hw_agnostic/test_custom_ops.py
Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>
@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run --stage-list "CPU-Generic-x86-1, CPU-Generic-arm-1"

@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run --stage-list "CPU-Generic-x86-1,CPU-Generic-arm-1"

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #64220 [ run ] triggered by Bot. Commit: 0a78721 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #64220 [ run ] completed with state SUCCESS. Commit: 0a78721
/LLM/main/L0_MergeRequest_PR pipeline #52127 (Partly Tested) completed with status: 'SUCCESS'

CI Report

Link to invocation

@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot skip --comment "Two-file test-infra change: marks the hw-agnostic custom-op schema test module cpu_only and lists it in l0_cpu.yml. The stages that newly run it (CPU-Generic-x86-1, CPU-Generic-arm-1) passed on this exact head in pipeline 52127; the only effect on GPU stages is standard -m 'not cpu_only' deselection of one module, the same mechanism used by all existing cpu_only tests (pattern of #17290). No production code changed."

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #64335 [ skip ] triggered by Bot. Commit: 0a78721 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #64335 [ skip ] completed with state SUCCESS. Commit: 0a78721
Skipping testing for commit 0a78721

Link to invocation

@brnguyen2
brnguyen2 merged commit 8e588da into NVIDIA:main Aug 6, 2026
10 checks passed
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.

4 participants