mirror of
https://github.com/pytorch/pytorch.git
synced 2025-11-11 22:34:53 +08:00
[AOTI] skip Windows XPU crashed UTs. (#165393)
Skip some UTs, which crashed on Windows XPU. Pull Request resolved: https://github.com/pytorch/pytorch/pull/165393 Approved by: https://github.com/jansel
This commit is contained in:
@ -2102,6 +2102,21 @@ def skipIfWindows(func=None, *, msg="test doesn't currently work on the Windows
|
||||
return dec_fn(func)
|
||||
return dec_fn
|
||||
|
||||
def skipIfWindowsXPU(func=None, *, msg="test doesn't currently work on the Windows stack"):
|
||||
def dec_fn(fn):
|
||||
reason = f"skipIfWindowsXPU: {msg}"
|
||||
|
||||
@wraps(fn)
|
||||
def wrapper(*args, **kwargs):
|
||||
if IS_WINDOWS and torch.xpu.is_available(): # noqa: F821
|
||||
raise unittest.SkipTest(reason)
|
||||
else:
|
||||
return fn(*args, **kwargs)
|
||||
return wrapper
|
||||
if func:
|
||||
return dec_fn(func)
|
||||
return dec_fn
|
||||
|
||||
def requires_cuda_p2p_access():
|
||||
cuda_p2p_access_available = (
|
||||
torch.cuda.is_available()
|
||||
|
||||
Reference in New Issue
Block a user