Skip to content

Commit 67a63ac

Browse files
authored
Disable specific test due to bug in trt-rtx (#4571)
1 parent 1edd7ac commit 67a63ac

1 file changed

Lines changed: 28 additions & 1 deletion

File tree

tests/py/dynamo/conversion/test_cumsum_aten.py

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import unittest
2+
13
import torch
24
import torch.nn as nn
35
import torch_tensorrt
@@ -75,7 +77,6 @@ def forward(self, x):
7577
((2, 3), (2, 4), (2, 5), 0),
7678
((2, 3), (3, 4), (4, 5), -1),
7779
((1, 2, 2), (2, 2, 3), (3, 3, 3), 0),
78-
((1, 2, 2), (2, 2, 3), (3, 2, 3), -2),
7980
((1, 2, 2, 3), (2, 2, 3, 4), (3, 3, 4, 5), -3),
8081
((1, 2, 2, 3), (2, 2, 3, 4), (3, 3, 4, 5), -2),
8182
]
@@ -98,6 +99,32 @@ def forward(self, x):
9899
immutable_weights=False,
99100
)
100101

102+
@unittest.skipIf(
103+
torch_tensorrt.ENABLED_FEATURES.tensorrt_rtx,
104+
"TRT RTX (CPU-only AoT build) cannot run ConstantBuilder, which TRT requires for loops whose trip count is a compile-time constant; occurs here because dim 1 has the same size across all profiles",
105+
)
106+
def test_cumsum_dynamic_shape_static_dim(self):
107+
# min=(1,2,2), opt=(2,2,3), max=(3,2,3), dim=-2=1
108+
# dim 1 is size 2 in all profiles, so TRT uses a constant trip limit
109+
min_shape, opt_shape, max_shape, dims = (1, 2, 2), (2, 2, 3), (3, 2, 3), -2
110+
111+
class Cumsum(nn.Module):
112+
def forward(self, x):
113+
return torch.ops.aten.cumsum.default(x, dims)
114+
115+
inputs = [
116+
torch_tensorrt.Input(
117+
min_shape=min_shape,
118+
opt_shape=opt_shape,
119+
max_shape=max_shape,
120+
),
121+
]
122+
self.run_test_with_dynamic_shape(
123+
Cumsum(),
124+
inputs,
125+
immutable_weights=False,
126+
)
127+
101128

102129
if __name__ == "__main__":
103130
run_tests()

0 commit comments

Comments
 (0)