Skip to content

Commit

Permalink
[fx][split][testing] Add testing for #107981 (#108731)
Browse files Browse the repository at this point in the history
- Follow-up to #107981, adding testing for metadata copying in placeholder nodes within the `split_by_tags` utility
- Validation included in the test from #107248, since both tests are relevant to the same aspect of the utility
Pull Request resolved: #108731
Approved by: https://github.com/angelayi
  • Loading branch information
gs-olive authored and pytorchmergebot committed Dec 18, 2023
1 parent bf20b56 commit e30d436
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/fx/test_fx_split.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ def forward(self, x, y):
self.assertIn("name", n.meta)
self.assertEqual(n.meta["name"], n.name)

# Validate that metadata is copied correctly for graph placeholder nodes
for node in split_gm.graph.nodes:
if node.op == "placeholder":
self.assertIn("name", node.meta)
self.assertEqual(node.meta["name"], node.name)

class TestSplitByTags(TestCase):
class TestModule(torch.nn.Module):
Expand Down

0 comments on commit e30d436

Please sign in to comment.