test: skip failing torch-xpu-ops UT cases in P0 scope - #5110
Conversation
Skip 110 UT cases by injecting unittest.skip on the exact generated test methods after instantiation, instead of editing skip_list_common.py. Each skip carries its tracking issue link. Files: test_ops_xpu.py (61), test_unary_ufuncs_xpu.py (31), test_optim_xpu.py (11), distributed/test_c10d_xccl.py (6), test_shape_ops_xpu.py (1).
|
@copilot https://gh.io/copilot-coding-agent-docs https://gh.io/copilot-coding-agent-docs https://gh.io/copilot-coding-agent-docs The Python lint (flake8/ruff) check failed. Please fix the lint errors in this PR. Important: Do NOT update the plan in the PR description directly. Use reply comments to update the status. Lint job log: https://github.com/intel/torch-xpu-ops/actions/runs/32924365796 Instructions: Review the lint failure log via the link above |
Co-authored-by: libohao1201 <30426700+libohao1201@users.noreply.github.com>
Addressed in 2e7c190. I fixed the PYFMT issues reported by run 32924365796 by adding the formatter-required blank lines before the new helper functions and correcting the import order in |
|
Could we skip them here as well, similar to how they are handled in |
Re-ran the 110 P0 skip-scope cases on main (torch 2.15 dev). Remove the skip for the 39 cases that no longer need it: - 33 now pass on main (27 in test_ops_xpu.py + all 6 in test_c10d_xccl.py) - 6 in test_ops_xpu.py are already covered by existing skip_list entries Remaining injected skips: 71 (test_ops_xpu 28, test_unary_ufuncs 31, test_optim 11, test_shape_ops 1). test_c10d_xccl skip block removed. Note: test_python_ref__refs_true_divide_xpu_complex32 passes on main via PR #5083; ensure this branch is rebased onto main before merge.
Summary
Skip 110 failing P0-scope UT cases by injecting
unittest.skipon the exact generated test methods after instantiation — no change toskip_list_common.py.Each skip carries its tracking issue link, so the skip reason points directly at the owning issue.
Approach
For each test file, after
instantiate_device_type_tests(...)(orinstantiate_parametrized_tests(...)for XCCL), a small helper iterates aclass -> {exact_method_name: issue_url}map and appliesunittest.skip(reason)to the matching generated methods. The helper is wrapped in a function so noTestCase-bound loop variable leaks into module globals (which would otherwise cause pytest to re-collect the class).Files changed
test/xpu/test_ops_xpu.pytest/xpu/test_unary_ufuncs_xpu.pytest/xpu/test_optim_xpu.pytest/xpu/distributed/test_c10d_xccl.pytest/xpu/test_shape_ops_xpu.pyValidation
py_compile).pytest --collect-only/ run confirms the targeted methods are collected exactly once and reportedSKIPPEDwith the issue link as reason.