This is an archive of the discontinued LLVM Phabricator instance.

Avoid building the entire tree and testing LLVM itself on MLIR builders
ClosedPublic

Authored by mehdi_amini on Sep 21 2021, 10:24 AM.

Details

Summary

This reduces the amount of targets to build and tests. The build gets faster (see below) but
the main motivation right now is to not get notified by an mlir-* bot when there is a failure
in a LLVM test (there are enough other bots to cover these).

Build time gain is hard to evaluate because it is highly dependent on the machine.
Below are the results on my Linux machine (with the same cmake config as the
win-mlir-buildbot, so no python tests):

$ time ninja check-mlir -j 16
894.323 [0/1/2803] Running the MLIR regression tests

Testing Time: 98.80s
  Unsupported      : 163
  Passed           : 927
  Expectedly Failed:   1

real	16m41.103s
user	188m17.260s
sys	23m22.081s

After that, adding ninja -j 16 results in an added:

$ time ninja -j 16
441.094 [0/1/767] Linking CXX executable bin/SpeculativeJIT

real	7m21.771s
user	86m25.291s
sys	15m5.505s

So it is ~1/3 of the build time that we're saving here.

Diff Detail

Event Timeline

mehdi_amini created this revision.Sep 21 2021, 10:24 AM
mehdi_amini requested review of this revision.Sep 21 2021, 10:24 AM
stella.stamenova added a comment.EditedSep 21 2021, 10:35 AM

LGTM.

How much of a difference does it make in terms of build times?

One thing, though, does the combination of mlir-opt and check-mlir cover all targets in mlir?

jpienaar accepted this revision.Sep 21 2021, 11:57 AM

Nice thanks! Good with Stella's comments addressed

This revision is now accepted and ready to land.Sep 21 2021, 11:57 AM

One thing, though, does the combination of mlir-opt and check-mlir cover all targets in mlir?

I would hope that we don't have untested targets in MLIR! :)
Right now I verified and it is the case already. I'd see it as a bug if we do, but unfortunately I'm not sure how to guarantee it 100%? I guess if we haven't introduced untested target in the last 2 years, we should be reasonably OK!

How much of a difference does it make in terms of build times?

It's hard to say because it is highly dependent on the machine.
I tried time ninja -j 16 check-mlir on my Linux machine (with the same cmake config as the win-mlir-buildbot, so no python tests):

894.323 [0/1/2803] Running the MLIR regression tests

Testing Time: 98.80s
  Unsupported      : 163
  Passed           : 927
  Expectedly Failed:   1

real	16m41.103s
user	188m17.260s
sys	23m22.081s

Running time ninja -j 16 results in an added:

$ time ninja -j 16
441.094 [0/1/767] Linking CXX executable bin/SpeculativeJIT

real	7m21.771s
user	86m25.291s
sys	15m5.505s

(Note also that my main motivation for this patch right now was to not get an email notification from an mlir-* bot on a failure in a LLVM tests)

mehdi_amini edited the summary of this revision. (Show Details)Sep 21 2021, 5:52 PM
mehdi_amini added a reviewer: zacharyselk.

+ @zacharyselk who added the ppc64le-mlir-rhel-clang-build config to see if there is any concern here.
(side note: have you considered enabling ccache on this config as well?)