-
Notifications
You must be signed in to change notification settings - Fork 276
Add a multithreaded stress test #637
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
base: main
Are you sure you want to change the base?
Conversation
Narsil
left a comment
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.
Nice addition indeed. Can you remove the parametrize everywhere and instead just use simple code everywhere ?
Just duplicate the tests for numpy and torch, it's perfectly fine
|
Much simpler now, thanks for the code review. |
|
Great, it's working and I can reproduce the segfault. Let's probably wait for it to be fixed in torch before merging this, no ? |
|
Clippy errors are fixed on main. |
|
IMO it's still worth running this test on the GIL-enabled build and for NumPy. I'll skip the test if the GIL is disabled for now and add a link to the PyTorch issue. |
43a28b7 to
671f6e6
Compare
|
I don't like skipping a test because it fails. The point of tests is to let them fail when something is wrong. If we simply skip them when something is working, then nothing will ever check that finally they are working again and we should switch them. That's why I suggest we simply postpone this. The fact that the PR is open, means it will be revisited at some point. |
Sounds good, I've added a note to myself to revisit this once the PyTorch issue is fixed upstream and we can at least set up CI with a nightly build. |
What does this PR do?
Adds a test based on the script I used to find pytorch/pytorch#158071.
The test serializes a dict of tensors in many threads simultaneously. Currently this is enough to segfault pytorch on the free-threaded build - no mutation necessary.
IMO having a multithreaded stress test like this is worth doing, especially looking torward adding support for the free-threaded build.