-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[AutoDiff] Define derivative for concrete SIMD.init(repeating:) #81864
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] Define derivative for concrete SIMD.init(repeating:) #81864
Conversation
Tagging @JaapWijnen |
@swift-ci please test |
The PR swiftlang#81766 introduced some concrete SIMD operations, but `init(repeating:)` was temporarily disabled due to differentiation testing break. See: stephentyrone@7a00619 This PR contains two changes: 1. Define custom derivatives for concrete `init(repeating:)` so we do not fall into non-differentiability error diagnostic. 2. Add a fix to SIL linker so differentiability witness lookup is done when the original function has both `@_alwaysEmitIntoClient` and `@_transparent`. Similar changes were introduced previously in swiftlang#78908, but they only handled `@_alwaysEmitIntoClient` without `@_transparent`.
3089b0f
to
25f789e
Compare
@swift-ci please test |
@@ -455,3 +455,34 @@ where | |||
return (Self(repeating: value), { v in Self(repeating: v) }) | |||
} | |||
} | |||
|
|||
%for (Scalar, bits) in [('Float16',16), ('Float',32), ('Double',64)]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove the Float16
piece here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed in 591e19c, thanks
% if bits == 16: | ||
#if !((os(macOS) || targetEnvironment(macCatalyst)) && arch(x86_64)) | ||
@available(SwiftStdlib 5.3, *) | ||
% end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And remove this and the trailing if block as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed in 591e19c, thanks
@swift-ci please test |
The PR #81766 introduced some concrete SIMD operations, but
init(repeating:)
was temporarily disabled due to differentiation testing break. See:stephentyrone@7a00619
This PR contains two changes:
Define custom derivatives for concrete
init(repeating:)
so we do not fall into non-differentiability error diagnostic.Add a fix to SIL linker so differentiability witness lookup is done when the original function has both
@_alwaysEmitIntoClient
and@_transparent
. Similar changes were introduced previously in [AutoDiff] Support custom derivatives for @_alwaysEmitIntoClient functions #78908, but they only handled@_alwaysEmitIntoClient
without@_transparent
.