Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion core/conversion/converters/impl/conv_deconv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,9 @@ bool add_conv_deconv(ConversionCtx* ctx, const torch::jit::Node* n, args& args)
deconv->setStrideNd(stride);
deconv->setPrePadding(begPadding);
deconv->setPostPadding(padding);
#if NV_TENSORRT_MAJOR > 7 || (NV_TENSORRT_MAJOR == 7 && NV_TENSORRT_MINOR >= 1)
// TensorRT-RTX reports NV_TENSORRT_MAJOR == 1, so the plain version comparison below would
// select the pre-7.1 fallback and reject grouped or dilated deconvolutions that RTX supports.
#if defined(TRT_MAJOR_RTX) || NV_TENSORRT_MAJOR > 7 || (NV_TENSORRT_MAJOR == 7 && NV_TENSORRT_MINOR >= 1)
deconv->setDilationNd(dilation);
deconv->setNbGroups(groups);
#else
Expand Down
9 changes: 9 additions & 0 deletions tests/core/conversion/converters/test_instance_norm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ constexpr auto graph = R"IR(
return (%4)
)IR";

// The aten::instance_norm converter is implemented with a TensorRT plugin, which TensorRT-RTX
// does not provide, so aten::instance_norm is left unregistered for RTX builds (see
// core/conversion/converters/impl/batch_norm.cpp). All three tests below share the same
// aten::instance_norm graph, so all three are guarded -- the first two additionally carry an
// unconditional GTEST_SKIP() that is unrelated to RTX.
#ifndef TRT_MAJOR_RTX

TEST(Converters, ATenInstanceNormConvertsCorrectly) {
GTEST_SKIP();
auto g = std::make_shared<torch::jit::Graph>();
Expand Down Expand Up @@ -103,3 +110,5 @@ TEST(Converters, ATenInstanceNormRunningStatsConvertsCorrectly) {
auto trt_results = torch_tensorrt::tests::util::RunGraphEngine(g, params, {trt_in});
ASSERT_TRUE(torch_tensorrt::tests::util::almostEqual(jit_results[0], trt_results[0].reshape_as(jit_results[0])));
}

#endif // TRT_MAJOR_RTX
6 changes: 6 additions & 0 deletions tests/core/conversion/converters/test_normalize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@
ASSERT_TRUE(torch_tensorrt::tests::util::almostEqual(jit_results[0], trt)); \
}

// The aten::norm converter is implemented with a TensorRT plugin, which TensorRT-RTX does not
// provide, so it is compiled out for RTX builds (see
// core/conversion/converters/impl/normalize.cpp). The aten::frobenius_norm and
// aten::linalg_norm tests below do not use that converter and are left enabled.
#ifndef TRT_MAJOR_RTX
ATEN_INTERPOLATE_TESTS(
ATenNormOrder1RemoveDims,
R"IR(
Expand Down Expand Up @@ -75,6 +80,7 @@ ATEN_INTERPOLATE_TESTS(
%5 : Tensor = aten::norm(%x.1, %3, %2, %4)
return (%5))IR",
std::vector<int64_t>({3, 4, 3}));
#endif // TRT_MAJOR_RTX

TEST(Converters, ATenFrobeniusNorm) {
const auto graph = R"IR(
Expand Down
8 changes: 8 additions & 0 deletions tests/core/conversion/converters/test_pooling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,12 @@ TEST(Converters, ATenAvgPool3DNoCountPadConvertsCorrectly) {
ASSERT_TRUE(torch_tensorrt::tests::util::almostEqual(jit_results[0], trt_results[0]));
}

// The adaptive pooling converters are implemented with TensorRT plugins, which TensorRT-RTX
// does not provide, so they are compiled out for RTX builds (see
// core/conversion/converters/impl/pooling.cpp). Without this guard every test below fails
// conversion with "Expected converter to be true but got false".
#ifndef TRT_MAJOR_RTX

TEST(Converters, ATenAdaptiveAvgPool2DConvertsCorrectly) {
const auto graph = R"IR(
graph(%0 : Tensor):
Expand Down Expand Up @@ -781,3 +787,5 @@ TEST(Converters, ATenAdaptiveMaxPool3DUsingPluginConvertsCorrectly) {

ASSERT_TRUE(torch_tensorrt::tests::util::almostEqual(jit_results[0], trt_results[0]));
}

#endif // TRT_MAJOR_RTX
Loading