Optest is unable to xfail on parametrized tests #112251
Labels
module: opcheck
Related to opcheck testing for custom operators
triaged
This issue has been looked at a team member, and triaged and prioritized into an appropriate module
It is currently not possible to
xfail
on a parametrized test that is marked e.g. asin the
failures_dict
. (I thought #111797 was a fix, but it's not enough)From what I can tell, the problem is that here
pytorch/torch/testing/_internal/optests/generate_tests.py
Lines 748 to 753 in cf5479b
test_name
isn't found indct
(i.e. in the failures_dict) because test_name looks likeTestPSRoIAlign.test_faketensor__test_forward
, i.e. it's missing the[x_dtype0-True-mps]
part. That's because this name is generated all the way up inpytorch/torch/testing/_internal/optests/generate_tests.py
Lines 252 to 254 in cf5479b
where
attr
istest_forward
, but of course it's missing any parametrization info because this is only looking at the "static" test class object.I'm not sure how to fix this without a significant rework of the whole opcheck logic, but perhaps @zou3519 has an idea?
Unfortunately, for now we cannot really use optests on the torchvision test suite. Note that we can't just put
TestPSRoIAlign.test_faketensor__test_forward
without the[...]
part in thefailure_dict
, because that test actually passes on cpu and cuda, which would lead to an "unexpected success".cc @zou3519
The text was updated successfully, but these errors were encountered: