Skip to content

Add __main__ guards to jit tests #154725

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

AnthonyBarbier
Copy link
Collaborator

@AnthonyBarbier AnthonyBarbier commented May 30, 2025

This PR is part of a series attempting to re-submit #134592 as smaller PRs.

In jit tests:

  • Add and use a common raise_on_run_directly method for when a user runs a test file directly which should not be run this way. Print the file which the user should have run.
  • Raise a RuntimeError on tests which have been disabled (not run)

cc @EikanWang @jgong5 @wenzhe-nrv @sanchitintel

@AnthonyBarbier AnthonyBarbier requested a review from a team as a code owner May 30, 2025 15:16
Copy link

pytorch-bot bot commented May 30, 2025

🔗 Helpful Links

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

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 92f9857 with merge base 450180f (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.

@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label May 30, 2025
@AnthonyBarbier
Copy link
Collaborator Author

@pytorchbot label "topic: not user facing"

@pytorch-bot pytorch-bot bot added the topic: not user facing topic category label May 30, 2025
Skylion007
Skylion007 previously approved these changes May 31, 2025
@AnthonyBarbier
Copy link
Collaborator Author

I don't think the dynamo perf regressions are caused by this PR (It's not touching anything in that area)

@AnthonyBarbier AnthonyBarbier force-pushed the anthonyb/guarded_tests_jit branch from 9ba58d1 to 434da1b Compare June 2, 2025 17:17
@AnthonyBarbier
Copy link
Collaborator Author

@pytorchmergebot merge

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

@malfet
Copy link
Contributor

malfet commented Jun 4, 2025

@pytorchbot revert -m "This added 2nd copy of raise_on_run to common_utils.py which caused lint failures, see https://github.com/pytorch/pytorch/actions/runs/15445374980/job/43473457466" -c weird

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a revert job. Check the current status here.
Questions? Feedback? Please reach out to the PyTorch DevX Team

pytorchmergebot added a commit that referenced this pull request Jun 4, 2025
This reverts commit 1a55fb0.

Reverted #154725 on behalf of https://github.com/malfet due to This added 2nd copy of raise_on_run to common_utils.py which caused lint failures, see https://github.com/pytorch/pytorch/actions/runs/15445374980/job/43473457466 ([comment](#154725 (comment)))
@pytorchmergebot
Copy link
Collaborator

@AnthonyBarbier your PR has been successfully reverted.

@pytorchmergebot pytorchmergebot added Reverted ci-no-td Do not run TD on this PR labels Jun 4, 2025
@pytorch-bot pytorch-bot bot dismissed Skylion007’s stale review June 4, 2025 15:43

This PR was reopened (likely due to being reverted), so your approval was removed. Please request another review.

@pytorch-bot pytorch-bot bot removed the ciflow/trunk Trigger trunk jobs on your pull request label Jun 4, 2025
@AnthonyBarbier
Copy link
Collaborator Author

@pytorchbot revert -m "This added 2nd copy of raise_on_run to common_utils.py which caused lint failures, see https://github.com/pytorch/pytorch/actions/runs/15445374980/job/43473457466" -c weird

I was going to clean it up at the end: I've got 6 of them to get reviewed, I don't have the permissions required to either stack PRs or start the CI runs myself, and it's already taking forever 😭

@AnthonyBarbier AnthonyBarbier force-pushed the anthonyb/guarded_tests_jit branch from 434da1b to 92f9857 Compare June 5, 2025 08:08
angelayi pushed a commit to angelayi/pytorch that referenced this pull request Jun 5, 2025
This PR is part of a series attempting to re-submit pytorch#134592 as smaller PRs.

In jit tests:

- Add and use a common raise_on_run_directly method for when a user runs a test file directly which should not be run this way. Print the file which the user should have run.
- Raise a RuntimeError on tests which have been disabled (not run)

Pull Request resolved: pytorch#154725
Approved by: https://github.com/Skylion007
angelayi pushed a commit to angelayi/pytorch that referenced this pull request Jun 5, 2025
This reverts commit 1a55fb0.

Reverted pytorch#154725 on behalf of https://github.com/malfet due to This added 2nd copy of raise_on_run to common_utils.py which caused lint failures, see https://github.com/pytorch/pytorch/actions/runs/15445374980/job/43473457466 ([comment](pytorch#154725 (comment)))
@mikaylagawarecki mikaylagawarecki added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Jun 6, 2025
@AnthonyBarbier
Copy link
Collaborator Author

@Skylion007 Any chance you could re-approve this PR please? (I've removed the code duplication)

@AnthonyBarbier
Copy link
Collaborator Author

@pytorchmergebot merge

Copy link

pytorch-bot bot commented Jun 11, 2025

Pull workflow has not been scheduled for the PR yet. It could be because author doesn't have permissions to run those or skip-checks keywords were added to PR/commits, aborting merge. Please get/give approval for the workflows and/or remove skip ci decorators before next merge attempt. If you think this is a mistake, please contact PyTorch Dev Infra.

@AnthonyBarbier AnthonyBarbier removed the ci-no-td Do not run TD on this PR label Jun 13, 2025
@AnthonyBarbier
Copy link
Collaborator Author

@pytorchmergebot merge

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

@pytorchmergebot
Copy link
Collaborator

The merge job was canceled or timed out. This most often happen if two merge requests were issued for the same PR, or if merge job was waiting for more than 6 hours for tests to finish. In later case, please do not hesitate to reissue the merge command
For more information see pytorch-bot wiki.

@AnthonyBarbier
Copy link
Collaborator Author

@pytorchmergebot merge

@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

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: 2 jobs have failed, first few of them are: trunk / linux-jammy-rocm-py3.10 / test (default, 2, 2, linux.rocm.gpu.2), trunk / linux-jammy-rocm-py3.10 / test (default, 1, 2, linux.rocm.gpu.2)

Details for Dev Infra team Raised by workflow job

@AnthonyBarbier
Copy link
Collaborator Author

@pytorchmergebot merge

@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

vijayabhaskar-ev pushed a commit to vijayabhaskar-ev/pytorch that referenced this pull request Jun 22, 2025
This PR is part of a series attempting to re-submit pytorch#134592 as smaller PRs.

In jit tests:

- Add and use a common raise_on_run_directly method for when a user runs a test file directly which should not be run this way. Print the file which the user should have run.
- Raise a RuntimeError on tests which have been disabled (not run)

Pull Request resolved: pytorch#154725
Approved by: https://github.com/Skylion007
vijayabhaskar-ev pushed a commit to vijayabhaskar-ev/pytorch that referenced this pull request Jul 14, 2025
This PR is part of a series attempting to re-submit pytorch#134592 as smaller PRs.

In jit tests:

- Add and use a common raise_on_run_directly method for when a user runs a test file directly which should not be run this way. Print the file which the user should have run.
- Raise a RuntimeError on tests which have been disabled (not run)

Pull Request resolved: pytorch#154725
Approved by: https://github.com/Skylion007
pytorchmergebot pushed a commit that referenced this pull request Aug 2, 2025
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 oncall: jit Add this issue/PR to JIT oncall triage queue open source Reverted topic: not user facing topic category triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants