Skip to content

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

Closed

Conversation

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Feb 5, 2025

🔗 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 Failures

As of commit 98cc85f with merge base b18e3c0 (image):

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.

@@ -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):
Copy link
Contributor

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

Copy link
Contributor

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

[ghstack-poisoned]

def standard_test(
self: Any,
fn: Callable[..., Any],
Copy link
Collaborator

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

[ghstack-poisoned]
@guilhermeleobas guilhermeleobas requested a review from a team as a code owner February 6, 2025 19:49
[ghstack-poisoned]
[ghstack-poisoned]
Comment on lines 1735 to 1736
Dynamo injects a dummy call to `torch.sin(random_tensor)` to ensure graph
generation, even when testing for side effects.
Copy link
Contributor

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

[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@guilhermeleobas
Copy link
Collaborator Author

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Feb 12, 2025
@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

desai0007 pushed a commit to desai0007/test-repo-pytorch that referenced this pull request Feb 26, 2025
ghstack-source-id: ed7c165
Pull Request resolved: pytorch/pytorch#146491
desai0007 pushed a commit to desai0007/test-repo-pytorch that referenced this pull request Feb 26, 2025
ghstack-source-id: 7b1c151
Pull Request resolved: pytorch/pytorch#146491
desai0007 pushed a commit to desai0007/test-repo-pytorch that referenced this pull request Feb 26, 2025
ghstack-source-id: a7b1d8d
Pull Request resolved: pytorch/pytorch#146491
@github-actions github-actions bot deleted the gh/guilhermeleobas/92/head branch March 23, 2025 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants