-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[AutoDiff] Propagate '@nondiff' from AST function types to SIL function types. #23854
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
Conversation
…on types. This is to unblock `@differentiable` functions with `@nondiff` parameters. Once `SILDifferentiableFunctionType` in swiftlang#23482 lands, `@nondiff` should be nuked from SIL.
@swift-ci please test tensorflow |
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.
Needle in a haystack change 😄
swift: /home/swiftci/jenkins/workspace/swift-PR-TensorFlow-Linux/swift/lib/AST/ASTContext.cpp:4204: swift::SILFunctionType::SILFunctionType(swift::GenericSignature *, swift::SILFunctionType::ExtInfo, swift::SILCoroutineKind, swift::ParameterConvention, ArrayRefswift::SILParameterInfo, ArrayRefswift::SILYieldInfo, ArrayRefswift::SILResultInfo, Optionalswift::SILResultInfo, const swift::ASTContext &, swift::RecursiveTypeProperties, Optionalswift::ProtocolConformanceRef): Assertion `param.getDifferentiability() == SILParameterDifferentiability::DifferentiableOrNotApplicable && "non-differentiable function has NotDifferentiable parameter"' failed. |
@swift-ci please test tensorflow |
@swift-ci please test tensorflow |
@swift-ci please test tensorflow |
3 similar comments
@swift-ci please test tensorflow |
@swift-ci please test tensorflow |
@swift-ci please test tensorflow |
@swift-ci please test tensorflow |
4 similar comments
@swift-ci please test tensorflow |
@swift-ci please test tensorflow |
@swift-ci please test tensorflow |
@swift-ci please test tensorflow |
Fixed. Thanks @marcrasi for the help! |
@swift-ci please test tensorflow |
…on types. (swiftlang#23854) This is to unblock `@differentiable` functions with `@nondiff` parameters. - Propagate `@nondiff` from AST to SIL. - Add `AnyFunctionType::getWithoutDifferentiability`, which drops all `@differentiable` and `@nondiff` attributes from a function type. - Use autodiff parameter indices from function types now that `@nondiff` has been propagated. - Replace currying logic from `SILFunctionType::getAssociatedFunctionType` with lightweight logic that handles methods, which is needed for differentiable protocol requirements. - Emit an error when a `@nondiff` parameter is being differentiated with respect to. - Fix `@nondiff` AST printing. Note: - Once `SILDifferentiableFunctionType` in swiftlang#23482 lands, `@nondiff` should be nuked from SIL. - Before merging, pull from the `tensorflow` branch to make sure swiftlang#23887 is merged. Resolves [TF-421](https://bugs.swift.org/browse/TF-421).
This is to unblock
@differentiable
functions with@nondiff
parameters.@nondiff
from AST to SIL.AnyFunctionType::getWithoutDifferentiability
, which drops all@differentiable
and@nondiff
attributes from a function type.@nondiff
has been propagated.SILFunctionType::getAssociatedFunctionType
with lightweight logic that handles methods, which is needed for differentiable protocol requirements.@nondiff
parameter is being differentiated with respect to.@nondiff
AST printing.Note:
SILDifferentiableFunctionType
in [AutoDiff] Add 'SILDifferentiableFunctionType'. #23482 lands,@nondiff
should be nuked from SIL.tensorflow
branch to make sure [AutoDiff] Enable differentiation wrt "subset indices". #23887 is merged.Resolves TF-421.