-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compiler hang in julia 1.7 on Gridap tutorial #42236
Comments
Update: I can reproduce it in Julia To reproduce, do I get
at which point it hangs. (It's been running for 20 minutes so far.) (The "Error" messages are from gmsh, and it seems they should actually be warnings since it succeeds in reading the mesh.) Killing the process seems to confirm that it has hung in compilation:
|
@fverdugo and @WenjieYao, it's taking an awfully long time to run this on Julia 1.6 for me — can you check for which version of Julia this script was working? |
@stevengj I have not run it locally (as far as I can remember), but it seems to take a long time also in the CI: |
If it is something with type intersection it should repro even with a smaller mesh, so maybe try that and get the 1.6 time into something reasonable. |
The mesh is small enough that the actual solver should take seconds, no? I think most of the time is compilation even on 1.6. |
I didn't look at the mesh size, I just assumed that the problem didn't take 20 minutes to compile on 1.6. |
@stevengj My julia version is just 1.6.0. I think one reason that it takes long is the analytical solution. For each element it requires (40+40+1=) 81 summation of the bessel/hankel functions. That is indeed the most time consuming part when I run the code in a jupyter notebook. However, when I run the code from command line with `julia --emscatter.jl‘, it takes awfully long compared to the jupyter noteook.... |
(We can just comment out the analytical part for checking the compiler.) |
In particular, you can execute this line instead of @time include_string(Main, join(first(eachline("../src/emscatter.jl"), 188), '\n')) It takes about 78 seconds on my machine with Julia 1.6.2:
|
On my side, I have launched a run (full tutorial) with a mesh with 10x larger element size: https://github.com/gridap/Tutorials/runs/3589643700?check_suite_focus=true#step:6:47 The tutorial runs in 60 secs in Julia 1.6 with the coarse mesh. |
The same include_string(Main, join(first(eachline("../src/emscatter.jl"), 188), '\n')) indeed hangs in 1.7.0-beta4 — it's been running on my machine for an hour now. I think the original mesh is fine (runs in about a minute) if you use the truncated tutorial file as I've done here. |
Is it hanging or just taking a very long time? Can you take a profile? |
It has been running for over Do you mean gcc-based profiling, i.e. compiling Julia with |
In a debug build there is also:
but probably a separate issue? |
Looks like these arguments to subtype are taking an extremely long time:
|
The "good news" is that that subtype query takes forever in 1.6 as well; the change seems to be that inlining is now trying to union those types, which didn't occur in 1.6. |
Hi @JeffBezanson, one of our users was able to find a MWE gridap/Gridap.jl#657 (here the code crashes with an internal error instead of hanging) I have been able to reproduce the crash in my machine. |
Are you sure that is the same issue? Also, out of curiosity, why are you generating such huge types as shown in #42236 (comment). It is always possible to generate big enough types that the type system can't handle it and it seems you are on the border now. |
As I understand it, the types essentially represent the AST of a symbolic expression for the weak form of a PDE — this is represented in the type domain for performance, to force the compiler to specialize finite-element assembly code that is generated from this AST. |
Yes, in Gridap we build some complex and large types and this is the main reason. In any case, we build complex types by nesting structs and the number of type params in each of those structs is usually less than 4. I am not aware of any part of the code that would lead to a tuple of 31 entries in this tutorial (see the Tuple{E,E,E,...,E} above), but I can be wrong of course... |
So the 32-element tuple comes from changing |
This definitely looks like a separate issue; could you file one? |
Sure! #42264 |
See the following issue in Gridap.jl — one of the tutorials that worked in Julia 1.6 now causes the compiler to hang in 1.7-beta4
gridap/Tutorials#118
cc @fverdugo
The text was updated successfully, but these errors were encountered: