Repository navigation
Conversation
The experiments on the numpy.linalg crashes on Windows on ARM (see #1003) run in their own pull requests. Remove the Azure pipeline and the wheel builds, the workflows that run the tests, so that these pull requests do not use the CI queues. Not for merging.
Maps the sizes at which numpy.linalg calls, SciPy's LAPACK and BLAS, and the LAPACK and BLAS routines of numpy's OpenBLAS (called directly with ctypes) crash. A child process walks through the sizes, and after a crash or a hang a new child continues with the next size, so a map takes minutes rather than a process for every size. Each size that crashed is then tried alone. Options set the OpenBLAS threads in the environment or at run time, the stack of the thread that makes the calls, and faulthandler. Not for merging.
Calls getrf, getrs, gesv, getri, potrf, trsm, laswp, gemm and gemv in numpy's OpenBLAS directly, with the number of threads set when OpenBLAS starts and changed at run time. Not for merging.
|
|
||
| result["scipy"] = scipy.__version__ | ||
| result["scipy openblas"] = runtime("scipy") | ||
| except ImportError: |
dgesv crashes at sizes 23 to 31 with 1 thread, but dgetrf and dgetrs, which dgesv calls inside, do not crash alone. Call them one after the other on the same matrix, as dgesv does, and call dgesv with three right-hand sides. Not for merging.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Experimental, not for merging. One of four experiments on the access violations in
numpy.linalgon Windows on ARM that #1003 found. WithOPENBLAS_NUM_THREADS=1,invandsolveof small positive definite matrices crash in numpy 2.5.4's OpenBLAS, and numpy alone reproduces it. Each experiment has its own pull request, so that they run at the same time and each can change without restarting the others: #1003 (arch's tests), #1004 (the calls and threads), #1005 (the numpy versions), #1006 (the OpenBLAS routines) and #1007 (SciPy, the stack and faulthandler).Like #1003, this removes the Azure pipeline (
azure-pipelines.yml) and the wheel builds (cron-test.yml), so that no tests run here. arch is not built: the job installs only numpy (and SciPy where needed) from wheels.What this one runs
The LAPACK and BLAS routines in numpy's own OpenBLAS, called directly with
ctypes:getrf,getrs,gesv,getri,potrf,trsm,laswp,gemmandgemv.invisgesv(getrf, thenlaswpandtrsmingetrs), so this finds the routine that crashes.getrs,getri,trsmandlaswpget an LU computed without BLAS, so a crash ingetrfcan't be blamed on them. Each call checks its result without BLAS.ctypesturns an access violation into anOSErrorwith the address, which the report shows.The jobs also set the number of threads at run time with
openblas_set_num_threads, to find whether the crash follows the number when OpenBLAS starts or when it is called:OPENBLAS_NUM_THREADS1, 4 and unset, unset then set to 1, 4 then set to 1, and 1 then set to 4. numpy'sinvandsolverun too, to compare with. numpy 2.5.4, Python 3.14.How it works
ci/github-actions/winarm_blas.py, the same in all four pull requests, makes every call in a child process. A child walks through the sizes (1 to 64, then every 8th to 160) and printsstart CALL Nbefore each call. When it crashes or hangs (60 s), the size is recorded and a new child goes on with the next size. Each size that crashed is then tried alone, in a new process. So a map takes minutes rather than a process for every size, which is what made the size map in #1003 so slow. The matrices are built without BLAS (einsum), so the call under test is the only BLAS call.The job passes when the map is complete, whether or not anything crashed. The results are in the job summary, in the log as they come, and in the
report.mdartifact. Each report starts with the builds and what OpenBLAS reports at run time (kernel, threads, configuration) and the CPU.Checked locally (x64)
actionlintandcheck-jsonschema(GitHub workflow schema) report no problems. The script is clean under ruff, black, isort, flake8, bandit and pylint.selftestcrashes at size 5 and is found, the walk goes on, and the crash is found again alone.🤖 Generated with Claude Code