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-9401] [AD] FloatingPoint.squareRoot causes duplicate differentiation task registration #51867

Closed
rxwei opened this issue Dec 3, 2018 · 1 comment
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. swift for tensorflow

Comments

@rxwei
Copy link
Member

rxwei commented Dec 3, 2018

Previous ID SR-9401
Radar None
Original Reporter @rxwei
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Swift for TensorFlow
Labels Bug
Assignee @dan-zheng
Priority Medium

md5: 22bf580df17e873fa81056d9661b5950

Issue Description:

The AD pass registers a differentiation task for every `[reverse_differentiable]` attribute in SIL. The following function causes registration to happen twice on this function, triggering an assertion in `ADContext::registerDifferentiationTask`

@differentiable(reverse, wrt: (self), adjoint: _adjointSquareRoot)
public func squareRoot() -> Self {
  var lhs = self
  lhs.formSquareRoot()
  return lhs
}
   DifferentiationTask *
   registerDifferentiationTask(SILFunction *original,
                               const SILAutoDiffIndices &indices,
                               DifferentiationInvoker invoker) {
     // Make sure this pair of original and indices is unique.
     assert(!lookUpDifferentiationTask(original, indices)); // <---- failed
@rxwei
Copy link
Member Author

rxwei commented Jan 16, 2019

we did it after days and nights. #21837

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. swift for tensorflow
Projects
None yet
Development

No branches or pull requests

1 participant