Attempt to reducing CI strain through compile time - #517
Conversation
|
I'd be somewhat surprised if this helps too much, it might be worth it to measure where the actual compilation is happening but I'd expect most of it to be in the tensor kernels, which are largely shared between finite and infinite implementations. A different thing could be to just split up the tests into more groups, i.e. just use more runners, for example splitting off time evolution algorithms from groundstate/leading boundary algorithms etc |
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
Yeah, testing both fast and normal mode, it seems that there's no global speedup this way. I'm looking into |
|
Good point, I almost forgot about that PR. I'll try and take that back up, since I do think that should help out quite severely. |
|
I haven't tested yet with TensorKit precompilation, but at least within MPSKit the compilation bottlenecks are (unsurprisingly) |
|
So I have 3 data points on running 2 of the compile-heaviest tests (MPOHamiltonian and changebonds) with and without TensorKit precompilation. I did this on the MPSKit main branch, so whatever (minimal or no) effects this branch currently has plays no role. The run-to-run variance is massive, but TensorKit precompilation does help. This being a statistical coincidence is (1/2)^6 so I think it's safe to say that it's beneficial to precompile. It is fairly modest on my machine though. It fluctuates between 3-17% speedup, on average ~9% which is about 4 minutes per file. Given that, I believe that the best thing to do is to set up precompilation within MPSKit as well. Afterwards we can see if test splitting can fill in remaining gaps. |
|
I'm not entirely sure what you measured of course (did you include the tensorkit precompilation time?), but there is the additional effect that sometimes the CI can actually cache the TensorKit precompilation entirely, in which case this is more or less a free speedup. |
|
No, indeed my first run did have an additional cost in precompiling TK (15 minutes on my machine, though I think it was under strain from other tasks), so with the small amount of tests I did it's more or less break-even. But it's clear when running all the tests multiple times, its effects are more and more prominent. I ran |
Description
I first considered splitting symmetric and non-symmetric code, but then many files would be super tiny. The next best thing I thought of was the finite-infinite split. This is in no way definitive, just wanted to get the ball rolling on considering this, especially before merging #509 which is ridiculously expensive.
Summary:
None of the content or hyperparameters of tests have been changed, it's really just copy-paste, introducing some lists and truncating them depending on
fast_tests, or skipping certain test sets based on this.The downside to this approach is that all checks will take longer to finish, but at least they'll finish instead of time out. And who knows, maybe the time saved on compiling might be enough to be comparable with full parallelisation.
Checklist
julia --project=test test/runtests.jl, or the relevant subset)docs/src/)[Unreleased]indocs/src/changelog.md, if this PR is user-facing (new feature, behavior change, bug fix, deprecation, or removal)