-
Notifications
You must be signed in to change notification settings - Fork 69
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
Hessian on Lux MLP fails #2305
Comments
ERROR: TypeError: in typeassert, expected LLVM.LoadInst, got a value of type LLVM.CallInst
Here is another try using DifferentiationInterface: using Lux, DifferentiationInterface, Enzyme, ComponentArrays, Random
function loss(θ, ax, model, st, x, y)
pred, _ = model(x, ComponentArray(θ, ax), st)
MSELoss()(pred, y)
end
model = Chain(Dense(2 => 8, softplus),
Dense(8 => 1))
ps, st = Lux.setup(Xoshiro(12), model) |> f64
pc = ComponentArray(ps)
pp = Array(pc)
ax = getaxes(pc)
x = randn(2, 10^4)
y = randn(1, 10^4)
DifferentiationInterface.gradient(loss,
AutoEnzyme(),
pp,
Constant(ax),
Constant(model),
Constant(st),
Constant(x),
Constant(y))
DifferentiationInterface.hessian(loss,
AutoEnzyme(),
pp,
Constant(ax),
Constant(model),
Constant(st),
Constant(x),
Constant(y)) Produces the error Instruction does not dominate all uses!
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If I use
autodiff
instead ofautodiff_deferred
ingrad
, I get the following error:Instruction does not dominate all uses!
The text was updated successfully, but these errors were encountered: