-
Notifications
You must be signed in to change notification settings - Fork 129
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
Reduce runtimes for tests #1929
Comments
4. Run the tests in parallelAlthough the github action runners are not that powerful, at least for macOS one can run tests them in parallel. There is nothing native in julia, but it is doable. It requires more structure in the organization of the tests, but it is worthwhile. We are doing this in Hecke, see for example https://github.com/thofma/Hecke.jl/blob/master/test/runtests.jl. |
See also #851 . |
The timeout for macos-nightly should be fixed, see #1888. (It is still rather slow though, last run on master was 84 minutes) Regarding 1: Regarding 2: The oscar-system organization is currently in the Regarding 4: 5. Randomization:We do have some testcases than can take very long but only from time to time due to randomization, this could be improved by using seeded random number generation. I have done this for one test-group and added some helpers to make it easier to use in this PR: #1459 |
If anyone wants to look at some timings, I have created a branch that will print timings and allocations per file (not per testset) as a markdown table in the github job summary, e.g. https://github.com/oscar-system/Oscar.jl/actions/runs/4164703901 . (Using a slightly hacky modified Example output: Timings in seconds per file
Allocations in megabytes per file
|
Thanks! Would be great if we could hoax julia into not including compilation time for comparison. |
Maybe if we do this as a separate job (via cron-trigger at night) and Edit: |
This does seem to work now, see for example this table: https://github.com/oscar-system/Oscar.jl/actions/runs/4175058172#summary-11332566695 I have created a draft PR for this: #1942 |
Wow. This really looks great! |
Indeed, great! I was also wondering why the |
Since the merge of 10100da, the execution time of the doctests in julia 1.6 on ubuntu went up from 15-20 minutes (cf. here) to > 30 minutes after (cf. here). Would it be possible to split the doctests into their own job to circumvent the 120 minutes deadline? |
The timeout is set by us in #1226. Nevertheless we should think about how to manage this. The testsuite will continue to grow in the future and at the current rate we will exhaust the limit of github actions pretty soon, I think this is at 5 hours. I'd propose to subdivide the testsuite into a "core" and "extended", if that is possible in a reasonable way. Then these two things could run separately. But that the doctests went up by 10min seems a bit excessive. What are your thoughts about the difference between doctests vs tests? For me stuff in the doctests should be small and basically only illustrate usage. It is only tested to make sure that nothing in the docs is broken. Things requiring performance belong should be tests. But maybe that is only my opinion? At some point we also had gigantic ideals in the tropical geometry doctests and I'd say this issue is similar. |
I was (and am) aware that the doctests for Let me mention that I did deactive CI tests for Either way - could you explain why the longer doctests caused https://github.com/oscar-system/Oscar.jl/actions/runs/4553825159/jobs/8030881380 and https://github.com/oscar-system/Oscar.jl/actions/runs/4556618792/jobs/8037205840? I was not aware that there is a correlation among the CI tests in julia version 1.6 and the doctests. |
Let me investigate why the |
The doctests are run as part of the testsuite iff the julIaversion is 1.6. When you turn on timestamps in the logs, you can see that here the doctests need > 30 minutes. |
Ah. I see. Sorry I was not aware of this. I will think of something to speed-up the doctests for |
Thinking of it - is it really necessary to run the doctests as part of the 1.6 CI-tests. We run
I never looked at it before, but indeed assumed that the github action (But still, the point remains that the |
#1768 added the doctests to the normal CI. The main reason is that it makes them count for coverage. |
As another aspect I want to mention the comments in #2187.
So I propose to subdivide the tests into three categories: nanosoldier, core, and extended. Whatever we do, we should have some testset that fits into the nanosoldier thingy and that isn't touched by the average Lars by accident. |
By now, the CI runs for OSCAR are arguably pretty long. Here are the timings from the last run in #1909:
As I see it, it would be great to reduce the runtimes (quicker to debug). Maybe we add this to the agenda on the OSCAR developer meeting, February 21 - 23? (@fieker , @wdecker)
Here are a few thoughts after a brief conversation with @fieker:
1. Optimizing the tests:
The code coverage should not be reduced and the executed tests should thoroughly check on the implemented methods. Still, maybe this could be achieved with fewer lines of code that are executed faster? As a starting point, one might want to have a list of the execution times, so that one can see which tests take up most of the time. For future investigation, this could possibly even be automatically updated on the OSCAR website say every 24 hours based on the latest runs with the latest OSCAR master?
2. More CIs:
In principle, one could envision to replace
Run tests / test (1.6, x64, ubuntu-latest)
by 4 CI runs, one for each cornerstone:So four machines would execute the tests. In an ideal world, thus only a quarter of the tests per machine. Realistically, the speed-up would not be factor 4, but one might still hope for a sizeable speedup. For instance, one of the four cornerstones probably takes longest for its tests (I have not checked, but my gut-feeling would be towards
Singular & Algebraic Geometry
). This real speed-up could be estimate based on an overview of the runtimes, as mentioned above.An obstacle is that the number of parallel CI runs on github seems limited. I am not entirely sure if I read this information correctly, but if so then e.g. the free github plan limits this number to 20. In the case at hand, one would need 3 + 7 x 4 (i.e. keep the first three jobs in the list above and split the 7 other CI runs into 4 parallel runs each, one per cornerstone), i.e. 31 in total. And then, I am not sure if this limitation is per PR or for the entire repository. So for this to work efficiently, one might have to pay a sizeable amount for a suitable github account to host OSCAR.
3. Running the tests locally on a powerful machine:
As @fieker informs me, there seem to be thoughts on having a powerful machine which executes the test tests and then uploads the results to github.
Presumably, the above list is not complete and an ideal solution combines several distinct approaches.
The text was updated successfully, but these errors were encountered: