You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TTFX allocation and time blowup with Automa 1.2.0, PythonCall and GLMakie #147
(debugAutoma) pkg> st
Status `/tmp/debugAutoma/Project.toml`
⌃ [67c07d97] Automa v1.1.0 ⚲
[e9467ef8] GLMakie v0.13.12
[6099a3de] PythonCall v0.9.35
Info Packages marked with ⌃ have new versions available and may be upgradable.
VERSION = v"1.12.6"
7.344142 seconds (5.16 M allocations: 318.104 MiB, 13.62% gc time, 32.17% compilation time: 25% of which was recompilation)
5.022463 seconds (5.57 M allocations: 276.834 MiB, 13.13% gc time, 93.77% compilation time: 53% of which was recompilation)
Automa 1.2.0
7.082217 seconds (5.05 M allocations: 308.689 MiB, 13.61% gc time, 33.34% compilation time: 25% of which was recompilation)
23.471874 seconds (40.89 M allocations: 1.951 GiB, 6.36% gc time, 98.57% compilation time: 59% of which was recompilation)
Some cursory investigation with SnoopCompile indicates that this is a problem in dependents of Automa, not in Automa itself:
None of the inference time is spent in Automa methods or MathTexEngine methods (the only direct dep of Automa in that environment)
Simply adding using SIMD to Automa fixes the regression, indicating this is an invalidation issue
Invalidations are rampant with 4000+ invalidations. None of these are in Automa.
The probable cause is that loading SIMD invalidates some code, which is then repaired during precompilation of some dependents of Automa. Without the loading of SIMD in Automa, SIMD is loaded later in the pipeline, which then causes widespread invalidation.
The proximal sinner are the invalidated code, which needs to be written to be type stable. With 4000+ methods, that might be a bit of an issue.
The true, underlying cause is in the design of Julia, which is built in such a way that small, innocent changes can completely trash compilation time. Specifically in this case, speculative compilation through the world splitting mechanism.
I'm closing this, as this is not an issue with Automa. Good luck hunting the invalidations down in the rest of the stack.
Please let me know, and re-open this issue, if you think there is something wrong with my analysis.
This is not about SIMD.jl. If I kick out TiffImages.jl from ImageIO.jl, SIMD.jl is not in the project, but excessive allocations remain with Automa.jl 1.2.0.
(debugAutoma) pkg> st
Status `/tmp/debugAutoma/Project.toml`
[67c07d97] Automa v1.2.0
[e9467ef8] GLMakie v0.13.12
[82e4d734] ImageIO v0.6.9 `~/.julia/dev/ImageIO`
[6099a3de] PythonCall v0.9.35
(debugAutoma) pkg> why SIMD
ERROR: The following package names could not be resolved:
* SIMD (not found in project or manifest)
VERSION = v"1.12.6"
7.097936 seconds (5.04 M allocations: 308.530 MiB, 13.69% gc time, 33.28% compilation time: 25% of which was recompilation)
22.896431 seconds (40.89 M allocations: 1.951 GiB, 4.12% gc time, 98.51% compilation time: 61% of which was recompilation)
It must be about loading SIMD, because modifying Automa 1.2.0 to load SIMD fixes the issue.
Probably the cause is the invalidations caused by PyCall adding new methods for comparison operations. At least these invalidations show op prominently in the invalidations list, but the list is huge, so it’s hard to tell. SIMD also adds these methods.
Activity
jakobnissen commentedon Jul 1, 2026
Some cursory investigation with SnoopCompile indicates that this is a problem in dependents of Automa, not in Automa itself:
using SIMDto Automa fixes the regression, indicating this is an invalidation issueThe probable cause is that loading SIMD invalidates some code, which is then repaired during precompilation of some dependents of Automa. Without the loading of SIMD in Automa, SIMD is loaded later in the pipeline, which then causes widespread invalidation.
The proximal sinner are the invalidated code, which needs to be written to be type stable. With 4000+ methods, that might be a bit of an issue.
The true, underlying cause is in the design of Julia, which is built in such a way that small, innocent changes can completely trash compilation time. Specifically in this case, speculative compilation through the world splitting mechanism.
I'm closing this, as this is not an issue with Automa. Good luck hunting the invalidations down in the rest of the stack.
Please let me know, and re-open this issue, if you think there is something wrong with my analysis.
jaakkor2 commentedon Jul 2, 2026
This is not about SIMD.jl. If I kick out TiffImages.jl from ImageIO.jl, SIMD.jl is not in the project, but excessive allocations remain with Automa.jl 1.2.0.
I do not have permissions to reopen this issue.
jakobnissen commentedon Jul 2, 2026
It must be about loading SIMD, because modifying Automa 1.2.0 to load SIMD fixes the issue.
Probably the cause is the invalidations caused by PyCall adding new methods for comparison operations. At least these invalidations show op prominently in the invalidations list, but the list is huge, so it’s hard to tell. SIMD also adds these methods.
jaakkor2 commentedon Jul 2, 2026
WIll be fixed by JuliaLang/julia#61880, tested with
julia +pr62003VERSION = v"1.12.7-DEV.37"