mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Fix MPS interaction with autograd engine
Pull Request resolved: https://github.com/pytorch/pytorch/pull/77644 Approved by: https://github.com/kulinseth, https://github.com/soulitzer, https://github.com/seemethere
This commit is contained in:
committed by
PyTorch MergeBot
parent
f274558018
commit
090eddf1c7
@ -384,7 +384,7 @@ class TestMultiprocessing(TestCase):
|
||||
ctx = mp.get_context('fork')
|
||||
simple_autograd_function()
|
||||
# Autograd only uses thread when GPUs are involved
|
||||
if torch.cuda.is_available():
|
||||
if torch.cuda.is_available() or torch.backends.mps.is_available():
|
||||
with self.assertRaisesRegex(RuntimeError, r'Unable to handle autograd'):
|
||||
with ctx.Pool(3) as pool:
|
||||
pool.map(simple_autograd_function, [1, 2, 3])
|
||||
|
Reference in New Issue
Block a user