Skip to content
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

Problem with Lux & SymbolicsLuxExt #1132

Closed
B-LIE opened this issue Dec 12, 2024 · 8 comments
Closed

Problem with Lux & SymbolicsLuxExt #1132

B-LIE opened this issue Dec 12, 2024 · 8 comments

Comments

@B-LIE
Copy link

B-LIE commented Dec 12, 2024

I'm on Julia v1.11.2. When I add Lux.jl, I get the following error message:

Precompiling project...
  ✗ Symbolics  SymbolicsLuxExt
  15 dependencies successfully precompiled in 20 seconds. 786 already precompiled.
  1 dependency errored.
  For a report of the errors see `julia> err`. To retry use `pkg> precompile`
@avik-pal
Copy link
Member

cc @ChrisRackauckas

@ChrisRackauckas
Copy link
Contributor

I need more than that. What's the error?

@B-LIE
Copy link
Author

B-LIE commented Dec 13, 2024

I'm on Julia v1.11.2. Here is the status prior to trying to install Lux.jl [... basically, I'm using all the latest versions of packages, except that StructuralIdentifiability is holding back ModelingToolkit, etc. a little].

(@v1.11) pkg> status
Status `C:\Users\Bernt\.julia\environments\v1.11\Project.toml`
  [47edcb42] ADTypes v1.11.0
  [6e4b80f9] BenchmarkTools v1.5.0
  [336ed68f] CSV v0.10.15
  [13f3f980] CairoMakie v0.12.18
  [a6e380b2] ControlSystems v1.10.5
  [687d7614] ControlSystemsMTK v2.2.1
  [a93c6f00] DataFrames v1.7.0
  [82cc6244] DataInterpolations v6.6.0
  [0c46a032] DifferentialEquations v7.15.0
  [31c24e10] Distributions v0.25.113
  [98e50ef6] JuliaFormatter v1.0.62
  [b964fa9f] LaTeXStrings v1.4.0
  [23fbe1c1] Latexify v0.16.5
  [2fda8390] LsqFit v0.15.0
  [add582a8] MLJ v0.20.7
⌃ [961ee093] ModelingToolkit v9.51.0
  [16a59e39] ModelingToolkitStandardLibrary v2.18.0
  [0987c9cc] MonteCarloMeasurements v1.3.0
⌅ [8913a72c] NonlinearSolve v3.15.1
  [6fe1bfb0] OffsetArrays v1.14.2
  [429524aa] Optim v1.10.0
  [3bd65402] Optimisers v0.4.2
  [1dea7af3] OrdinaryDiffEq v6.90.1
  [91a5bcdd] Plots v1.40.9
  [c3e4b0f8] Pluto v0.20.3
  [98d1487c] PolyesterForwardDiff v0.1.2
  [f27b6e38] Polynomials v4.0.12
  [f3b207a7] StatsPlots v0.15.7
  [220ca800] StructuralIdentifiability v0.5.10
⌃ [0c5d862f] Symbolics v6.15.4
  [e88e6eb3] Zygote v0.6.73
  [37e2e46d] LinearAlgebra v1.11.0
  [de0858da] Printf v1.11.0
Info Packages marked with ⌃ and ⌅ have new versions available.

Then I try to install Lux.jl (it worked in the past):

(@v1.11) pkg> add Lux
   Resolving package versions...
    Updating `C:\Users\Bernt\.julia\environments\v1.11\Project.toml`
⌃ [b2108857] + Lux v1.4.0
    Updating `C:\Users\Bernt\.julia\environments\v1.11\Manifest.toml`
  [0e44f5e4] + Hwloc v3.3.0
⌃ [b2108857] + Lux v1.4.0
  [bb33d45b] + LuxCore v1.2.1
  [82251201] + LuxLib v1.3.10
  [7e8f7934] + MLDataDevices v1.6.3
  [d49dbf32] + WeightInitializers v1.0.4
  [e33a78d0] + Hwloc_jll v2.11.2+1
        Info Packages marked with ⌃ have new versions available and may be upgradable.
Precompiling project...
  ✗ Symbolics  SymbolicsLuxExt
  0 dependencies successfully precompiled in 66 seconds. 801 already precompiled.
  1 dependency errored.
  For a report of the errors see `julia> err`. To retry use `pkg> precompile`

(@v1.11) pkg>

From the command line:

julia> err
PkgPrecompileError: The following 1 direct dependency failed to precompile:

SymbolicsLuxExt

Failed to precompile SymbolicsLuxExt [e6b0080e-84b4-5885-ba4d-e6e9d1269bd5] to "C:\\Users\\Bernt\\.julia\\compiled\\v1.11\\SymbolicsLuxExt\\jl_BC2E.tmp".
ERROR: LoadError: UndefVarError: `recursively_nillify` not defined in `Lux.NilSizePropagation`
Stacktrace:
 [1] getproperty(x::Module, f::Symbol)
   @ Base .\Base.jl:42
 [2] top-level scope
   @ C:\Users\Bernt\.julia\packages\Symbolics\YPGBD\ext\SymbolicsLuxExt.jl:8
 [3] include
   @ .\Base.jl:557 [inlined]
 [4] 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::Nothing)
   @ Base .\loading.jl:2881
 [5] top-level scope
   @ stdin:6
in expression starting at C:\Users\Bernt\.julia\packages\Symbolics\YPGBD\ext\SymbolicsLuxExt.jl:1
in expression starting at stdin:

julia>

@avik-pal
Copy link
Member

Symbolics used to rely on an internal function of Lux which was removed. Though IIRC that version was patched. Something in your env is holding packages back

@B-LIE
Copy link
Author

B-LIE commented Dec 14, 2024

I've spend a few hours removing and adding packages. There appeared to be no problems with:

(@v1.11) pkg> status
Status `C:\Users\Bernt\.julia\environments\v1.11\Project.toml`
  [47edcb42] ADTypes v1.11.0
  [6e4b80f9] BenchmarkTools v1.5.0
  [336ed68f] CSV v0.10.15
  [13f3f980] CairoMakie v0.12.18
  [a6e380b2] ControlSystems v1.10.5
  [687d7614] ControlSystemsMTK v2.2.1
  [a93c6f00] DataFrames v1.7.0
  [82cc6244] DataInterpolations v6.6.0
  [0c46a032] DifferentialEquations v7.15.0
  [31c24e10] Distributions v0.25.113
  [98e50ef6] JuliaFormatter v1.0.62
  [b964fa9f] LaTeXStrings v1.4.0
  [23fbe1c1] Latexify v0.16.5
  [2fda8390] LsqFit v0.15.0
  [b2108857] Lux v1.4.1
  [add582a8] MLJ v0.20.7
⌃ [961ee093] ModelingToolkit v9.51.0
  [16a59e39] ModelingToolkitStandardLibrary v2.18.0
  [0987c9cc] MonteCarloMeasurements v1.3.0
⌅ [8913a72c] NonlinearSolve v3.15.1
  [6fe1bfb0] OffsetArrays v1.14.2
  [429524aa] Optim v1.10.0
  [3bd65402] Optimisers v0.4.2
  [1dea7af3] OrdinaryDiffEq v6.90.1
  [91a5bcdd] Plots v1.40.9
  [c3e4b0f8] Pluto v0.20.3
  [98d1487c] PolyesterForwardDiff v0.1.2
  [f27b6e38] Polynomials v4.0.12
  [f3b207a7] StatsPlots v0.15.7
⌃ [0c5d862f] Symbolics v6.15.4

However, when I add StructuralIdentifiability, the error shows up.

@avik-pal
Copy link
Member

Can you upgrade to NonlinearSolve@4?

@B-LIE
Copy link
Author

B-LIE commented Dec 16, 2024

Sorry for late reply: I just bought a new laptop "made for Lux"... [AMD Strix Point cpu + RTX 4070 GPU], and have just installed Julia v1.11.2 (Windows Pro 64 bit).

I have now installed the following:

(@v1.11) pkg> status
Status `C:\Users\Bernt\.julia\environments\v1.11\Project.toml`
  [b2108857] Lux v1.4.2
  [8913a72c] NonlinearSolve v4.2.0
  [220ca800] StructuralIdentifiability v0.5.10

Apparently no problems. I installed them in the order: (i) NonlinearSolve, (ii) Lux, (iii) StructuralIdentifiability.

Since this is a computer without history of packages, it is perhaps a good way to test installations. If you have other packages I should install to see if/when I get the error message, let me know.

@avik-pal
Copy link
Member

Yeah so NonlinearSolve v3 was just holding back Symbolics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants