Enzyme.jl icon indicating copy to clipboard operation
Enzyme.jl copied to clipboard

`CombinedAdjointThunk` should also return ret value

Open vchuravy opened this issue 3 years ago • 4 comments

julia> autodiff(f, Active(2.0))
(4.0,)

Should maybe be:

julia> (4.0, (4.0,))
(4.0, (4.0,))

vchuravy avatar Jul 27 '21 18:07 vchuravy

https://github.com/wsmoses/Enzyme.jl/blob/aa78016bfd046689aa33b2ceba50049b329dd0d5/src/compiler.jl#L1189

vchuravy avatar Sep 13 '21 15:09 vchuravy

@tansongchen this might be a good place to start.

vchuravy avatar Sep 28 '21 19:09 vchuravy

Just went though compiler.jl, this should be straightfoward. will do it

tansongchen avatar Sep 28 '21 19:09 tansongchen

Adding this as an option actually enables us to handle https://github.com/wsmoses/Enzyme.jl/issues/112 by simply returning the shadow return via the corresponding shadow return arg.

wsmoses avatar Sep 30 '21 23:09 wsmoses

@wsmoses #537 did implement this right?

vchuravy avatar Feb 03 '23 20:02 vchuravy

I don't think so, but it changed the ABI to have a place for this.

wsmoses avatar Feb 03 '23 20:02 wsmoses

Done in https://github.com/EnzymeAD/Enzyme.jl/pull/598

wsmoses avatar Feb 03 '23 21:02 wsmoses