-
Notifications
You must be signed in to change notification settings - Fork 25.6k
OpInfo: Add test that sample_inputs_func returns a generator #84567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
[ghstack-poisoned]
🔗 Helpful links
✅ No Failures (31 Pending)As of commit a8fc80a (more details on the Dr. CI page): Expand to see more💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Please report bugs/suggestions to the (internal) Dr. CI Users group. |
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/84567
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 7652954: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
This does include a small list exception for less than 4 elements, but that will be tightened to 1 element in a follow-up PR. [ghstack-poisoned]
self.assertEqual(s2.name, "foo") | ||
|
||
|
||
class TestOpInfoSampleFunctions(TestCase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment describing this class
else: | ||
self.assertIsInstance(item, Generator) | ||
|
||
@ops(op_db, dtypes=OpDTypes.any_one) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests make a lot of sense (comments describing each one, please!)
Should we consider adding these checks to the tests in test_ops.py
that exercise these generators, instead? That's not conceptually ideal because then those tests are testing multiple things (they probably already are), but it would reduce duplicative work in the test suite, which does a lot already. Or are these new tests so fast we shouldn't be concerned about their speed?
An example of a similar case is the test for "input" tensors having no grad history, which is in the noncontiguous samples test:
Line 503 in c27a517
# Verifies sample input tensors should have no grad or history |
cc @lezcano
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A great thing to have would be a test that tests OpInfo samples themselves, and have all these tests grouped there. Until then, if this test is fast enough, it's probably good enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On my machine
time pytest test_testing.py -k TestOpInfoSampleFunctions
takes less than 10 seconds even on a build with CUDA. So I'm not particularly concerned.
On the other hand if we combine these checks into an existing test, then the test is more likely to be skipped for no good reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM
This also includes a small list exception for single element lists. ghstack-source-id: 9c6f73b Pull Request resolved: pytorch#84567
This also includes a small list exception for single element lists since none of the memory usage or performance implications of lists apply there. [ghstack-poisoned]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good stuff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Timing looks good, but see notes requesting additional comments and the lint failure may be real!
This also includes a small list exception for single element lists since none of the memory usage or performance implications of lists apply there. [ghstack-poisoned]
…rns a generator" This also includes a small list exception for single element lists since none of the memory usage or performance implications of lists apply there. [ghstack-poisoned]
@pytorchbot merge |
Merge startedYour 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 |
Merge failedReason: The following mandatory check(s) failed (Rule Dig deeper by viewing the failures on hud Details for Dev Infra teamRaised by workflow job |
This also includes a small list exception for single element lists since none of the memory usage or performance implications of lists apply there. [ghstack-poisoned]
@pytorchbot merge |
Merge startedYour 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 |
…#84567) This also includes a small list exception for single element lists since none of the memory usage or performance implications of lists apply there. Pull Request resolved: pytorch#84567 Approved by: https://github.com/lezcano, https://github.com/mruberry
…#84567) This also includes a small list exception for single element lists since none of the memory usage or performance implications of lists apply there. Pull Request resolved: pytorch#84567 Approved by: https://github.com/lezcano, https://github.com/mruberry
Stack from ghstack (oldest at bottom):
This also includes a small list exception for single element lists since none of the memory usage or performance implications of lists apply there.