-
Notifications
You must be signed in to change notification settings - Fork 65
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
Avoiding Repeated Function Compilation. #1046
Comments
On Tue, Apr 18, 2023 at 01:57:44AM -0700, hongyi-zhao wrote:
Of course, I know, this is not just a problem related to this package. But I really noticed the following example, which needs so much time each time when I re-start julia to the same testing:
If you don't chage Hecke, you can try:
using Hecke
Hecke.build()
(this will run some minutes)
and then start Julia with -J /tmp/Hecke.so
you will still have to do using Hecke (but won't see a banner)
Then the test should be there immediately...
Greetings
Claus
… ```julia
***@***.***:~/Downloads/julia-1.9.0-rc2-linux-x86_64/julia-1.9.0-rc2/bin$ ./julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.9.0-rc2 (2023-04-01)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> using Hecke
Welcome to
_ _ _
| | | | | |
| |__| | ___ ___| | _____
| __ |/ _ \/ __| |/ / _ \
| | | | __/ (__| < __/
|_| |_|\___|\___|_|\_\___|
Version 0.18.9 ...
... which comes with absolutely no warranty whatsoever
(c) 2015-2023 by Claus Fieker, Tommy Hofmann and Carlo Sircana
julia> A = [
0 1 0 0 0 0 0 0 0 0 0 0 0 0;
0 0 1 0 0 0 0 0 0 0 0 0 0 0;
0 0 0 1 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 1 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 1 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 1 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 1 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 1 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 1 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 1 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 1 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 1 0;
0 0 0 0 0 0 0 0 0 0 0 0 0 1;
-2 -2 -2 -2 -1 -1 -1 -1 0 0 -2 0 0 0
]
14×14 Matrix{Int64}:
0 1 0 0 0 0 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0 0 0 0 0
0 0 0 0 0 0 1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 0 0 0 0 0 0 1
-2 -2 -2 -2 -1 -1 -1 -1 0 0 -2 0 0 0
julia> B = [
-21 -11 12 9 15 8 -22 -23 2 6 8 -2 2 -8;
32 17 -22 -10 -18 -14 28 35 -5 -6 -13 4 -1 13;
1 4 -17 6 11 -12 -6 18 -16 8 -7 7 4 9;
21 13 -24 -11 -19 -21 33 48 -15 -4 -15 7 -1 18;
14 8 -16 -2 -2 -11 10 23 -9 0 -9 5 0 9;
-1 8 -14 -3 13 -9 -2 21 -18 6 -7 8 0 9;
29 14 -13 -15 -27 -10 36 31 1 -11 -10 1 -4 10;
-26 -8 -8 10 21 -12 -16 14 -25 14 -3 9 5 8;
-8 -6 -1 -9 -31 -14 34 31 -8 -7 -4 1 -2 10;
-19 -8 11 -15 -39 -8 38 24 -4 -9 2 -2 -3 7;
-35 -25 30 3 -11 11 -2 -27 14 -4 14 -9 -2 -13;
-19 -21 32 -6 -34 11 21 -21 23 -14 13 -13 -5 -12;
10 5 3 11 31 16 -36 -36 11 7 5 -2 3 -12;
12 7 -7 -13 -27 -7 30 24 2 -11 -5 -1 -5 6
];
julia> is_GLZ_conjugate(matrix(ZZ,A), matrix(ZZ,B))
[...]
```
So, I wonder whether there is a way to avoid repeated function compilation, especially for those time-consuming ones.
Regards,
Zhao
--
Reply to this email directly or view it on GitHub:
#1046
You are receiving this because you are subscribed to this thread.
Message ID: ***@***.***>
|
@fieker Thank you for your tips and it works. But what should I do if I want several or all packages to work in this way? |
On Wed, Apr 19, 2023 at 05:42:16AM -0700, hongyi-zhao wrote:
@fieker Thank you for your tips and it works. But what should I do if I want several or all packages to work in this way?
- not all will work, there are julia problems in some
- put it into Hecke/system/precompile.jl
- hope
…
--
Reply to this email directly or view it on GitHub:
#1046 (comment)
You are receiving this because you were mentioned.
Message ID: ***@***.***>
|
One could use https://julialang.github.io/PackageCompiler.jl/stable/sysimages.html to do it for as many packages one wants. There is not much we can do on our part. |
There are currently some code snippets in this file, but they seem to have nothing to do with the issues discussed here. More specifically, the default content in this file seems to be intended for the purpose of completing some tests. |
So, the question becomes this:
|
As far as I understand this at this point the answer is: you'll have to produce a single image containing all packages you're interested in. Reason: loading a second package can easily force a change in the bahviour of an older package (think itroducing a special case for a generic function e.g.) thus the sysimage can only be done this way. Julia is, I think, working on allowing a more incremental approach, but for now, my very limited understanding implies
|
Of course, I know, this is not just a problem related to this package. But I really noticed the following example, which needs so much time each time when I re-start Julia to do the same testing:
So, I wonder whether there is a way to avoid repeated function compilation, especially for those time-consuming ones.
Regards,
Zhao
The text was updated successfully, but these errors were encountered: