-
Notifications
You must be signed in to change notification settings - Fork 70
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
Add recursive map generalizing the make_zero mechanism #1852
Open
danielwe
wants to merge
17
commits into
EnzymeAD:main
Choose a base branch
from
danielwe:recursive_accumulate
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
65eaec0
Implement recursive_map as basis for make_zero
danielwe 5a5715c
Minor tweaks to typeasserts and accumulate_seen
danielwe a477b51
Simplify: remove IsInactive, always use *_nongen
danielwe c0fa471
Refactor to reduce generated lines
danielwe f852e50
Only support Nout in (1, 2)
danielwe d24baec
Revert "Simplify: remove IsInactive, always use *_nongen"
danielwe 25593d6
Combine copy_if_inactive and runtime_inactive into a config type
danielwe fac2f0b
Use simple assert for Nout check
danielwe 43d182e
Reorganize test module to please the formatter
danielwe 1ad3882
Apply suggestions from Runic.jl
danielwe 316cc31
More obliging the formatter
danielwe 5f934cb
Tweak alignment and format:off/on
danielwe bdb9836
Follow non-alignment related rules in format: off blocks
danielwe 42e128e
One more tweak to format on/off tags
danielwe 4cc1ed0
Fix formatting
danielwe 94fdb99
Final formatting fix
danielwe 3de96f0
Make Documenter happy
danielwe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a new API? It will need a version bump for EnzymeCore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should discuss. The reason I put these helpers in EnzymeCore rather than keeping them internal was that the StaticArrays extension needed to add a method, so I figured there's a chance others might have to do the same for their custom types. However, subtyping
DenseArray
(andAbstractFloat
if that ever becomes relevant) should almost always be sufficient. Either way, the point is only to make these extensible in package extensions. I don't think anyone should ever have to call them.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, the vector space wrapper functionality I've built on top of this (which will be a separate PR) will probably involve a new type in EnzymeCore, so if that gets accepted there will have to be a new EnzymeCore release anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, absolutely. I think this is the right place to add them, and EnzymeCore is basically meant for people to be able to extend things without having to bite the load time bullet that is Enzyme.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw. names are infinitely bikesheddable, both in this case and elsewhere in the PR. My mindset working on this PR is to enable consistent treatment of arbitrary objects as vectors in a space spanned by the scalar (float) values reachable from the object, hence all the vector/scalar terminology, but I don't know if this works well or if it's confusing, especially as part of the public API.