-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Add make_dynamo_test
#146491
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
Add make_dynamo_test
#146491
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/146491
Note: Links to docs will display an error until the docs builds have been completed. ⏳ 3 Pending, 5 Unrelated FailuresAs of commit 98cc85f with merge base b18e3c0 ( FLAKY - The following job failed but was likely due to flakiness present on trunk:
BROKEN TRUNK - The following jobs failed but was present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
UNSTABLE - The following jobs are marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
test/dynamo/utils.py
Outdated
@@ -60,3 +62,39 @@ def install_guard_manager_testing_hook(hook_fn): | |||
yield | |||
finally: | |||
torch._dynamo.guards.guard_manager_testing_hook_fn = old_value | |||
|
|||
|
|||
def make_dynamo_test(fn=None, expected_frame_count=1): |
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 docstring about how dynamo needs a tensor operation to do anything
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.
Btw after #146527 we don't actually need to insert the .sin() calls
test/dynamo/utils.py
Outdated
|
||
def standard_test( | ||
self: Any, | ||
fn: Callable[..., Any], |
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.
Why not use ParamSpec, and TypeVar to preserve Callable inputs and return type
Dynamo injects a dummy call to `torch.sin(random_tensor)` to ensure graph | ||
generation, even when testing for side effects. |
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.
Since we're here now and #146527 has landed, there's no need for the .sin calls anymore
@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 |
ghstack-source-id: ed7c165 Pull Request resolved: pytorch/pytorch#146491
ghstack-source-id: 7b1c151 Pull Request resolved: pytorch/pytorch#146491
ghstack-source-id: a7b1d8d Pull Request resolved: pytorch/pytorch#146491
Stack from ghstack (oldest at bottom):
__context/cause/suppress_context/traceback__
to Exception #146499UserDefinedExceptionClassVariable
#146504AttributeError
to user code in user_defined.py #146497is
/is not
#146496RAISE_VARARGS 0
#146493WITH_EXCEPT_START
opcode #146492sys.exc_info
andsys.exception
#146498make_dynamo_test
#146491cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang @amjames