You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Retroactive derivative registration: register derivatives for functions in other modules.
Previously:
If module A defines func foo, then its derivatives must be in the same module.
With retroactive derivative registration:
If module A defines func foo;
And if module B imports module A and defines @derivative(of: foo) func derivativeFoo:
Then module C can import modules A and B and differentiate func foo (e.g. via differentiation APIs).
Retroactive derivative registration enables the following:
Defining derivatives in a separate module from original functions. This enables modularity: libraries like swift-numerics can define a separate "derivatives" module.
Derivative registration for imported C functions. Early demo here.
The text was updated successfully, but these errors were encountered:
Additional Detail from JIRA
md5: e2357f504e2da828a1cddd63fe03e829
Sub-Tasks:
@differentiable
/@differentiating
attributesdifferentiability_witness_function
instructiondifferentiability_witness_function
instructiondifferentiability_witness_function
instructions@derivative
attribute directly to SIL differentiability witnesses@differentiable
attribute's derivative generic signature to the original declaration's generic signature@derivative
in stdlib instead of@differentiable(jvp:vjp:)
@derivative
in tensorflow/swift-apis instead of@differentiable(vjp:)
@derivative
attribute SILGen crash for foreign original declaration-Xfrontend -enable-experimental-cross-file-derivative-registration
flag@derivative
functions to have same access level as original declarationblocks:
is duplicated by:
Issue Description:
Retroactive derivative registration: register derivatives for functions in other modules.
Previously:
func foo
, then its derivatives must be in the same module.With retroactive derivative registration:
If module A defines
func foo
;And if module B imports module A and defines
@derivative(of: foo) func derivativeFoo
:Then module C can import modules A and B and differentiate
func foo
(e.g. via differentiation APIs).Retroactive derivative registration enables the following:
Defining derivatives in a separate module from original functions. This enables modularity: libraries like swift-numerics can define a separate "derivatives" module.
Derivative registration for imported C functions. Early demo here.
The text was updated successfully, but these errors were encountered: