Skip to content

Commit

Permalink
edit warning to indicate that this is a correctness issue
Browse files Browse the repository at this point in the history
  • Loading branch information
vpuri3 authored Nov 12, 2024
1 parent 3269bd9 commit 8c1c073
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ext/OptimisersAdaptExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import Optimisers: Leaf

function Adapt.adapt_structure(to, leaf::Leaf)
@warn """`Optimisers.Leaf` object does not support device transfer via
`Adapt.jl`. Avoid this by calling `Flux.gpu/cpu` or
`MLDataDevices.cpu_device()/gpu_device()` on the optimiser state object.
`Adapt.jl`. This could lead to incorrect gradient updates. Avoid this by
calling `Flux.gpu/cpu` or `MLDataDevices.cpu_device()/gpu_device()` on the
optimiser state object.
""" maxlog=1

rule = Adapt.adapt(to, leaf.rule)
Expand Down

0 comments on commit 8c1c073

Please sign in to comment.