Halide Generator times out

49 Views Asked by At

I have a Ahead-of-Time Halide project that takes a long time to build. It frequently takes 10+ minutes to build a 500 line project. Sometimes it exceeds the 900 second timeout limit. Is this normal? It often takes longest during the step:

[7/13] Linking CXX static library edge_aware.runtime.lib It says: Timed out waiting for Generator to complete (900 seconds)!

Why would linking be taking this long? I just see lots of CPU usage during the long stalls, not much ssd activity.

1

There are 1 best solutions below

1
Andrew Adams On

That most often happens if the Halide schedule specifies something that would generate a huge amount of code. E.g. unrolling a loop with a large constant extent, or inlining lots of stuff. You can tell if this is the case if the generated static library is very large (>1MB). Try judiciously sprinkling more compute_ats into your schedule.

In rarer cases, it's a performance bug either in a Halide pass, or in LLVM itself.

If it's the latter case, post a repro on https://github.com/halide/halide/issues and I'll take a look.