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

Un-collapse nothings in gradient #1495

Merged
merged 2 commits into from
Jan 17, 2024
Merged

Un-collapse nothings in gradient #1495

merged 2 commits into from
Jan 17, 2024

Conversation

ToucheSir
Copy link
Member

@ToucheSir ToucheSir commented Jan 12, 2024

Companion to FluxML/ZygoteRules.jl#26. After some discussion in #1466 and elsewhere, we decided preserving the Tuple return was the way to go.

PR Checklist

  • Tests are added
  • Documentation, if applicable

@ToucheSir
Copy link
Member Author

Well, I didn't expect downstream tests to fare so well. Also only minimal changes to Zygote's own test suite required.

Rough next steps:

  1. Cut a ZygoteRules release with Collapse tuples of nothing ZygoteRules.jl#26. I'm on the fence about whether to mark it as breaking right now, thoughts and opinions very much welcome.
  2. Update this PR to use the new ZygoteRules and tweak doc(string)s to mention this guarantee about gradients return type.
  3. Merge this and start working on newly unblocked PRs like Remove redundant sum() rules #1453 and Allow ChainRules zero types internally #1389.

Also adds a docstring for `pullback`,
which we've been missing for some time.
@ToucheSir
Copy link
Member Author

Docs are up so this should be ready. Amazingly, we never had a docstring for pullback despite referencing it in other parts of the docs!

@ToucheSir ToucheSir merged commit 54f1e80 into master Jan 17, 2024
12 of 14 checks passed
@ToucheSir ToucheSir deleted the bc/gradtuple branch January 17, 2024 01:33
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