Skip to content

RFC: turn off thunks at 2nd order - #568

Closed
mcabbott wants to merge 1 commit into
JuliaDiff:mainfrom
mcabbott:nothunk
Closed

mcabbott wants to merge 1 commit into
JuliaDiff:mainfrom
mcabbott:nothunk

Conversation

@mcabbott

Copy link
Copy Markdown
Member

No description provided.

val::T
end

InplaceableThunk(add!, val) = val # if _usethunks() disables @thunk, then bypass this too

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems wrong?

return throw(MutateThunkException())
end

@inline _usethunks() = true

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I doubt this needs an @inline

@oxinabox

oxinabox commented Aug 5, 2022

Copy link
Copy Markdown
Member

Why do we want to do this?

@mcabbott

mcabbott commented Aug 5, 2022

Copy link
Copy Markdown
Member Author

This was part of FluxML/Zygote.jl#1262 (comment), tl;dr is that everything 2nd order in Zygote is broken. Besides problems with the Z-to-CR bridge, the creation of thunks doesn't seem to be differentiable, and ProjectTo also gave problems. But far from sorted out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants