-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[AutoDiff] improve symbol linkage #28582
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
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.
LGTM, thanks for the great documentation!
@swift-ci please test tensorflow |
@@ -823,7 +823,8 @@ void SILGenModule::emitDifferentiabilityWitness( | |||
auto *diffWitness = SILDifferentiabilityWitness::createDefinition( | |||
M, originalFunction->getLinkage(), originalFunction, loweredParamIndices, | |||
config.resultIndices, config.derivativeGenericSignature, | |||
/*jvp*/ nullptr, /*vjp*/ nullptr, originalFunction->isSerialized(), | |||
/*jvp*/ nullptr, /*vjp*/ nullptr, | |||
/*isSerialized*/ hasPublicVisibility(originalFunction->getLinkage()), |
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.
We probably shouldn't always serialize witnesses for any public declarations, because things we emit should be opaque by default. Maybe you should add logic to the cross module optimizer that was recently added (#28407) to make differentiability witnesses serialized.
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.
I'll do this later because this PR is now very tested and almost ready to go. https://bugs.swift.org/browse/TF-1035
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.
Sounds good. Thanks.
@swift-ci please test tensorflow |
@swift-ci please test tensorflow macos |
Implements most of the symbol linkage design, enough to fix two linker issues: TF-690 & TF-1025. (There are a few other linker issues in JIRA. I'll check later if this fixes any of those).
Specific changes:
This PR does not include the following pieces of the design:
This seems "dangerous" so I'll run swift-apis and swift-models tests on it. (e.g. without tensorflow/swift-apis#573, swift-apis would fail to compile after this PR).