-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
allow stdlibs to run their tests in parallel #25778
Conversation
Nice! Maybe call the |
I think I will call it |
It's true that |
Actually, since we're using TOML for all of the package configuration, maybe there should be a
|
dd07d50
to
7f91024
Compare
Changed the name to As a bonus I made the printing a bit (imo) better. The worker number now align to the right and all other numbers like time and allocations etc also align to the right since that is usually better for numbers:
|
this is done by creating a file `tests` in the `test` folder that lists the different files with tests (excluding ".jl"). If this file does not exist, we fall back to using the runtests.jl file
7f91024
to
e2919d9
Compare
The test groups with the largest times are now:
Splitting these up would likely not make much difference to CI time but for developers who have access to high core machines, it will likely make running the full suite faster. And as a remark, in the triangular tests: for elty1 in (Float32, Float64, BigFloat, ComplexF32, ComplexF64, Complex{BigFloat}, Int)
# Begin loop for first Triangular matrix
for (t1, uplo1) in ((UpperTriangular, :U),
(UnitUpperTriangular, :U),
(LowerTriangular, :L),
(UnitLowerTriangular, :L)) Can that really be completely necessary...? |
Which part? :) |
The part that takes over ten minutes to test. Brute forcing is fine if the running time doesn't become is excessive. This is very excessive in my opinion. Should be possible to do it in a more clever way. |
Should be good to go. |
stdlib/Dates/test/runtests.jl
Outdated
include("io.jl") | ||
include("arithmetic.jl") | ||
include("conversions.jl") | ||
for file in readlines(joinpath(@__DIR__, "testgroups") |
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.
Missing a close paren. (also in the other runtests.jl files)
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.
Woops! Fixed. Pushed with ci skipped because these files don't get run during CI anyway.
Maybe, but it is hard to predict where the promotion/dispatch issues could occur. It is more often the case that a code change introduces unintended dispatch changes than it introduces an error is in an algorithm. Reducing coverage is an easy way to reduce test time. The time here is not spent on repeated calls to the same methods. Almost all of the time is spent on compiling methods so speeding up the tests is the same as not testing these methods. If compilation time is a serious concern, a more fundamental solution would be to restrict two-argument in-place linear algebra methods to the same element types. I.e continue to support |
After some of the larger modules (like
LinearAlgebra
) was moved to stdlib it became evident that having each stdlib run its tests in serial is a bit painful.In addition, it is not possible to choose to only run a part of a stdlibs test (for example the
matmul
tests in LinearAlgebra).There have also been some concerns about the memory usage of e.g. LinearAlgebra when it is tied to one worker.
This PR presents a remedy to this problem. Each stdlib can optionally chose to have a file
tests
in their test folder. This is a list of testnames, each corresponding to a file that can be run independently. If this file does not exist, we fall back to just usingruntests.jl
which is supposed to run the tests serially. We can run a specific test for a stdlib using e.g.LinearAlgebra/matmul
.I have here chosen only to create
test
files for LinearAlgebra and SparseArrays because these tend to take a significant time. Not sure how worth it is to do the same for other stdlibs.Below is the result of running
./julia test/runtests.jl SparseArrays
:And this is
./julia test/runtests.jl LinearAlgebra/lq
:In the test output, it will write e.g.Edit: FixedREPL/runtests
now, if the stdlib falls back to useruntests.jl
. I thought about filtering the testname if the fallback file is used but didn't know how much it mattered.cc @mbauman, @andreasnoack
This might lead to slightly longer CI times because it undoes the effect mentioned in #25571 (comment). I will probably make a follow up PR to this one where each worker is encouraged to work as much as it can on each testgroup instead of just pulling the next one in the list.