-
Notifications
You must be signed in to change notification settings - Fork 0
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
FUSE and Julia 1.9 #252
Comments
I will try to give a few definitions and explanations that may help explain why the timing numbers seem to be varying. There are a few main improvements in 1.9 that influence all three stages of precompilation, loading, and first-run-latency. Precompilation: This is the time it takes for Loading: This is the time it takes to do e.g. First-run-latency: This is the time taken for the first call to e.g. There are some tools to make generating @precompile_setup begin
@precompile_all_calls begin
FUSE.warmup()
end
end Now, of course on Julia 1.9 the precompilation stage will be doing more work to cache the native code. As discussed, there are a few workflows you can explore. Default: No Pkgimages: Selective filtering: using Preferences
using SnoopPrecompile
pkg_names = map(p -> p.name, values(Pkg.dependencies()))
@info "Environment includes $(length(pkg_names)) packages"
@info "Minimizing precompilation traces with `skip_precompile`"
delete_preferences!(SnoopPrecompile, "skip_precompile", force=true)
set_preferences!(SnoopPrecompile, "skip_precompile" => pkg_names) |
Thank you @sjkelly ! This is very helpful! Have you tried to use Can you comment about the default approach plays with |
This is a simple test of the native code-caching functionality in Julia 1.9. This should greatly improve runtime, at the expense of greater precompilation time and slightly greater package load time: With this PR, the runtime on Julia 1.9: ``` julia> @time using FUSE 21.957530 seconds (53.10 M allocations: 3.644 GiB, 8.49% gc time, 7.02% compilation time: 13% of which was recompilation) julia> @time FUSE.warmup() 43.951729 seconds (501.41 M allocations: 29.219 GiB, 8.02% gc time, 6.47% compilation time) ``` Whereas master: ``` julia> @time using FUSE 15.015840 seconds (42.16 M allocations: 2.971 GiB, 8.52% gc time, 10.46% compilation time: 13% of which was recompilation) julia> @time FUSE.warmup() 373.581675 seconds (796.96 M allocations: 46.873 GiB, 5.31% gc time, 87.77% compilation time: <1% of which was recompilation) ``` xref: #252 xref: #218
There is a sample timing here: #259 The Revise workflows should not be affected at all, and it will work as it normally does. |
Ok, I think I am starting to get a sense for how this works. Precompilation is nice BUT to really take advantage of it one must absolutely not change anything in the codebase. Once things get pre-compiled, any changes to the source will trigger a whole new pre-compilation (this time burdened by our warmup, which will make precompile very slow). I now understand why you were saying this is fantastic for deployments and production settings, but not really too useful for development. I can see that for development purposes we may want to precompile everything that is not under ProjectTorreyPines. I'll give it a try. Question for @sjkelly and @ChrisRackauckas: Is there a way to generate a |
This is also an incentive to break actors in separate packages for development.
|
Yes, this is correct. So in this case you would want maybe a [SnoopPrecompile]
skip_precompile = ["CHEASE", "CoordinateConventions", "EPEDNN", "FUSE", "FiniteElementHermite", "Fortran90Namelists", "FusionMaterials", "IMAS", "IMASDD", "MXHEquilibrium", "MeshTools", "MillerExtendedHarmonic", "NNeutronics", "QED", "SimulationParameters", "TAUENN", "TEQUILA", "TGLFNN", "VacuumFields"]
So all the GA repos will opt out of precompilation, but you still retain the benefits in dependencies.
This is currently not possible, though I imagine this would be something great to have in the long term. I will bring this idea up with the compiler folks and see what they have to say. |
|
I have tried 1.9 (since this issue appears now to be solved JuliaLang/julia#48473) and things seems to import faster (10s Vs 40s). That said, 1.9 seems to be a slower at compiling (420 first run, 60 later runs) Vs (230s first run, 55s later runs) of 1.8.
@sjkelly may ask you to investigate this further?
The text was updated successfully, but these errors were encountered: