This repository was archived by the owner on Jun 11, 2026. It is now read-only.
Rename module entry points#947
Merged
Merged
Conversation
Contributor
|
I've just realised I've named these badly, sorry. "Forward" should really be reserved for "compute the function, and anything else needed for a subsequent backward" [edited:] Then KscAutogradFunction can decide to make use of them in its "forward" and "backward" pending #768 |
dcrc2
force-pushed
the
dcrc2/rename-module-entry-points
branch
2 times, most recently
from
July 13, 2021 11:50
479a9f5 to
d353737
Compare
Contributor
Author
OK, renamed to |
dcrc2
force-pushed
the
dcrc2/rename-module-entry-points
branch
2 times, most recently
from
July 13, 2021 12:35
325a89f to
f61b21c
Compare
dcrc2
force-pushed
the
dcrc2/rename-module-entry-points
branch
from
July 13, 2021 14:27
f61b21c to
8afc0c3
Compare
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This PR renames the pybind entry points to be
forward and backwardentryandentry_vjpirrespective of whether LM AD is used. (Previously the backward entry point was eitherrev_entryorsufrev_entry.)In particular, for the embedded C++ examples, this means that any two C++ functions can be used as the entry points. I've removed the
generate_lmparameter fromcpp_string_to_autograd_function, which didn't really make sense in this context as nothing is being generated.In order for this to work, the embedded C++ examples need to have C++ functions with the correct names (
entryandentry_vjp). I've done this here by adding trivial forwarding functions with the correct name, rather than by changing the existing names. This is done with PRs #925 and #931 in mind: the forwarding function will need to do a little more work when those PRs are merged. I'm intending to rebase those PRs onto this one.Note that these changes mean that we no longer generate an entry point for
[fwd f]when LM AD is requested. I don't think we were actually using this anywhere.