Skip to content

Commit 7a08030

Browse files
Shirong Wufacebook-github-bot
authored andcommitted
Fix fx2trt CI test trigger condition (pytorch#71014)
Summary: Pull Request resolved: pytorch#71014 Replace test trigger with test_config matching. Test Plan: CI https://github.com/pytorch/pytorch/runs/4746717568?check_suite_focus=true Reviewed By: janeyx99 Differential Revision: D33480971 fbshipit-source-id: 9513e464753343a7ae47fcfaf48119f34bae94c5
1 parent 80659b7 commit 7a08030

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+236
-21
lines changed

.jenkins/pytorch/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ elif [[ "${BUILD_ENVIRONMENT}" == *distributed* || "${JOB_BASE_NAME}" == *distri
568568
test_rpc
569569
elif [[ "${TEST_CONFIG}" = docs_test ]]; then
570570
test_docs_test
571-
elif [[ "${BUILD_ENVIRONMENT}" == *linux-xenial-cuda11.3-py3.6-gcc7* ]]; then
571+
elif [[ "${TEST_CONFIG}" == fx2trt ]]; then
572572
test_torch_fx2trt
573573
else
574574
install_torchvision

test/fx2trt/converters/acc_op/test_adaptive_avgpool.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import torch.fx.experimental.fx_acc.acc_ops as acc_ops
55
from parameterized import parameterized
66
from torch.testing._internal.common_fx2trt import AccTestCase, InputTensorSpec
7+
from torch.testing._internal.common_utils import run_tests
78

89

910
class TestAdaptiveAvgPoolConverter(AccTestCase):
@@ -48,3 +49,6 @@ def forward(self, x):
4849
self.run_test_with_dynamic_shape(
4950
TestModule(), input_specs, expected_ops={acc_ops.adaptive_avg_pool2d}
5051
)
52+
53+
if __name__ == '__main__':
54+
run_tests()

test/fx2trt/converters/acc_op/test_avgpool.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import torch.fx.experimental.fx_acc.acc_ops as acc_ops
55
from parameterized import parameterized, param
66
from torch.testing._internal.common_fx2trt import AccTestCase
7+
from torch.testing._internal.common_utils import run_tests
78

89

910
class TestAvgPoolConverter(AccTestCase):
@@ -45,3 +46,6 @@ def forward(self, x):
4546

4647
inputs = [torch.randn(1, 3, 224, 224)]
4748
self.run_test(TestModule(), inputs, expected_ops={acc_ops.avg_pool2d})
49+
50+
if __name__ == '__main__':
51+
run_tests()

test/fx2trt/converters/acc_op/test_batchnorm.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import torch
44
import torch.fx.experimental.fx_acc.acc_ops as acc_ops
55
from torch.testing._internal.common_fx2trt import AccTestCase, InputTensorSpec
6+
from torch.testing._internal.common_utils import run_tests
67

78

89
class TestBatchNormConverter(AccTestCase):
@@ -38,3 +39,6 @@ def forward(self, x):
3839
self.run_test_with_dynamic_shape(
3940
TestModule(), input_specs, expected_ops={acc_ops.batch_norm}
4041
)
42+
43+
if __name__ == '__main__':
44+
run_tests()

test/fx2trt/converters/acc_op/test_binary_ops.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import torch.nn as nn
88
from torch.testing._internal.common_fx2trt import AccTestCase, InputTensorSpec
99
from parameterized import parameterized
10+
from torch.testing._internal.common_utils import run_tests
1011

1112
elementwise_ops = [
1213
((lambda x, y: x + y), acc_ops.add),
@@ -101,3 +102,6 @@ def forward(self, x, y):
101102
]
102103

103104
self.run_test_with_dynamic_shape(Op(), input_specs, expected_ops={expected_op})
105+
106+
if __name__ == '__main__':
107+
run_tests()

test/fx2trt/converters/acc_op/test_cat.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import torch.fx.experimental.fx_acc.acc_ops as acc_ops
55
import torch.nn as nn
66
from torch.testing._internal.common_fx2trt import AccTestCase, InputTensorSpec
7+
from torch.testing._internal.common_utils import run_tests
78

89

910
class TestCatConverter(AccTestCase):
@@ -34,3 +35,6 @@ def forward(self, x, y):
3435
),
3536
]
3637
self.run_test_with_dynamic_shape(Cat(), input_specs, expected_ops={acc_ops.cat})
38+
39+
if __name__ == '__main__':
40+
run_tests()

test/fx2trt/converters/acc_op/test_chunk.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import torch.nn as nn
44
from parameterized import parameterized
55
from torch.testing._internal.common_fx2trt import AccTestCase
6+
from torch.testing._internal.common_utils import run_tests
67

78

89
class TestChunkConverter(AccTestCase):
@@ -24,3 +25,6 @@ def forward(self, x):
2425
inputs,
2526
expected_ops={acc_ops.chunk},
2627
)
28+
29+
if __name__ == '__main__':
30+
run_tests()

test/fx2trt/converters/acc_op/test_clamp.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import torch.fx.experimental.fx_acc.acc_ops as acc_ops
55
from torch.testing._internal.common_fx2trt import AccTestCase
66
from parameterized import parameterized, param
7+
from torch.testing._internal.common_utils import run_tests
78

89

910
class TestClampConverter(AccTestCase):
@@ -27,3 +28,6 @@ def forward(self, x):
2728

2829
inputs = [torch.randn(3, 4)]
2930
self.run_test(TestModule(), inputs, expected_ops={acc_ops.clamp})
31+
32+
if __name__ == '__main__':
33+
run_tests()

test/fx2trt/converters/acc_op/test_convolution.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import torch.fx.experimental.fx_acc.acc_ops as acc_ops
55
from torch.testing._internal.common_fx2trt import AccTestCase, InputTensorSpec
66
from parameterized import parameterized, param
7+
from torch.testing._internal.common_utils import run_tests
78

89

910
class TestConvolutionConverter(AccTestCase):
@@ -59,3 +60,6 @@ def forward(self, x):
5960
self.run_test_with_dynamic_shape(
6061
TestModule(), input_specs, expected_ops={acc_ops.conv2d}
6162
)
63+
64+
if __name__ == '__main__':
65+
run_tests()

test/fx2trt/converters/acc_op/test_dequantize.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import torch.fx.experimental.fx_acc.acc_ops as acc_ops
88
import torch.nn as nn
99
from torch.testing._internal.common_fx2trt import AccTestCase, InputTensorSpec
10+
from torch.testing._internal.common_utils import run_tests
1011

1112

1213
@unittest.skip(
@@ -44,3 +45,6 @@ def forward(self, x):
4445
self.run_test_with_dynamic_shape(
4546
TestModule(), input_specs, expected_ops={acc_ops.dequantize}
4647
)
48+
49+
if __name__ == '__main__':
50+
run_tests()

test/fx2trt/converters/acc_op/test_elu.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import torch.fx.experimental.fx_acc.acc_ops as acc_ops
55
import torch.nn as nn
66
from torch.testing._internal.common_fx2trt import AccTestCase, InputTensorSpec
7+
from torch.testing._internal.common_utils import run_tests
78

89

910
class TestELUConverter(AccTestCase):
@@ -30,3 +31,6 @@ def forward(self, x):
3031
self.run_test_with_dynamic_shape(
3132
TestModule(), input_specs, expected_ops={acc_ops.elu}
3233
)
34+
35+
if __name__ == '__main__':
36+
run_tests()

test/fx2trt/converters/acc_op/test_flatten.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import torch.nn as nn
66
from torch.testing._internal.common_fx2trt import AccTestCase, InputTensorSpec
77
from parameterized import parameterized
8+
from torch.testing._internal.common_utils import run_tests
89

910

1011
class TestFlattenConverter(AccTestCase):
@@ -65,3 +66,6 @@ def forward(self, x):
6566
input_specs,
6667
expected_ops={acc_ops.flatten},
6768
)
69+
70+
if __name__ == '__main__':
71+
run_tests()

test/fx2trt/converters/acc_op/test_gelu.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import torch.fx.experimental.fx_acc.acc_ops as acc_ops
33
import torch.nn as nn
44
from torch.testing._internal.common_fx2trt import AccTestCase, InputTensorSpec
5+
from torch.testing._internal.common_utils import run_tests
56

67

78
class TestGELU(AccTestCase):
@@ -33,3 +34,6 @@ def forward(self, x):
3334
self.run_test_with_dynamic_shape(
3435
TestModule(), input_specs, expected_ops={acc_ops.gelu}
3536
)
37+
38+
if __name__ == '__main__':
39+
run_tests()

test/fx2trt/converters/acc_op/test_getitem.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import torch.nn as nn
66
from torch.testing._internal.common_fx2trt import AccTestCase
77
from parameterized import parameterized
8+
from torch.testing._internal.common_utils import run_tests
89

910

1011
class TestGetitemConverter(AccTestCase):
@@ -52,3 +53,6 @@ def forward(self, x):
5253

5354
inputs = [torch.randn(2, 10, 10, 10)]
5455
self.run_test(Getitem(idx), inputs, expected_ops={acc_ops.getitem})
56+
57+
if __name__ == '__main__':
58+
run_tests()

test/fx2trt/converters/acc_op/test_hardtanh.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import torch.fx.experimental.fx_acc.acc_ops as acc_ops
55
import torch.nn as nn
66
from torch.testing._internal.common_fx2trt import AccTestCase
7+
from torch.testing._internal.common_utils import run_tests
78

89

910
class TestHardtanhConverter(AccTestCase):
@@ -14,3 +15,6 @@ def forward(self, x):
1415

1516
inputs = [torch.randn(2, 10, 10, 10)]
1617
self.run_test(Hardtanh(), inputs, expected_ops={acc_ops.hardtanh})
18+
19+
if __name__ == '__main__':
20+
run_tests()

test/fx2trt/converters/acc_op/test_layernorm.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import torch.nn as nn
66
from torch.testing._internal.common_fx2trt import AccTestCase, InputTensorSpec
77
from parameterized import parameterized, param
8+
from torch.testing._internal.common_utils import run_tests
89

910

1011
class TestLayerNormConverter(AccTestCase):
@@ -59,3 +60,6 @@ def forward(self, x):
5960
self.run_test_with_dynamic_shape(
6061
LayerNorm(normalized_shape), input_specs, expected_ops={acc_ops.layer_norm}
6162
)
63+
64+
if __name__ == '__main__':
65+
run_tests()

test/fx2trt/converters/acc_op/test_leaky_relu.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import torch.fx.experimental.fx_acc.acc_ops as acc_ops
55
import torch.nn as nn
66
from torch.testing._internal.common_fx2trt import AccTestCase, InputTensorSpec
7+
from torch.testing._internal.common_utils import run_tests
78

89

910
class TestLeakyReLUConverter(AccTestCase):
@@ -30,3 +31,6 @@ def forward(self, x):
3031
self.run_test_with_dynamic_shape(
3132
TestModule(), input_specs, expected_ops={acc_ops.leaky_relu}
3233
)
34+
35+
if __name__ == '__main__':
36+
run_tests()

test/fx2trt/converters/acc_op/test_linear.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import torch.fx.experimental.fx_acc.acc_ops as acc_ops
55
from torch.testing._internal.common_fx2trt import AccTestCase, InputTensorSpec
66
from parameterized import parameterized
7+
from torch.testing._internal.common_utils import run_tests
78

89

910
class TestLinearConverter(AccTestCase):
@@ -50,3 +51,6 @@ def forward(self, x):
5051
input_specs,
5152
expected_ops={acc_ops.linear},
5253
)
54+
55+
if __name__ == '__main__':
56+
run_tests()

test/fx2trt/converters/acc_op/test_matmul.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import torch.nn as nn
66
from torch.testing._internal.common_fx2trt import AccTestCase
77
from parameterized import parameterized
8+
from torch.testing._internal.common_utils import run_tests
89

910

1011
class TestMatMulConverter(AccTestCase):
@@ -85,3 +86,6 @@ def forward(self, input, other):
8586
expected_ops={acc_ops.matmul},
8687
test_implicit_batch_dim=test_implicit_batch_dim,
8788
)
89+
90+
if __name__ == '__main__':
91+
run_tests()

test/fx2trt/converters/acc_op/test_max.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import torch.fx.experimental.fx_acc.acc_ops as acc_ops
55
from torch.testing._internal.common_fx2trt import AccTestCase
66
from parameterized import parameterized
7+
from torch.testing._internal.common_utils import run_tests
78

89

910
class TestMaxConverter(AccTestCase):
@@ -77,3 +78,6 @@ def forward(self, input, other):
7778

7879
inputs = [torch.randn(3, 4), torch.randn(3, 4)]
7980
self.run_test(MaxMethod(), inputs, expected_ops={acc_ops.maximum})
81+
82+
if __name__ == '__main__':
83+
run_tests()

test/fx2trt/converters/acc_op/test_maximum.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import torch
44
import torch.fx.experimental.fx_acc.acc_ops as acc_ops
55
from torch.testing._internal.common_fx2trt import AccTestCase
6+
from torch.testing._internal.common_utils import run_tests
67

78

89
class TestMaximumConverter(AccTestCase):
@@ -29,3 +30,6 @@ def forward(self, x, y):
2930
torch.randn(3, 4),
3031
]
3132
self.run_test(Maximum(), inputs, expected_ops={acc_ops.maximum})
33+
34+
if __name__ == '__main__':
35+
run_tests()

test/fx2trt/converters/acc_op/test_maxpool.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import torch.fx.experimental.fx_acc.acc_ops as acc_ops
55
from torch.testing._internal.common_fx2trt import AccTestCase, InputTensorSpec
66
from parameterized import parameterized, param
7+
from torch.testing._internal.common_utils import run_tests
78

89

910
class TestMaxPoolConverter(AccTestCase):
@@ -58,3 +59,6 @@ def forward(self, x):
5859
self.run_test_with_dynamic_shape(
5960
TestModule(), input_specs, expected_ops={acc_ops.max_pool2d}
6061
)
62+
63+
if __name__ == '__main__':
64+
run_tests()

test/fx2trt/converters/acc_op/test_min.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import torch.fx.experimental.fx_acc.acc_ops as acc_ops
55
from torch.testing._internal.common_fx2trt import AccTestCase
66
from parameterized import parameterized
7+
from torch.testing._internal.common_utils import run_tests
78

89

910
class TestMinConverter(AccTestCase):
@@ -77,3 +78,6 @@ def forward(self, input, other):
7778

7879
inputs = [torch.randn(3, 4), torch.randn(3, 4)]
7980
self.run_test(MinMethod(), inputs, expected_ops={acc_ops.minimum})
81+
82+
if __name__ == '__main__':
83+
run_tests()

test/fx2trt/converters/acc_op/test_minimum.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import torch
44
import torch.fx.experimental.fx_acc.acc_ops as acc_ops
55
from torch.testing._internal.common_fx2trt import AccTestCase
6+
from torch.testing._internal.common_utils import run_tests
67

78

89
class TestMinimumConverter(AccTestCase):
@@ -29,3 +30,6 @@ def forward(self, x, y):
2930
torch.randn(3, 4),
3031
]
3132
self.run_test(Minimum(), inputs, expected_ops={acc_ops.minimum})
33+
34+
if __name__ == '__main__':
35+
run_tests()

test/fx2trt/converters/acc_op/test_narrow.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import torch.nn as nn
66
from torch.testing._internal.common_fx2trt import AccTestCase
77
from parameterized import parameterized
8+
from torch.testing._internal.common_utils import run_tests
89

910

1011
class TestNarrowConverter(AccTestCase):
@@ -26,3 +27,6 @@ def forward(self, x):
2627
expected_ops={acc_ops.slice_tensor},
2728
test_explicit_batch_dim=False,
2829
)
30+
31+
if __name__ == '__main__':
32+
run_tests()

test/fx2trt/converters/acc_op/test_pad.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from parameterized import param, parameterized
88
import unittest
99
import tensorrt as trt
10+
from torch.testing._internal.common_utils import run_tests
1011

1112

1213
class TestPadConverter(AccTestCase):
@@ -67,3 +68,6 @@ def forward(self, x):
6768
inputs,
6869
expected_ops={acc_ops.pad},
6970
)
71+
72+
if __name__ == '__main__':
73+
run_tests()

test/fx2trt/converters/acc_op/test_permute.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import torch.nn as nn
66
from torch.testing._internal.common_fx2trt import AccTestCase, InputTensorSpec
77
from parameterized import parameterized
8+
from torch.testing._internal.common_utils import run_tests
89

910

1011
class TestPermuteConverter(AccTestCase):
@@ -51,3 +52,6 @@ def forward(self, x):
5152
self.run_test_with_dynamic_shape(
5253
Permute(), input_specs, expected_ops={acc_ops.permute}
5354
)
55+
56+
if __name__ == '__main__':
57+
run_tests()

0 commit comments

Comments
 (0)