Skip to content
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

@non_differentiable & #558

Merged
merged 2 commits into from
Jan 12, 2022
Merged

@non_differentiable & #558

merged 2 commits into from
Jan 12, 2022

Conversation

mcabbott
Copy link
Member

Marking & non-diff fixes this:

julia> gradient(x -> eachindex(x)[1], rand(3))
ERROR: Rewrite reached intrinsic function and_int. Missing rule?
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:33
  [2] (::∂⃖{1})(::Core.IntrinsicFunction, ::Bool, ::Vararg{Bool})
    @ Diffractor ~/.julia/packages/Diffractor/HYuxt/src/stage1/generated.jl:205
  [3] &
    @ ./bool.jl:38 [inlined]
  [4] (::Diffractor.∂⃖recurse{1})(::typeof(&), ::Bool, ::Bool)

And div just noticed in passing, always returns an integer, so should not have a derivative.

Copy link
Member

@oxinabox oxinabox left a comment

Choose a reason for hiding this comment

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

don't forget to increment the version

@mcabbott mcabbott merged commit 9b69475 into JuliaDiff:main Jan 12, 2022
@mcabbott mcabbott deleted the nondiff_or branch January 12, 2022 18:45
@mcabbott
Copy link
Member Author

This may have broken things. NNlib and Flux's tests now fail with similar, mysterious, errors, from within Zygote's CR code. Limiting to CR 1-1.17 to exclude this PR fixes this.

FluxML/NNlib.jl#375 (comment)

It could be other PRs but this one seems most likely to gets its fingers deep in the works -- that was the point of the above example.

I haven't yet managed to reproduce the problem locally; as tests segfault for me anyway. @darsnack saw similar failures locally.

@darsnack
Copy link

@mcabbott is this still the suspected error source or was it #562? If it is, I can reproduce the issue locally and test if reverting fixes things, then submit a PR.

@mcabbott
Copy link
Member Author

I hope it was that. CR 1.18.1 is released, and it looks like NNlib CI is past the point where it used to fail: https://github.com/FluxML/NNlib.jl/runs/4805913627?check_suite_focus=true . (I couldn't get to the failure locally.)

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.

4 participants