You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason behind the failure is since Python 3.8, the default start method for multiprocessing has been changed from 'fork' to 'spawn' on macOS. The default start method is still 'fork' on Linux. It will cause a memory-sharing problem for the test "test_large_zip" on macOS. The fix is to change the start method for this context back to 'fork' so that all platforms will have the same memory sharing model and thus fix the failed test.
vxst
added a commit
to vxst/numpy
that referenced
this issue
Sep 5, 2022
Since Python 3.8, the default start method for multiprocessing has been changed from fork to spawn on macOS
The default start method is still fork on other Unix platforms[1], causing inconsistency on memory sharing model
It will cause a memory-sharing problem for the test test_large_zip on macOS as the memory sharing model between spawn and fork is different
The fix
Change the start method for this test back to fork under this testcase context
In this test case context, the bug that caused default start method changed to spawn for macOS will not be triggered
It is context limited, so this change will not affect default start method other than test_large_zip
All platforms have the same memory sharing model now
After the change, test_large_zip is passed on macOS
https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methodsClosesnumpygh-22203
Describe the issue:
In a full test,(numpy.test('full')), using pthread model(the default) with Darwin kernel:
lib/tests/test_io.py::TestSaveTxt::test_large_zip test is FAILED due to an AttributeError.
The failed function is:
The stack trace at multiprocessing is
Test hardwares include M1 Max with 32 core GPU and 64GB memory and M1 with 16GB memory.
Test python version include cpython 3.8 and cpython 3.9.
Four configurations all fail in the same manner.
Reproduce the code example:
Error message:
NumPy/Python version information:
1.21.6 at both Python 3.8 and Python 3.9 environments, built by homebrew.
and
The system uname is:
Context for the issue:
It cause numpy.test('full') to fail on macOS.
The text was updated successfully, but these errors were encountered: