SciML / diffeqpy

Solving differential equations in Python using DifferentialEquations.jl and the SciML Scientific Machine Learning organization
MIT License
531 stars 39 forks source link

Precompilation not quite working #134

Closed ma-sadeghi closed 7 months ago

ma-sadeghi commented 8 months ago

Question❓ Every time I load diffeqpy, it starts to precompile Julia dependencies, which takes quite a white (minutes). (I use the Python distributed by conda-forge)

❯ python
Python 3.10.13 | packaged by conda-forge | (main, Dec 23 2023, 15:36:39) [GCC 12.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from diffeqpy import de
  Activating project at `~/.julia/environments/diffeqpy`
Precompiling DifferentialEquations
  4 dependencies successfully precompiled in 164 seconds. 228 already precompiled.
[ Info: Precompiling DifferentialEquations [0c46a032-eb83-5123-abaf-570d42b7fbaa]
Precompiling ModelingToolkit
  1 dependency successfully precompiled in 136 seconds. 226 already precompiled.
[ Info: Precompiling ModelingToolkit [961ee093-0014-501f-94e3-6117800e7a78]
┌ Warning: Module SymbolicsPreallocationToolsExt with build ID ffffffff-ffff-ffff-0000-140927cb0af5 is missing from the cache.
│ This may mean SymbolicsPreallocationToolsExt [d479e226-fb54-5ebe-a75e-a7af7f39127f] does not support precompilation but is imported by a module that does.
└ @ Base loading.jl:1942
┌ Error: Error during loading of extension SymbolicsPreallocationToolsExt of Symbolics, use `Base.retry_load_extensions()` to retry.
│   exception =
│    1-element ExceptionStack:
│    Declaring __precompile__(false) is not allowed in files that are being precompiled.
│    Stacktrace:
│      [1] _require(pkg::Base.PkgId, env::Nothing)
│        @ Base ./loading.jl:1946
│      [2] __require_prelocked(uuidkey::Base.PkgId, env::Nothing)
│        @ Base ./loading.jl:1806
│      [3] #invoke_in_world#3
│        @ Base ./essentials.jl:921 [inlined]
│      [4] invoke_in_world
│        @ Base ./essentials.jl:918 [inlined]
│      [5] _require_prelocked
│        @ Base ./loading.jl:1797 [inlined]
│      [6] _require_prelocked
│        @ Base ./loading.jl:1796 [inlined]
│      [7] run_extension_callbacks(extid::Base.ExtensionId)
│        @ Base ./loading.jl:1289
│      [8] run_extension_callbacks(pkgid::Base.PkgId)
│        @ Base ./loading.jl:1324
│      [9] run_package_callbacks(modkey::Base.PkgId)
│        @ Base ./loading.jl:1158
│     [10] __require_prelocked(uuidkey::Base.PkgId, env::String)
│        @ Base ./loading.jl:1813
│     [11] #invoke_in_world#3
│        @ Base ./essentials.jl:921 [inlined]
│     [12] invoke_in_world
│        @ Base ./essentials.jl:918 [inlined]
│     [13] _require_prelocked(uuidkey::Base.PkgId, env::String)
│        @ Base ./loading.jl:1797
│     [14] macro expansion
│        @ Base ./loading.jl:1784 [inlined]
│     [15] macro expansion
│        @ Base ./lock.jl:267 [inlined]
│     [16] __require(into::Module, mod::Symbol)
│        @ Base ./loading.jl:1747
│     [17] #invoke_in_world#3
│        @ Base ./essentials.jl:921 [inlined]
│     [18] invoke_in_world
│        @ Base ./essentials.jl:918 [inlined]
│     [19] require(into::Module, mod::Symbol)
│        @ Base ./loading.jl:1740
│     [20] include
│        @ Base ./Base.jl:495 [inlined]
│     [21] 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:2216
│     [22] top-level scope
│        @ stdin:3
│     [23] eval
│        @ Core ./boot.jl:385 [inlined]
│     [24] include_string(mapexpr::typeof(identity), mod::Module, code::String, filename::String)
│        @ Base ./loading.jl:2070
│     [25] include_string
│        @ Base ./loading.jl:2080 [inlined]
│     [26] exec_options(opts::Base.JLOptions)
│        @ Base ./client.jl:316
│     [27] _start()
│        @ Base ./client.jl:552
└ @ Base loading.jl:1295

┌ Warning: Module OrdinaryDiffEq with build ID fafbfcfd-a599-5777-0000-13a8a4ed7d50 is missing from the cache.
│ This may mean OrdinaryDiffEq [1dea7af3-3e70-54e6-95c3-0bf5283fa5ed] does not support precompilation but is imported by a module that does.
└ @ Base loading.jl:1942
[ Info: Skipping precompilation since __precompile__(false). Importing ModelingToolkit [961ee093-0014-501f-94e3-6117800e7a78].
Precompiling SparseDiffToolsSymbolicsExt
        Info Given SparseDiffToolsSymbolicsExt was explicitly requested, output will be shown live 
┌ Warning: Module SymbolicsPreallocationToolsExt with build ID ffffffff-ffff-ffff-0000-1415573bf65a is missing from the cache.
│ This may mean SymbolicsPreallocationToolsExt [d479e226-fb54-5ebe-a75e-a7af7f39127f] does not support precompilation but is imported by a module that does.
└ @ Base loading.jl:1942
┌ Error: Error during loading of extension SymbolicsPreallocationToolsExt of Symbolics, use `Base.retry_load_extensions()` to retry.ls → SparseDiffToolsSymbolicsExt
│   exception =
│    1-element ExceptionStack:
│    Declaring __precompile__(false) is not allowed in files that are being precompiled.
│    Stacktrace:
│      [1] _require(pkg::Base.PkgId, env::Nothing)
│        @ Base ./loading.jl:1946
│      [2] __require_prelocked(uuidkey::Base.PkgId, env::Nothing)
│        @ Base ./loading.jl:1806
│      [3] #invoke_in_world#3
│        @ Base ./essentials.jl:921 [inlined]
│      [4] invoke_in_world
│        @ Base ./essentials.jl:918 [inlined]
│      [5] _require_prelocked
│        @ Base ./loading.jl:1797 [inlined]
│      [6] _require_prelocked
│        @ Base ./loading.jl:1796 [inlined]
│      [7] run_extension_callbacks(extid::Base.ExtensionId)
│        @ Base ./loading.jl:1289
│      [8] run_extension_callbacks(pkgid::Base.PkgId)
│        @ Base ./loading.jl:1324
│      [9] run_package_callbacks(modkey::Base.PkgId)
│        @ Base ./loading.jl:1158
│     [10] __require_prelocked(uuidkey::Base.PkgId, env::String)
│        @ Base ./loading.jl:1813
│     [11] #invoke_in_world#3
│        @ Base ./essentials.jl:921 [inlined]
│     [12] invoke_in_world
│        @ Base ./essentials.jl:918 [inlined]
│     [13] _require_prelocked(uuidkey::Base.PkgId, env::String)
│        @ Base ./loading.jl:1797
│     [14] macro expansion
│        @ Base ./loading.jl:1784 [inlined]
│     [15] macro expansion
│        @ Base ./lock.jl:267 [inlined]
│     [16] __require(into::Module, mod::Symbol)
│        @ Base ./loading.jl:1747
│     [17] #invoke_in_world#3
│        @ Base ./essentials.jl:921 [inlined]
│     [18] invoke_in_world
│        @ Base ./essentials.jl:918 [inlined]
│     [19] require(into::Module, mod::Symbol)
│        @ Base ./loading.jl:1740
│     [20] include
│        @ Base ./Base.jl:495 [inlined]
│     [21] 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:2216
│     [22] top-level scope
│        @ stdin:3
│     [23] eval
│        @ Core ./boot.jl:385 [inlined]
│     [24] include_string(mapexpr::typeof(identity), mod::Module, code::String, filename::String)
│        @ Base ./loading.jl:2070
│     [25] include_string
│        @ Base ./loading.jl:2080 [inlined]
│     [26] exec_options(opts::Base.JLOptions)
│        @ Base ./client.jl:316
│     [27] _start()
│        @ Base ./client.jl:552
└ @ Base loading.jl:1295
  1 dependency successfully precompiled in 48 seconds. 159 already precompiled.
  1 dependency had output during precompilation:
┌ SparseDiffTools → SparseDiffToolsSymbolicsExt
│  [Output was shown above]
└  
[ Info: Precompiling SparseDiffToolsSymbolicsExt [cd430d6f-1330-5ba3-8763-ae950e38ad4f]
┌ Warning: Module Symbolics with build ID fafbfcfd-9b42-3027-0000-140561181267 is missing from the cache.
│ This may mean Symbolics [0c5d862f-8b57-4792-8d23-62f2024744c7] does not support precompilation but is imported by a module that does.
└ @ Base loading.jl:1942
[ Info: Skipping precompilation since __precompile__(false). Importing SparseDiffToolsSymbolicsExt [cd430d6f-1330-5ba3-8763-ae950e38ad4f].
Precompiling NonlinearSolveSymbolicsExt
  1 dependency successfully precompiled in 7 seconds. 201 already precompiled.
[ Info: Precompiling NonlinearSolveSymbolicsExt [45535edf-8919-5fe0-85bd-21cd5b69538c]
┌ Warning: Module Symbolics with build ID fafbfcfd-9b42-3027-0000-140561181267 is missing from the cache.
│ This may mean Symbolics [0c5d862f-8b57-4792-8d23-62f2024744c7] does not support precompilation but is imported by a module that does.
└ @ Base loading.jl:1942
[ Info: Skipping precompilation since __precompile__(false). Importing NonlinearSolveSymbolicsExt [45535edf-8919-5fe0-85bd-21cd5b69538c].
[ Info: Precompiling SymbolicsPreallocationToolsExt [d479e226-fb54-5ebe-a75e-a7af7f39127f]
┌ Warning: Module Symbolics with build ID fafbfcfd-9b42-3027-0000-140561181267 is missing from the cache.
│ This may mean Symbolics [0c5d862f-8b57-4792-8d23-62f2024744c7] does not support precompilation but is imported by a module that does.
└ @ Base loading.jl:1942
[ Info: Skipping precompilation since __precompile__(false). Importing SymbolicsPreallocationToolsExt [d479e226-fb54-5ebe-a75e-a7af7f39127f].
[ Info: Precompiling SymbolicsForwardDiffExt [4a213a23-c09c-5cde-9712-b631ad2c72df]
┌ Warning: Module Symbolics with build ID fafbfcfd-9b42-3027-0000-140561181267 is missing from the cache.
│ This may mean Symbolics [0c5d862f-8b57-4792-8d23-62f2024744c7] does not support precompilation but is imported by a module that does.
└ @ Base loading.jl:1942
[ Info: Skipping precompilation since __precompile__(false). Importing SymbolicsForwardDiffExt [4a213a23-c09c-5cde-9712-b631ad2c72df].
ChrisRackauckas commented 7 months ago

There's a Julia bug in v1.10 that's causing it to show that but usage isn't actually effected.

ma-sadeghi commented 7 months ago

I see. By usage, you mean importing diffeqpy should be quick right? Mine still takes minutes