Skip to content

Conversation

@tugsbayasgalan
Copy link
Contributor

@tugsbayasgalan tugsbayasgalan commented Oct 21, 2024

Stack from ghstack (oldest at bottom):

In this PR, I make test_export to be compatible with training IR. The idea is that when we flip the IR to non-functional training IR, all these tests should be green. The changes involve reading through the test case, and add necessary decomposition etc to make sure the tests pass. For example, if the tests expect to see mutated buffers returned, we need to get them via running run_decomp.

Differential Revision: D64732360

@pytorch-bot
Copy link

pytorch-bot bot commented Oct 21, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/138517

Note: Links to docs will display an error until the docs builds have been completed.

✅ You can merge normally! (1 Unrelated Failure)

As of commit 651c24f with merge base 4299423 (image):

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

tugsbayasgalan added a commit that referenced this pull request Oct 22, 2024
ghstack-source-id: b661f3b
Pull Request resolved: #138517
@tugsbayasgalan
Copy link
Contributor Author

@tugsbayasgalan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@pytorch-bot pytorch-bot bot added the topic: not user facing topic category label Oct 22, 2024
@tugsbayasgalan
Copy link
Contributor Author

@tugsbayasgalan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

return x + y + z + w2

ep = export(M(), (torch.randn(2, 3),), strict=False)
ep = export(M(), (torch.randn(2, 3),), strict=False).run_decompositions({})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why these extra run_decompositions? I guess I'm missing context on this PR, what does it mean to make these tests "training IR compatible"? Please add a summary to the PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test expects to see mutated buffer as extra output. Only way we get it today is via functiionalizaiton.

)
check_users_for_graph(ep.graph)

def test_export_predispatch_custom_ops_warnings(self):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't matter anymore

return x.to("cpu")

ep = export(Module(), (torch.tensor(1, device="cpu"),))
ep = export(Module(), (torch.tensor(1, device="cpu"),)).run_decompositions({})
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests expect to see functional operator.

self.assertTrue(torch.allclose(unflattened(*inps), M2()(*inps)))

@testing.expectedFailureRetraceability # Retracing tensor constants results in buffers
#@testing.expectedFailureRetraceability # Retracing tensor constants results in buffers
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this goes away, is that good or bad? Just want to make sure that if there's still something to fix, we keep an expected failure.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The failure was actually not related to tensor constants lol. It was just some graph mismatch.

In this PR, I make test_export to be compatible with training IR. The idea is that when we flip the IR to non-functional training IR, all these tests should be green. The changes involve reading through the test case, and add necessary decomposition etc to make sure the tests pass. For example, if the tests expect to see mutated buffers returned, we need to get them via running run_decomp. 

Differential Revision: [D64732360](https://our.internmc.facebook.com/intern/diff/D64732360)

[ghstack-poisoned]
In this PR, I make test_export to be compatible with training IR. The idea is that when we flip the IR to non-functional training IR, all these tests should be green. The changes involve reading through the test case, and add necessary decomposition etc to make sure the tests pass. For example, if the tests expect to see mutated buffers returned, we need to get them via running run_decomp. 

Differential Revision: [D64732360](https://our.internmc.facebook.com/intern/diff/D64732360)

[ghstack-poisoned]
self.assertExpectedInline(
str(ep.graph_module.code).strip(),
"""\
ep = export_for_training(M(), (torch.randn(2, 2),)).run_decompositions(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like you need to remove the xfail from here

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Oct 23, 2024
@tugsbayasgalan
Copy link
Contributor Author

@tugsbayasgalan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

In this PR, I make test_export to be compatible with training IR. The idea is that when we flip the IR to non-functional training IR, all these tests should be green. The changes involve reading through the test case, and add necessary decomposition etc to make sure the tests pass. For example, if the tests expect to see mutated buffers returned, we need to get them via running run_decomp. 

Differential Revision: [D64732360](https://our.internmc.facebook.com/intern/diff/D64732360)

[ghstack-poisoned]
tugsbayasgalan added a commit that referenced this pull request Oct 23, 2024
ghstack-source-id: b81baae
Pull Request resolved: #138517
In this PR, I make test_export to be compatible with training IR. The idea is that when we flip the IR to non-functional training IR, all these tests should be green. The changes involve reading through the test case, and add necessary decomposition etc to make sure the tests pass. For example, if the tests expect to see mutated buffers returned, we need to get them via running run_decomp. 

Differential Revision: [D64732360](https://our.internmc.facebook.com/intern/diff/D64732360)

[ghstack-poisoned]
tugsbayasgalan added a commit that referenced this pull request Oct 28, 2024
ghstack-source-id: ffa1ddd
Pull Request resolved: #138517
@tugsbayasgalan
Copy link
Contributor Author

@tugsbayasgalan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@pytorchbot merge

(Initiating merge automatically since Phabricator Diff has merged)

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

rahulsingh-intel pushed a commit to rahulsingh-intel/pytorch that referenced this pull request Oct 29, 2024
In this PR, I make test_export to be compatible with training IR. The idea is that when we flip the IR to non-functional training IR, all these tests should be green. The changes involve reading through the test case, and add necessary decomposition etc to make sure the tests pass. For example, if the tests expect to see mutated buffers returned, we need to get them via running run_decomp.

Differential Revision: [D64732360](https://our.internmc.facebook.com/intern/diff/D64732360)
Pull Request resolved: pytorch#138517
Approved by: https://github.com/avikchaudhuri
rahulsingh-intel pushed a commit to rahulsingh-intel/pytorch that referenced this pull request Nov 5, 2024
In this PR, I make test_export to be compatible with training IR. The idea is that when we flip the IR to non-functional training IR, all these tests should be green. The changes involve reading through the test case, and add necessary decomposition etc to make sure the tests pass. For example, if the tests expect to see mutated buffers returned, we need to get them via running run_decomp.

Differential Revision: [D64732360](https://our.internmc.facebook.com/intern/diff/D64732360)
Pull Request resolved: pytorch#138517
Approved by: https://github.com/avikchaudhuri
@github-actions github-actions bot deleted the gh/tugsbayasgalan/266/head branch November 28, 2024 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged release notes: export topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants