Skip to content

Commit 475fa53

Browse files
wconstabfacebook-github-bot
authored andcommitted
Test functional_collectives import (#318)
Summary: Avoid breakages when FC can't import under multipy. Pull Request resolved: #318 Reviewed By: PaliC Differential Revision: D45540107 Pulled By: wconstab fbshipit-source-id: 9a24bdbfad64f8b3635840a8195fb573e3dfb283
1 parent f98034c commit 475fa53

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

multipy/runtime/test_compat.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ def fn(x, y):
5959
c_fn = torch.compile(fn)
6060
c_fn(torch.randn(10), torch.randn(10))
6161

62+
def test_functional_collectives(self):
63+
with self.assertWarns(Warning):
64+
# Functional collectives don't work with torchdeploy
65+
# but we want to make sure the import doesn't totally crash
66+
import torch.distributed._functional_collectives
67+
6268

6369
if __name__ == "__main__":
6470
unittest.main()

0 commit comments

Comments
 (0)