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

[SR-13077] Use adjoint values instead of adjoint buffers for all loadable tangent types #55523

Open
dan-zheng opened this issue Jun 25, 2020 · 0 comments
Labels
AutoDiff compiler The Swift compiler in itself improvement

Comments

@dan-zheng
Copy link
Collaborator

Previous ID SR-13077
Radar None
Original Reporter @dan-zheng
Type Improvement
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement, AutoDiff
Assignee None
Priority Medium

md5: 1cb3774afc376c7e1ea6c8e78781ce5d

Issue Description:

Currently, the differentiation transform (PullbackEmitter) always creates adjoint buffers for address-typed original values, regardless of whether the tangent type is loadable or address-only.

However, some address-only original types may have loadable tangent types. For tangent types that are loadable, it would be more efficient to use symbolic AdjointValues instead of adjoint buffers.

// Foo<T>: address-only
// Foo<T>.TangentVector: loadable
struct Foo<T>: Differentiable {
  var a: Float
  @noDerivative var b: T
}

We should make the "tangent value category" depend solely on whether the tangent type is loadable or address-only.


Discussion from #32540 (comment)

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AutoDiff compiler The Swift compiler in itself improvement
Projects
None yet
Development

No branches or pull requests

1 participant