-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[AutoDiff upstream] Add SIL differentiability witness serialization. #29642
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 upstream] Add SIL differentiability witness serialization. #29642
Conversation
SIL differentiability witnesses are a new top-level SIL construct mapping an "original" SIL function and derivative configuration to derivative SIL functions. This patch adds `SILDifferentiabilityWitness` serialization/deserialization. Resolves TF-1136.
@@ -2550,6 +2615,24 @@ void SILSerializer::writeSILBlock(const SILModule *SILMod) { | |||
processSILFunctionWorklist(); | |||
} | |||
|
|||
// Write out differentiability witnesses. | |||
// Note: this must be done after visiting SIL functions above so that |
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.
Note: diff. witness deserialization seems a bit overly complicated right now (auxiliary DifferentiabilityWitnessesToEmit
data structure, etc) because the differentiability_witness_function
instruction hasn't been upstreamed yet.
I decided to upstream the code as-is because it's the final desired version.
@swift-ci Please test |
Build failed |
`sed -i` behaves differently on macOS and Ubuntu. Instead, use `sed ... > ...` to redirect the output.
Build failed |
This likely explains and fixes the macOS CI SIL deserialization failure.
@swift-ci Please test |
Build failed |
Build failed |
CI failures seem unrelated, maybe they're fixed now. |
Build failed |
@swift-ci Please test macOS platform |
All tests passed. I had to resolve a merge conflict, so tests must be run again. |
Build failed |
Build failed |
SIL differentiability witnesses are a new top-level SIL construct mapping
an "original" SIL function and derivative configuration to derivative SIL
functions.
This patch adds
SILDifferentiabilityWitness
serialization/deserialization.Resolves TF-1136.
Todos:
SILDifferentiabilityWitness
verification.SILDifferentiabilityWitness
SILGen from@differentiable
and@derivative
attributes.SILDifferentiabilityWitness
names.