PythonPlot + PackageCompiler + IJulia: kernel does not start (IJulia not precompiling)
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 25/100
Piste de recherche
Commencez par build.jl, compile_me.jl et add_ipython_kernel.jl, puis reproduisez le démarrage du kernel IJulia avec la mysys.dll générée et l’environnement Windows indiqué. Analysez l’échec de précompilation d’IJulia et l’OutOfMemoryError ; l’achèvement n’est pas défini, car le rapport ne précise ni correction ni test attendu.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
I want a faster startup time and time-to-first-plot when opening or restarting a notebook.
(Currently about 30 15 seconds total; compared to about 3.2 seconds TTFP with a Python notebook).[^1],[^2]
[^1]: not all of this time is due to PythonCall and PythonPlot: about 10 seconds is IJulia startup itself: https://github.com/JuliaLang/IJulia.jl/issues/1090
[^2]: after upgrading to julia 1.9.3, from 1.9.0-beta3, I saw an impressive decrease in TTFP, from 30 s, to 15 seconds. :D. About 8.6 seconds is due to IJulia startup still. Which leaves 7.0 seconds for PythonCall & PythonPlot load and startup, and plot display.
Putting PythonPlot in a system image with PackageCompiler.jl works, and reduces loading and plotting time amazingly, in the terminal.
But when trying to use an IJulia kernel with that sysimg, the kernel does not start.
Error in jupyter terminal:
[I 14:32:27.364 NotebookApp] Kernel started: 31647825-a827-4c36-86f6-f715ba470675, name: julia-mysys-1.9
[ Info: Precompiling IJulia [7073ff75-c697-5162-941a-fcdaad2a7d2a]
ERROR: LoadError: OutOfMemoryError()
Stacktrace:
[1] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
@ Base .\loading.jl:1001
[2] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
@ Base .\loading.jl:1413
[3] _require(pkg::Base.PkgId, env::String)
@ Base .\loading.jl:1690
[4] _require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base .\loading.jl:1567
[5] macro expansion
@ .\loading.jl:1555 [inlined]
[6] macro expansion
@ .\lock.jl:267 [inlined]
[7] require(into::Module, mod::Symbol)
@ Base .\loading.jl:1518
[8] include
@ .\Base.jl:456 [inlined]
[9] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::String)
@ Base .\loading.jl:1952
[10] top-level scope
@ stdin:2
in expression starting at C:\Users\tfiers\.julia\packages\IJulia\6TIq1\src\IJulia.jl:1
in expression starting at stdin:2
ERROR: LoadError: Failed to precompile IJulia [7073ff75-c697-5162-941a-fcdaad2a7d2a] to "C:\\Users\\tfiers\\.julia\\compiled\\v1.9\\IJulia\\jl_19EC.tmp".
Stacktrace:
[1] error(s::String)
@ Base .\error.jl:35
[2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
@ Base .\loading.jl:2195
[3] compilecache
@ .\loading.jl:2068 [inlined]
[4] _require(pkg::Base.PkgId, env::String)
@ Base .\loading.jl:1712
[5] _require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base .\loading.jl:1567
[6] macro expansion
@ .\loading.jl:1555 [inlined]
[7] macro expansion
@ .\lock.jl:267 [inlined]
[8] require(into::Module, mod::Symbol)
@ Base .\loading.jl:1518
in expression starting at C:\Users\tfiers\.julia\packages\IJulia\6TIq1\src\kernel.jl:1
[I 14:32:45.348 NotebookApp] KernelRestarter: restarting kernel (1/5), keep random ports
[ Info: Precompiling IJulia [7073ff75-c697-5162-941a-fcdaad2a7d2a]
Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x7ffedc8a89ae -- jl_table_assign_bp at C:/workdir/src\iddict.c:48
in expression starting at C:\Users\tfiers\.julia\packages\IJulia\6TIq1\src\IJulia.jl:36
jl_table_assign_bp at C:/workdir/src\iddict.c:48
ijl_idtable_rehash at C:/workdir/src\iddict.c:24
jl_restore_system_image_from_stream_ at C:/workdir/src\staticdata.c:3165
jl_restore_package_image_from_stream at C:/workdir/src\staticdata.c:3314
jl_restore_incremental_from_buf at C:/workdir/src\staticdata.c:3360 [inlined]
ijl_restore_package_image_from_file at C:/workdir/src\staticdata.c:3473
_include_from_serialized at .\loading.jl:1001
jfptr__include_from_serialized_26122 at C:\Users\tfiers\phd\sysimg\mysys.dll (unknown line)
tojlinvoke79009 at C:\Users\tfiers\phd\sysimg\mysys.dll (unknown line)
j__include_from_serialized_25818 at C:\Users\tfiers\phd\sysimg\mysys.dll (unknown line)
_require_search_from_serialized at .\loading.jl:1413
_require at .\loading.jl:1690
_require_prelocked at .\loading.jl:1567
jfptr__require_prelocked_45234 at C:\Users\tfiers\phd\sysimg\mysys.dll (unknown line)
tojlinvoke79134 at C:\Users\tfiers\phd\sysimg\mysys.dll (unknown line)
j__require_prelocked_25262 at C:\Users\tfiers\phd\sysimg\mysys.dll (unknown line)
macro expansion at .\loading.jl:1555 [inlined]
macro expansion at .\lock.jl:267 [inlined]
require at .\loading.jl:1518
jfptr_require_25249 at C:\Users\tfiers\phd\sysimg\mysys.dll (unknown line)
jl_apply at C:/workdir/src\julia.h:1874 [inlined]
call_require at C:/workdir/src\toplevel.c:466 [inlined]
eval_import_path at C:/workdir/src\toplevel.c:503
jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:731
jl_eval_module_expr at C:/workdir/src\toplevel.c:203 [inlined]
jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:715
jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:856
jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:856
ijl_toplevel_eval at C:/workdir/src\toplevel.c:921 [inlined]
ijl_toplevel_eval_in at C:/workdir/src\toplevel.c:971
eval at .\boot.jl:370 [inlined]
include_string at .\loading.jl:1806
_include at .\loading.jl:1866
tojlinvoke77691 at C:\Users\tfiers\phd\sysimg\mysys.dll (unknown line)
include at .\Base.jl:456 [inlined]
include_package_for_output at .\loading.jl:1952
jfptr_include_package_for_output_34600 at C:\Users\tfiers\phd\sysimg\mysys.dll (unknown line)
jl_apply at C:/workdir/src\julia.h:1874 [inlined]
do_call at C:/workdir/src\interpreter.c:126
eval_value at C:/workdir/src\interpreter.c:226
eval_stmt_value at C:/workdir/src\interpreter.c:177 [inlined]
eval_body at C:/workdir/src\interpreter.c:624
jl_interpret_toplevel_thunk at C:/workdir/src\interpreter.c:762
jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:912
jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:856
ijl_toplevel_eval at C:/workdir/src\toplevel.c:921 [inlined]
ijl_toplevel_eval_in at C:/workdir/src\toplevel.c:971
eval at .\boot.jl:370 [inlined]
include_string at .\loading.jl:1806
tojlinvoke76665 at C:\Users\tfiers\phd\sysimg\mysys.dll (unknown line)
include_string at .\loading.jl:1816 [inlined]
exec_options at .\client.jl:305
jfptr_exec_options_46043 at C:\Users\tfiers\phd\sysimg\mysys.dll (unknown line)
tojlinvoke77001 at C:\Users\tfiers\phd\sysimg\mysys.dll (unknown line)
j_exec_options_42205 at C:\Users\tfiers\phd\sysimg\mysys.dll (unknown line)
_start at .\client.jl:522
jfptr__start_42203 at C:\Users\tfiers\phd\sysimg\mysys.dll (unknown line)
jl_apply at C:/workdir/src\julia.h:1874 [inlined]
true_main at C:/workdir/src\jlapi.c:573
jl_repl_entrypoint at C:/workdir/src\jlapi.c:717
mainCRTStartup at C:/workdir/cli\loader_exe.c:59
BaseThreadInitThunk at C:\WINDOWS\System32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
Allocations: 3674 (Pool: 3657; Big: 17); GC: 0
Not expecting this to work or be worked on, just noting it down here.
versioninfo():
Julia Version 1.9.0-beta3
Commit 24204a7344 (2023-01-18 07:20 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: 8 × Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-14.0.6 (ORCJIT, skylake)
Threads: 7 on 8 virtual cores
Environment:
JULIA_EDITOR = code.cmd
JULIA_NUM_THREADS = 7
JULIA_PYTHONCALL_EXE = C:\Users\tfiers\mambaforge\python
Package compilation & kernel install scripts:
build.jl:
using PackageCompiler
create_sysimage(
["PythonPlot"],
sysimage_path = "mysys.dll",
precompile_execution_file = "compile_me.jl",
# Note: not `script`.`
)
compile_me.jl:
using PythonPlot
pygui(false)
fig, ax = pyplot.subplots()
plot([1,2,1])
PythonPlot.display_figs()
# Might have to call PythonPlot.__init__() in nb
add_ipython_kernel.jl:
using IJulia
path = abspath(joinpath(@__DIR__, "mysys.dll"))
IJulia.installkernel(
"Julia-mysys",
"--project=@.",
"--sysimage=$path",
)
- Langage dominant
- Julia
- Étoiles
- 85
- Forks
- 9
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de JuliaPy/PythonPlot.jl
-
Difficulté 4/5 3-5 jours Accessibilité débutants 38/100
JuliaPy/PythonPlot.jl#55 · 3 commentaires ·
-
plots with missing and NaN dataOuverte
Difficulté 3/5 1-2 jours Accessibilité débutants 45/100
JuliaPy/PythonPlot.jl#54 ·
-
close(fig) broken for `subplots`Ouverte
Difficulté 3/5 1-2 jours Accessibilité débutants 45/100
JuliaPy/PythonPlot.jl#53 ·
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 35/100
JuliaPy/PythonPlot.jl#52 · 2 réactions ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 20/100
JuliaPy/PythonPlot.jl#51 ·
Toutes les issues de JuliaPy/PythonPlot.jl
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
oxfordcontrol/COSMO.jl#211 ·
-
documentation
Difficulté 2/5 Une demi-journée Accessibilité débutants 65/100
Les mainteneurs répondent en général sous 6 jours
-
Out-of-place JLArray/GPU problem with VectorContinuousCallback scalar-indexes (callback cache built with CPU zeros)Peut-être pris @ChrisRackauckas-Claude l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
SciML/OrdinaryDiffEq.jl#4813 ·
Les mainteneurs répondent en général sous 1 jour
-
ARKODE: callbacks that modify `u` throw MethodError on reinitPeut-être pris @devmotion l’a pris il y a 1 jour. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 79/100
SciML/Sundials.jl#575 ·
-
broken links in docsOuverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour