Skip to content

Commit

Permalink
Check invariants for dynamo_test_failures.py (pytorch#117391)
Browse files Browse the repository at this point in the history
Test that:
- the xfail list and the skip list don't intersect
- the test names look sane
Pull Request resolved: pytorch#117391
Approved by: https://github.com/voznesenskym
  • Loading branch information
zou3519 authored and pytorchmergebot committed Jan 16, 2024
1 parent 29516bd commit a7a2773
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions torch/testing/_internal/dynamo_test_failures.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,8 +637,6 @@
"TestFlag.test_writeable_from_readonly",
"TestArgmaxArgminCommon.test_np_vs_ndarray_positional_arr_method_argmax_np_method0",
"TestArgmaxArgminCommon.test_ret_is_out_ndim_1_method_argmin",
"TestArgmaxArgminCommon.test_np_vs_ndarray_arr_method_argmax_np_method0",
"TestArgmaxArgminCommon.test_np_vs_ndarray_arr_method_argmin_np_method1",
"TestArgmaxArgminCommon.test_ret_is_out_ndim_0_method_argmax",
"TestArgmaxArgminCommon.test_np_vs_ndarray_positional_arr_method_argmin_np_method1",
"TestArgmaxArgminCommon.test_ret_is_out_ndim_1_method_argmax",
Expand Down Expand Up @@ -2119,7 +2117,6 @@
"TestMkldnnCPU.test_tanh_cpu", # test_mkldnn
"TestMkldnnCPU.test_conv2d_cpu", # test_mkldnn
"TestMkldnnCPU.test_batch_norm_3d_cpu", # test_mkldnn
"TestFunctionalAutogradBenchmark.test_fast_tasks", # test_functional_autograd_benchmark
"TestFunctionSchema.test_serialize_and_deserialize", # test_function_schema
"FakeTensorOperatorInvariants.test_like_ops", # test_fake_tensor
"FakeTensorConverterTest.test_memoized_conversion_from_meta", # test_fake_tensor
Expand Down Expand Up @@ -2865,10 +2862,6 @@
"TestMethods.test_compress",
"TestArgmaxArgminCommon.test_np_vs_ndarray_arr_method_argmax_np_method0",
"TestArgmaxArgminCommon.test_np_vs_ndarray_arr_method_argmin_np_method1",
"TestArgmaxArgminCommon.test_ret_is_out_ndim_0_method_argmin",
"TestArgmaxArgminCommon.test_ret_is_out_ndim_0_method_argmax",
"TestArgmaxArgminCommon.test_ret_is_out_ndim_1_method_argmax",
"TestArgmaxArgminCommon.test_ret_is_out_ndim_1_method_argmin",
"TestIsreal.test_fail", # known py311 fail
"TestIscomplexobj.test_basic", # known py311 fail
"TestIsrealobj.test_basic", # known py311 fail
Expand Down Expand Up @@ -3246,9 +3239,9 @@
"ExportTests.test_predispatch_with_for_out_dtype", # weird
"ExportTests.test_predispatch_with_for_out_dtype_nested", # weird
"MiscTests.test_auto_functionalize_on_view", # weird
"MiscTests::test_auto_functionalize_optional", # weird
"MiscTests::test_auto_functionalize_with_returns", # weird
"MiscTests::test_generate_trivial_abstract_impl", # weird
"MiscTests.test_auto_functionalize_optional", # weird
"MiscTests.::test_auto_functionalize_with_returns", # weird
"MiscTests.test_generate_trivial_abstract_impl", # weird
"RecompileUxTests.test_drop_cache_on_skip", # weird
"ReproTests.test_optim_state_references_cleared", # weird
"ReproTests.test_reformer_train", # weird
Expand Down Expand Up @@ -7252,3 +7245,16 @@
"TestForeachCPU.test_add_scalar_with_empty_list_and_empty_tensor_cpu_int8", # known py38 fail
"TestForeachCPU.test_add_scalar_with_empty_list_and_empty_tensor_cpu_uint8", # known py38 fail
}


# verify some invariants
for test in dynamo_expected_failures.union(dynamo_skips):
if len(test.split(".")) != 2:
raise AssertionError(f'Invalid test name: "{test}"')

intersection = dynamo_expected_failures.intersection(dynamo_skips)
if len(intersection) > 0:
raise AssertionError(
"there should be no overlap between dynamo_expected_failures "
"and dynamo_skips, got " + str(intersection)
)

0 comments on commit a7a2773

Please sign in to comment.