Skip to content

[AutoDiff upstream] Add SIL derivative function type calculation. #29396

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

Merged

Conversation

dan-zheng
Copy link
Contributor

Add SILFunctionType::getAutoDiffDerivativeFunctionType.

It computes the derivative SILFunctionType for an "original" SILFunctionType, given:

  • Differentiability parameter indices
  • Differentiability result index
  • Derivative function kind
  • Derivative function generic signature (optional)
  • Other auxiliary parameters

Add doc comments explaining typing rules, preconditions, and other details.

Partially resolves TF-1124.
Unblocks upstreaming other SIL differentiable programming infrastructure.

Add `SILFunctionType::getAutoDiffDerivativeFunctionType`.

It computes the derivative `SILFunctionType` for an "original"
`SILFunctionType`, given:

- Differentiability parameter indices
- Differentiability result index
- Derivative function kind
- Derivative function generic signature (optional)
- Other auxiliary parameters

Add doc comments explaining typing rules, preconditions, and other details.

Partially resolves TF-1124.
Unblocks upstreaming other SIL differentiable programming infrastructure.
@dan-zheng dan-zheng requested a review from rxwei January 23, 2020 20:38
@dan-zheng
Copy link
Contributor Author

dan-zheng commented Jan 23, 2020

@rxwei: could you please help suggest additional reviewers, if you feel it's appropriate?

Edit: in an offline chat, @rxwei recommended Joe Groff/Andy Trick/Michael Gottesman as SIL code reviewers.

@dan-zheng
Copy link
Contributor Author

@swift-ci Please test

@dan-zheng
Copy link
Contributor Author

@jckarter: would you like to review this PR, or suggest a reviewer? I'm asking you since you seem like a SIL code owner.

This PR is part of our effort to upstream differentiable programming. It adds a utility function and should be relatively non-controversial.

If there's no activity, I'll merge within a day to unblock progress. Happy to address feedback at any time!

@jckarter
Copy link
Contributor

Makes sense to me.

@dan-zheng dan-zheng merged commit 2d08a3f into swiftlang:master Jan 24, 2020
@dan-zheng dan-zheng deleted the autodiff-upstream-sil-derivative-type branch January 24, 2020 18:09
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.

3 participants