This is an archive of the discontinued LLVM Phabricator instance.

[Zorg] Use ccache instead incremental build for openmp-offload-cuda-runtime.
ClosedPublic

Authored by Meinersbur on Jul 25 2021, 9:20 PM.

Details

Summary

Building with LLVM_ENABLE_RUNTIMES=openmp has the disadvantage that if clang changes, the runtime that was built with the previous clang is not rebuilt. That is, if the runtime is miscompiling due to a change in clang, this will only be detected in the next clean build.

For instance, commit rG1100e4aafea233bc8bbc307c5758a7d287ad3bae caused the libomptarget device runtime to miscompile, but the openmp-offload-cuda-runtime builder shows it as green. Tests only started failing with the next clean build. In production, this would have blamed the wrong commit.

In contrast, the openmp-offload-cuda-project builder started failing with the expected commit.

Instead of building incrementally, use ccache to avoid this problem.

Diff Detail

Event Timeline

Meinersbur created this revision.Jul 25 2021, 9:20 PM
Meinersbur requested review of this revision.Jul 25 2021, 9:20 PM
tianshilei1992 accepted this revision.Jul 26 2021, 12:46 PM

Given the fact it's not heavy to build OpenMP, I think a clean build every time should be fine. LGTM but better to ask BB owner to take a look.

Speaking of this, is it possible to integrate the result into Phabricator?

This revision is now accepted and ready to land.Jul 26 2021, 12:46 PM

we will desire the same behavior for looming amdgpu buildbot, and we are closely following the cuda openmp buildbot.

Given the fact it's not heavy to build OpenMP, I think a clean build every time should be fine.

ccache hashes the compiler executable. That is, if it turns out to be the same binary, it will re-use the cached result even for the deviceRTL.

LGTM but better to ask BB owner to take a look.

That would be me.

Speaking of this, is it possible to integrate the result into Phabricator?

The pre-merge buildkite already uses clean builds with ccache (or sccache). For small changes the incremental build typically is still by some factors faster than the ccache builds which is why I would prefer to keep incremental builds for openmp-offload-cuda-project. This also allows us to better identify problems that occur only in one of the builds (such as incorrect builds dependences) and still get frequent rebuilds.

This is a general problem buildbots using LLVM_ENABLE_RUNTIMES builds and might be fixed some day by e.g. clobbering the runtimes build dir after clang had to be recompiled.

Speaking of this, is it possible to integrate the result into Phabricator?

The pre-merge buildkite already uses clean builds with ccache (or sccache). For small changes the incremental build typically is still by some factors faster than the ccache builds which is why I would prefer to keep incremental builds for openmp-offload-cuda-project. This also allows us to better identify problems that occur only in one of the builds (such as incorrect builds dependences) and still get frequent rebuilds.

This is a general problem buildbots using LLVM_ENABLE_RUNTIMES builds and might be fixed some day by e.g. clobbering the runtimes build dir after clang had to be recompiled.

I mean, not about this patch. To integrate the execution result on GPUs into Phabricator. Currently we don't have test run on GPUs I think.

I mean, not about this patch. To integrate the execution result on GPUs into Phabricator. Currently we don't have test run on GPUs I think.

You can request it at https://github.com/google/llvm-premerge-checks/issues, but it will at most be possible with host offloading (I assume the BuildKite bots don't have GPUs) and only once they pass reliably.