JuliaNLSolvers / Optim.jl

Optimization functions for Julia
Other
1.11k stars 213 forks source link

warning: Linking two modules of different target triples: 'bcloader' is 'x86_64-unknown-linux-gnu' whereas 'text' is 'x86_64-linux-gnu' #999

Closed Moelf closed 1 year ago

Moelf commented 1 year ago

https://github.com/EnzymeAD/Enzyme.jl/issues/298

MWE:

julia> using Optim, Enzyme, LinearAlgebra

julia> function f(x)
                  y1 = zeros(eltype(x), 3)
                  y2 = ones(eltype(x), 3)
                  y1 .+= (3 - sin(x[1]))^2
                  y2 .+= (x[2] - 3)^4
                  dot(y1, y2)
              end
f (generic function with 1 method)

julia> g! = (dx, αs) -> autodiff(f, Duplicated(αs, dx))
#1 (generic function with 1 method)

julia> @show optimize(f, g!, ones(2), LBFGS(); inplace=true) |> Optim.minimizer
warning: Linking two modules of different target triples: 'bcloader' is 'x86_64-unknown-linux-gnu' whereas 'text' is 'x86_64-linux-gnu'

warning: Linking two modules of different target triples: 'bcloader' is 'x86_64-unknown-linux-gnu' whereas 'text' is 'x86_64-linux-gnu'

┌ Warning: Using fallback BLAS replacements, performance may be degraded
└ @ Enzyme.Compiler ~/.julia/packages/GPUCompiler/N98un/src/utils.jl:35
optimize(f, g!, ones(2), LBFGS(); inplace = true) |> Optim.minimizer = [1.0, 1.0]
2-element Vector{Float64}:
pkofod commented 1 year ago

Are you sure this is not an Enzyme problem? It seems to refer to the Enzyme.Compiler. I don't know much about their project unfortunately.