Closed jedbrown closed 3 months ago
@wsmoses I can't add @jedbrown to the rust org of Enzyme, can you do that please?
@wsmoses I can't add @jedbrown to the rust org of Enzyme, can you do that please?
Done
I agree that for CI it's probably no issue to rebuild Enzyme, I was never bugged by that in Enzyme core. Also not caching Rust is good because it has less conflict potential if I change Rust, which happens frequently. I never changed the LLVM submodule, at most I added more C++ and Rust wrappers for LLVM functionality. The build times for Rust are also usually in the range of 1-2 minutes (on 48 cores), so it should be well doable even in CI.
:tada: We're at 22 seconds to restore the cached LLVM build (saves about 2 hours). That should automatically rebuild when src/llvm-project
is updated (historically, one or two updates per month on rust-lang/rust@master
). Building Enzyme and Rust stage1
from source takes 36 minutes. Perhaps acceptable, and I think we can improve it with caching, tuned depending on what changes faster.
This is using rustbook@main
now, and will cache Enzyme (as soon as we get a passing pipeline after fixing the regression). I think it's ready to merge so that any fixes or subsequent development have these tests.
@wsmoses This passed, but isn't caching (yet) or testing (yet).
What to cache?
Perhaps the right choice is to cache all of
build
, though it's going to be bigger than the end products of compilation. I don't think rebuilding Ruststage1
(without caching) is prohibitive so long as LLVM is available. These are the sizes for just the LLVM portion. I'll test whether we can deletebuild/host/llvm/build
without that triggering a clean build of LLVM.When/how to rebuild Enzyme?
We currently have an (empty) marker file
build/host/enzyme/enzyme-finished-building
that controls whether Enzyme is rebuilt. Shall we change it to hold the Enzyme commit hash as returned byNote that this need not be the same as the currently-committed submodule (if the tree is dirty, which should not be the case in CI)
I don't think caching Enzyme is important -- it doesn't take long to build and it'll be changing relatively frequently.
Actually running tests
Our current
cargo +enzyme test --examples
does nothing because it's running in the rustc repo. Rust hasx test
for testing the compiler and we could have some Enzyme tests there. We've also been writing tests in EnzymeAD/rustbook and we could check out that repo to run the tests that are there. Shall we also put ADBench tests in that repository?