Skip to content

fix(tests): correct TensorRT-RTX deconv version gate and guard plugin-backed converter tests - #4467

Open
tp5uiuc wants to merge 2 commits into
pytorch:mainfrom
tp5uiuc:fix/rtx-converter-gtest-guards
Open

fix(tests): correct TensorRT-RTX deconv version gate and guard plugin-backed converter tests#4467
tp5uiuc wants to merge 2 commits into
pytorch:mainfrom
tp5uiuc:fix/rtx-converter-gtest-guards

Conversation

@tp5uiuc

@tp5uiuc tp5uiuc commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Description

Fixes 4 failing converter test targets on TensorRT-RTX builds. Two independent causes.

1. conv_deconv.cpp takes the pre-TensorRT-7.1 fallback on RTX. TensorRT-RTX defines NV_TENSORRT_MAJOR as TRT_MAJOR_RTX (== 1), so the version check guarding setDilationNd() / setNbGroups() is false on every RTX build. Deconvolutions with groups > 1 or dilation > 1 are then rejected citing TensorRT 7.1, although RTX supports both. Adds the defined(TRT_MAJOR_RTX) escape already used for this in ConversionCtx.cpp and quantization.cpp.

Reached only by the TorchScript frontend — the dynamo converter gates strided and dilated deconv on RTX, not groups.

2. Plugin-backed converters have no RTX implementation. Adaptive pooling, aten::norm and aten::instance_norm are built on TensorRT plugins that TensorRT-RTX does not provide, and are already compiled out for RTX. Their gtests therefore fail with Expected converter to be true but got false. Guarded with #ifndef TRT_MAJOR_RTX, which is already visible via tests/util/util.hcore/ir/ir.hNvInfer.h (no new includes or build deps). Non-RTX builds keep full coverage.

  • test_pooling.cpp — 14 adaptive tests guarded; max/avg pooling left enabled
  • test_normalize.cpp — 6 aten::norm tests guarded; frobenius_norm / linalg_norm left enabled
  • test_instance_norm.cpp — all 3 guarded (they share one aten::instance_norm graph)

Verified on TensorRT-RTX 1.6.1.120: //tests/core/conversion:conversion_tests passes 49/49 targets, including ATenConvTransposeWithGroupConvertsCorrectly, which covers cause 1 and is deliberately left unguarded.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the style guidelines of this project (You can use the linters)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas and hacks
  • I have made corresponding changes to the documentation
  • I have added tests to verify my fix or my feature
  • New and existing unit tests pass locally with my changes
  • I have added the relevant labels to my PR in so that relevant reviewers are notified

tp5uiuc added 2 commits August 6, 2026 19:40
TensorRT-RTX defines NV_TENSORRT_MAJOR as TRT_MAJOR_RTX, which is 1. The
version comparison guarding setDilationNd()/setNbGroups() therefore fails
on every RTX build and selects the pre-TensorRT-7.1 fallback, which
rejects any deconvolution with groups > 1 or dilation > 1 and reports
"require TensorRT version >= 7.1".

TensorRT-RTX supports both, so add the TRT_MAJOR_RTX escape already used
for the same purpose in ConversionCtx.cpp and quantization.cpp. This also
means setDilationNd() and setNbGroups() are now actually called on RTX
rather than silently skipped.

Only the TorchScript frontend reaches this code; the dynamo converters
are unaffected and already accept grouped deconvolutions on RTX.
The adaptive pooling, aten::norm and aten::instance_norm converters are
implemented with TensorRT plugins, which TensorRT-RTX does not provide,
so they are already compiled out for RTX builds. The gtests exercising
them cannot pass there and fail conversion with "Expected converter to be
true but got false".

Guard them with #ifndef TRT_MAJOR_RTX, which is visible in these
translation units already via tests/util/util.h -> core/ir/ir.h ->
NvInfer.h, so no new includes or build dependencies are needed. Non-RTX
builds leave TRT_MAJOR_RTX undefined and keep full coverage.

Scope per file:
- test_pooling.cpp: the 14 adaptive pooling tests; the max/avg pooling
  tests above them are unaffected.
- test_normalize.cpp: the three ATEN_INTERPOLATE_TESTS invocations that
  emit aten::norm; the frobenius_norm and linalg_norm tests are left
  enabled since they do not use that converter.
- test_instance_norm.cpp: all three tests, which share one
  aten::instance_norm graph. Two of them additionally carry a
  pre-existing unconditional GTEST_SKIP() unrelated to RTX.
@meta-cla meta-cla Bot added the cla signed label Aug 7, 2026
@github-actions github-actions Bot added component: tests Issues re: Tests component: conversion Issues re: Conversion stage component: core Issues re: The core compiler component: converters Issues re: Specific op converters labels Aug 7, 2026
@tp5uiuc tp5uiuc changed the title fix: correct TensorRT-RTX deconv version gate and guard plugin-backed converter tests fix(tests): correct TensorRT-RTX deconv version gate and guard plugin-backed converter tests Aug 7, 2026
@tp5uiuc tp5uiuc self-assigned this Aug 7, 2026
@tp5uiuc
tp5uiuc requested a review from lanluo-nvidia August 7, 2026 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla signed component: conversion Issues re: Conversion stage component: converters Issues re: Specific op converters component: core Issues re: The core compiler component: tests Issues re: Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant