-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[AutoDiff] Move stdlib sources to stdlib/public/core/Differentiation. #28089
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
[AutoDiff] Move stdlib sources to stdlib/public/core/Differentiation. #28089
Conversation
Move differentiable-programming-related stdlib sources to `stdlib/public/core/Differentiation`. Related master branch PR: swiftlang#27511. master branch will have a `_Differentiation` support library containing the `Differentiable` protocol and related APIs. On tensorflow branch, the Swift source files in `stdlib/public/core/Differentiation` will be directly built as part of swiftCore for simplicity. Swift for TensorFlow users can continue to use the `Differentiable` protocol and related APIs without adding `import _Differentiation`. Rename `protocol _Differentiable` back to `protocol Differentiable`.
@swift-ci Please test tensorflow |
@swift-ci Please test tensorflow |
Currently, #27511 adds a test subdirectory called Two notes:
For now, I'll rename |
Could we have an empty |
Have you considered making the |
We considered this - the team made the initial decision to not investigate auto-import logic to avoid the engineering effort and complexity. (A I think we can revisit this decision though if there are strong reasons for adding an auto-import. |
If there are no strong objections, let's proceed by adding an empty |
This allows us to avoid `#if canImport(_Differentiation)` checks in upstreamed AutoDiff tests.
@swift-ci Please test tensorflow |
One failing test on macOS:
For some reason, with this patch, // x86_64.swiftinterface
// Before this patch:
extension SIMD2 : Swift.Differentiable & Swift.EuclideanDifferentiable where Scalar : Swift.BinaryFloatingPoint, Scalar : Swift.EuclideanDifferentiable, Scalar.TangentVector : Swift.BinaryFloatingPoint {
// With this patch:
extension SIMD2 : Swift.EuclideanDifferentiable where Scalar : Swift.BinaryFloatingPoint, Scalar : Swift.EuclideanDifferentiable, Scalar.TangentVector : Swift.BinaryFloatingPoint {
I reproduced this issue upstream and filed a minimal reproducer: SR-11723. I'll work around the issue for now by breaking up |
stdlib/public/core/Differentiable.swift has been replaced with stdlib/public/Differentiation/Differentiable.swift.
Split `extension SIMD${n}: Differentiable & EuclideanDifferentiable` into two separate extensions to work around .swiftinterface error. Fixes validation-test/ParseableInterface/verify_stdlib.swift on macOS.
@swift-ci Please test tensorflow |
Move differentiable-programming-related stdlib sources to
stdlib/public/core/Differentiation
.Related
master
branch PR: #27511.master
branch will have a_Differentiation
support library containing theDifferentiable
protocol and related APIs.On
tensorflow
branch, the Swift source files instdlib/public/core/Differentiation
will be directly built as part of swiftCore for simplicity. Swift for TensorFlow users can continue to use theDifferentiable
protocol and related APIs without addingimport _Differentiation
.Rename
protocol _Differentiable
back toprotocol Differentiable
.