You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This error occurs because only a JVP is registered for Int.+, no VJP. The @derivative attribute lowers to a differentiability witness (the public_external linkage may be wrong):
When canonicalizing the differentiability witness created for Int.+, a VJP cannot be generated because Int.+ has no body, as an external function.
What behavior would you expect for this example? Here are possible improvements:
Add a note that reads: "register a VJP function into addition to a JVP function to avoid this error".
When a VJP cannot be generated (e.g. unsupported control flow or no return) but a JVP function is registered, emit an empty VJP function that calls fatalError with the message "No VJP function was registered". This behavior might be unexpected.
Since the error is coming out of the differentiation transform, it looks like the generated differentiability witnesses are falsely treated as the trigger for differentiation. I would expect an error that asks the user to "provide a derivative that produces a pullback".
Additional Detail from JIRA
md5: 6e93ab574cfcf1f80438e7cf183cc1f0
duplicates:
Issue Description:
The correct derivative should obviously be defined in the
static
type context. However, this diagnostic is not helpful and should be improved.The text was updated successfully, but these errors were encountered: