SciML / Surrogates.jl

Surrogate modeling and optimization for scientific machine learning (SciML)
https://docs.sciml.ai/Surrogates/stable/
Other
330 stars 69 forks source link

fix: `master` branch is failing precompilation #438

Closed sathvikbhagavan closed 1 year ago

sathvikbhagavan commented 1 year ago

Getting an error:

julia> using Surrogates
[ Info: Precompiling Surrogates [6fc51010-71bc-11e9-0e15-a3fcc6593c49]
ERROR: LoadError: syntax: invalid interpolation syntax: "$$"
Stacktrace:
 [1] top-level scope
   @ ~/oss/Surrogates.jl/src/Radials.jl:37
 [2] include(mod::Module, _path::String)
   @ Base ./Base.jl:457
 [3] include(x::String)
   @ Surrogates ~/oss/Surrogates.jl/src/Surrogates.jl:1
 [4] top-level scope
   @ ~/oss/Surrogates.jl/src/Surrogates.jl:7
 [5] include
   @ ./Base.jl:457 [inlined]
 [6] 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:2049
 [7] top-level scope
   @ stdin:3

Same error in the CI build on master - https://github.com/SciML/Surrogates.jl/actions/runs/5554601185/job/15046314727

This should fix that

sathvikbhagavan commented 1 year ago

@ChrisRackauckas can we merge this?

ChrisRackauckas commented 1 year ago

This also fails?

sathvikbhagavan commented 1 year ago

Hmm, its a different error in CI / test (Core 1.6)

✓ Surrogates
✓ CUDA
✓ cuDNN
✓ NNlibCUDA
✓ Flux
133 dependencies successfully precompiled in 157 seconds
   Testing Running tests...
 Resolving package versions...
ERROR: LoadError: Unsatisfiable requirements detected for package Statistics [10745b16]:
Statistics [10745b16] log:
├─possible versions are: 0.0.0 or uninstalled
├─Statistics [10745b16] is fixed to version 0.0.0
└─found to have no compatible versions left with Zygote [e88e6eb3]
 └─Zygote [e88e6eb3] log:
   ├─possible versions are: 0.1.0-0.6.63 or uninstalled
   └─restricted to versions 0.4-0.6 by Surrogates [6fc51010], leaving only versions 0.4.0-0.6.63
     └─Surrogates [6fc51010] log:
       ├─possible versions are: 6.5.1 or uninstalled
       ├─restricted to versions 6 by SurrogatesAbstractGPs [78aa1720], leaving only versions 6.5.1
       │ └─SurrogatesAbstractGPs [78aa1720] log:
       │   ├─possible versions are: 0.1.0 or uninstalled
       │   └─SurrogatesAbstractGPs [78aa1720] is fixed to version 0.1.0
       └─Surrogates [6fc51010] is fixed to version 6.5.1

Surrogates is getting precompiled though. I am not sure why the error is coming though.

ChrisRackauckas commented 1 year ago

Latest Turing doesn't allow v1.6: is this related?

sathvikbhagavan commented 1 year ago

Surrogates doesn't use Turing.jl afaik

Can you trigger the workflow for the latest julia version - it worked for me locally (although tests were failing - unrelated reason) and it was cancelled in the previous run.

sathvikbhagavan commented 1 year ago

Why does CI / test (Core, 1) job gets cancelled?

ChrisRackauckas commented 1 year ago

Because v1.6 fails.

sathvikbhagavan commented 1 year ago

Ok, Surrogates does precompile on both but I am not sure why we are getting a version conflict on 1.6. Any ideas to fix this?

ChrisRackauckas commented 1 year ago

Some package requires >v1.6, something in the GP stack.

sathvikbhagavan commented 1 year ago

One small thing I tried was adding this line in runtests:

Pkg.add(name="Statistics", version=VERSION)

and this worked if I did ]test and did not error out with the package resolution issue in julia 1.6

KristofferC commented 1 year ago

I'll try figure out what is going on here.

KristofferC commented 1 year ago

The following fixes the issue on 1.6 Pkg:

diff --git a/src/Operations.jl b/src/Operations.jl
index 0644e0ee7..6ac5a48c4 100644
--- a/src/Operations.jl
+++ b/src/Operations.jl
@@ -281,7 +281,7 @@ function collect_project!(ctx::Context, pkg:
:PackageSpec, path::String,
         pkg.version = project.version
     else
         # @warn("project file for $(pkg.name) is missing a `version` entry")
-        pkg.version = VersionNumber(0)
+        pkg.version = VERSION # VersionNumber(0)
     end
     return
 end

Since

Pkg.add(name="Statistics", version=VERSION)

seems to work I would go with that on 1.6 though as a workaround.

ChrisRackauckas commented 1 year ago

okay thanks let's do that.