Skip to content

Set test seed per-test#19744

Open
GregoryComer wants to merge 1 commit into
pytorch:mainfrom
GregoryComer:test-seeding-round-2
Open

Set test seed per-test#19744
GregoryComer wants to merge 1 commit into
pytorch:mainfrom
GregoryComer:test-seeding-round-2

Conversation

@GregoryComer
Copy link
Copy Markdown
Member

Summary

In #19651, I added a global seed for pytest runs. This was intended to reduce random tolerance flakes, but didn't actually do so in practice. This is because the parallel test runners don't guarantee any ordering, so random state is unstable between runs.

I've updated it to set the seed per-test. This should hopefully make the random state invariant of test execution order.

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented May 22, 2026

🔗 Helpful Links

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

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

✅ No Failures

As of commit 140cbf3 with merge base 2b7a5a2 (image):
💚 Looks good so far! There are no failures yet. 💚

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

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 22, 2026
@GregoryComer GregoryComer added release notes: none Do not include this in the release notes and removed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels May 22, 2026
@GregoryComer GregoryComer force-pushed the test-seeding-round-2 branch from 2c56155 to 140cbf3 Compare May 23, 2026 00:33
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 23, 2026
@GregoryComer
Copy link
Copy Markdown
Member Author

Note: the test_replace_conv1d_with_linear test seems to be slightly out of tolerance with this change. The failure is stable across retries, which implies that the seeding works. I've bumped the tolerance a tiny bit. It seems reasonable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. release notes: none Do not include this in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants