Skip to content
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] WIP: Implement the Differentiable Curry #28516

Closed
wants to merge 2,382 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
2382 commits
Select commit Hold shift + click to select a range
bf3cfef
Update the LLDB sha
Oct 2, 2019
b8f31a1
Merge pull request #27478 from apple/tensorflow-merge
Oct 3, 2019
d1a0f5f
[AutoDiff] Remove `Differentiable` APIs deprecated in 0.5. (#27505)
dan-zheng Oct 3, 2019
396eaea
[NFC] [AutoDiff] Minor cleanup. (#27509)
dan-zheng Oct 3, 2019
7e3c666
[AutoDiff] Typo in TransposingAttr::TransposingAttr (#27523)
saeta Oct 3, 2019
684fc9b
[AutoDiff] Nuke `AutoDiffParameterIndices`. (#27514)
dan-zheng Oct 4, 2019
ec21e28
[AutoDiff] NFC: Add tests for 'AutoDiffIndexSubset' initializers. (#2…
rxwei Oct 6, 2019
0a4018f
[AutoDiff] Fix differentiation crasher: control flow + non-varied res…
dan-zheng Oct 7, 2019
4424a7c
[NFC] Gardening. (#27581)
dan-zheng Oct 8, 2019
31313dd
Merge branch 'master_1' into tensorflow
asuhan Oct 9, 2019
e936fb9
Fix merge damage
asuhan Oct 9, 2019
c76bde9
Defines derivatives for remaining tgmath math functions. (#27559)
vguerra Oct 9, 2019
ff93177
Merge branch 'master_2' into tensorflow
asuhan Oct 9, 2019
36676ae
[AutoDiff] Remap `apply` callee type in derivative context. (#27590)
dan-zheng Oct 9, 2019
fb6045c
[AutoDiff] Underscore the `Differentiable` protocol. (#27577)
dan-zheng Oct 9, 2019
d0c2b73
Update the llvm and clang versions
asuhan Oct 9, 2019
5884af5
Remove now broken llvm/IR/TypeBuilder.h include
asuhan Oct 9, 2019
eeeeee2
[AutoDiff] Remove differentiation order from AD-related instructions.…
rxwei Oct 10, 2019
65813f2
Fix ClangImporter
asuhan Oct 10, 2019
0aee08a
[AutoDiff] Rename "assocFn" to "derivativeFn" everywhere except Diffe…
bgogul Oct 10, 2019
431cc43
[AutoDiff] Rename "associated function" to "derivative function". (#2…
rxwei Oct 10, 2019
ced939b
[AutoDiff] Fix subset parameters thunk `partial_apply` substitutions.…
dan-zheng Oct 10, 2019
9886b63
[AutoDiff] Rename 'AutoDiffIndexSubset' to 'IndexSubset'. (#27615)
rxwei Oct 11, 2019
68b96a2
[AutoDiff] Type-check `@differentiable` attributes during validation.…
dan-zheng Oct 11, 2019
5ce6f17
Merge branch 'master_3' into tensorflow
asuhan Oct 11, 2019
3692167
Merge branch 'master_4' into tensorflow
asuhan Oct 11, 2019
483a378
[AutoDiff] NFC: Move some 'IndexSubset' method impls to their own fil…
rxwei Oct 11, 2019
6cc8406
Fix conformance lookup within `DifferentiableActivityInfo`.
dan-zheng Oct 11, 2019
a9ad846
Mark test/SILOptimizer/diagnostic_constant_propagation.swift as XFAIL.
dan-zheng Oct 11, 2019
7e03973
[AutoDiff] Fix 'autodiff_function_extract' operand ownership kind. (#…
rxwei Oct 12, 2019
65ebee0
[AutoDiff] Fix `@differentiable(linear)` type parsing ambiguity. (#27…
rxwei Oct 12, 2019
9c76a29
[AutoDiff] Add `@differentiable` attribute SILGen assertion. (#27650)
dan-zheng Oct 13, 2019
a5dc918
[AutoDiff] Add SIL differentiability witnesses. (#27487)
dan-zheng Oct 13, 2019
98f3545
[NFC] [AutoDiff] Gardening. (#27651)
dan-zheng Oct 13, 2019
db95e53
[AutoDiff] [ASTGen] Check for 'linear' when generating 'AttributedTyp…
rxwei Oct 14, 2019
5e52226
[AutoDiff] [Serialization] Fix '@differentiable(linear)' SIL function…
rxwei Oct 14, 2019
4a4fe83
[AutoDiff] [IRGen] Lower `@differentiable(linear)` function types. (#…
rxwei Oct 14, 2019
29562c9
fix @differentiable(linear) type attr parsing (#27669)
Oct 14, 2019
14ba7c0
Merge branch 'master_5' into tensorflow-merge
asuhan Oct 15, 2019
c8c7c1f
Fix more merge damage
asuhan Oct 15, 2019
740b63e
[AutoDiff] Introduce 'linear_function' and 'linear_function_extract' …
rxwei Oct 15, 2019
3236d2d
Merge branch 'master_6' into tensorflow-merge
asuhan Oct 15, 2019
d49bcb9
Merge branch 'master_final' into tensorflow-merge
asuhan Oct 15, 2019
bb67311
[AutoDiff] Diagnose unsupported forward-mode control flow. (#27684)
dan-zheng Oct 15, 2019
504b794
[AutoDiff] Support '@differentiable(linear)' function conversion. (#2…
rxwei Oct 15, 2019
aac5aef
Fix more merge damage
asuhan Oct 15, 2019
1e4552c
[AutoDiff] NFC: Change `DifferentiableFunctionExtractee` to a top-lev…
rxwei Oct 15, 2019
9a55bc3
[AutoDiff] [Docs] NFC: Fix 'linear_function' syntax documentation. (#…
rxwei Oct 15, 2019
b987d64
[AutoDiff] Fix build failure introduced in #27688. (#27691)
rxwei Oct 15, 2019
bafacd8
[AutoDiff] [SIL] Tweak 'differentiable_function' syntax. (#27689)
rxwei Oct 15, 2019
0474bbf
Update lldb dependency
asuhan Oct 15, 2019
ac4af41
Merge pull request #27693 from apple/asuhan/tensorflow-merge
asuhan Oct 15, 2019
28c9c34
Update lldb dependency
asuhan Oct 15, 2019
0d17ddf
[AutoDiff] Destroy all pullback indirect results after adjoint accumu…
rxwei Oct 16, 2019
76729c4
[AutoDiff] SILGen differentiability witnesses. (#27652)
dan-zheng Oct 16, 2019
cf1906c
Merge pull request #27710 from apple/asuhan/tensorflow-merge
asuhan Oct 16, 2019
d93efc1
[AutoDiff] Add differentiability witness SILGen test. (#27717)
dan-zheng Oct 16, 2019
a1d9369
Remove references to VectorProtocol from AD tests. (#27734)
bgogul Oct 17, 2019
7fdc5d0
[AutoDiff] Add cloned curry thunks to generated function list. (#27720)
dan-zheng Oct 17, 2019
b575448
Rewrite some of the AD tests with Tracked<Float> (#27733)
bgogul Oct 17, 2019
117cf39
Merge branch 'tensorflow' into tensorflow-merge
asuhan Oct 16, 2019
92b0f22
[AutoDiff] Clean up. (#27718)
dan-zheng Oct 17, 2019
26c8f07
Merge pull request #27745 from apple/asuhan/tensorflow-merge
dan-zheng Oct 17, 2019
d732fba
Merge branch 'tensorflow-merge' into asuhan/tensorflow
asuhan Oct 17, 2019
4ebb910
[AutoDiff] Add `differentiability_witness_function` instruction. (#27…
dan-zheng Oct 17, 2019
8a16dea
Merge branch 'tensorflow' into asuhan/tensorflow
asuhan Oct 17, 2019
fe96839
Merge pull request #27751 from apple/asuhan/tensorflow
rxwei Oct 17, 2019
7c384f8
[AutoDiff] SILGen derivative function thunks must not be transparent.…
dan-zheng Oct 17, 2019
5c03b64
[AutoDiff] Improve documentation for derivative function SILGen. (#27…
dan-zheng Oct 17, 2019
e9bfd14
[AD] Rewrite some of the tests with Tracked<Float> (2) (#27767)
bgogul Oct 18, 2019
f745587
[AutoDiff] NFC: Clean up print/dump utility functions. (#27772)
dan-zheng Oct 18, 2019
7e0faeb
[AutoDiff] Simplify logic for checking unmet generic requirements. (#…
dan-zheng Oct 19, 2019
519236c
[AutoDiff] Add loop differentiation negative testcases. (#27796)
dan-zheng Oct 19, 2019
0848df8
[AutoDiff] Mark SILGen derivative function thunks as "always inline".…
dan-zheng Oct 20, 2019
7498390
[AutoDiff] Add build-script flag for differentiable programming. (#27…
dan-zheng Oct 20, 2019
3e45b91
TF-917: fix irgen for witness method partial_apply (#27726)
Oct 21, 2019
2c5b430
Merge tag 'swift-DEVELOPMENT-SNAPSHOT-2019-10-13-a' into tensorflow-m…
saeta Oct 21, 2019
cfe04e9
Update update-checkout-config.json.
saeta Oct 21, 2019
558dcb8
Fix all merge conflicts.
saeta Oct 21, 2019
d93a9c0
Fix last merge conflict.
saeta Oct 21, 2019
398884c
Fixes to make the compiler build. (Note: tests are likely to fail.)
saeta Oct 21, 2019
7927f71
Make all-but-one tests pass. (The one failing test was failing before.)
saeta Oct 21, 2019
56e4de8
Require asserts for AD tests using the debug-only flag (#27824)
asuhan Oct 22, 2019
4ffc714
[AutoDiff] Use `GenericSignature` instead of `GenericSignatureImpl *`…
dan-zheng Oct 23, 2019
93d8d6c
Fix memory error in the implementation of IndexSubset. (#27850)
bgogul Oct 23, 2019
051e6e0
[AutoDiff] declaration-only `SILDifferentiabilityWitness` (#27854)
Oct 24, 2019
eaefd71
[TF-935] Replaces '-Xllvm -run-jvp-generation' by '-enable-experiment…
vguerra Oct 25, 2019
1862c95
Merge pull request #27821 from apple/tensorflow-merge2
pschuh Oct 25, 2019
54bdad6
[AutoDiff] Use `TransposingAttr::getParameterIndices`. (#27918)
dan-zheng Oct 29, 2019
e6ef70a
Merge tag 'swift-DEVELOPMENT-SNAPSHOT-2019-10-24-a' into tensorflow-m…
pschuh Oct 29, 2019
41015c3
[AutoDiff] DifferentiabilityWitnessFunctionInst stores pointer to wit…
Oct 29, 2019
fe89798
Fix compiler errors.
pschuh Oct 30, 2019
d23fa02
[AutoDiff] Re-enable LoadableByAddress. (#27923)
dan-zheng Oct 30, 2019
6b88071
Somtimes getModuleScopeContext() is not a FileUnit.
pschuh Oct 30, 2019
d4ca1ac
[AutoDiff] NFC: fix warning in DeserializeSIL.cpp. (#27968)
dan-zheng Oct 30, 2019
14d290a
Merge remote-tracking branch 'origin/master' into tensorflow-merge
pschuh Oct 30, 2019
eea3f7d
Fix TypeCheckAttr.cpp issues.
dan-zheng Oct 30, 2019
ebe9223
[AutoDiff] Add more loop differentiation negative testcases for TF-93…
dan-zheng Oct 31, 2019
07db198
[AutoDiff] NFC: remove unused parameter. (#27984)
dan-zheng Oct 31, 2019
12b9223
Clean up TypeCheckAttr.cpp.
dan-zheng Oct 31, 2019
aebad45
Merge branch 'tensorflow' of github.com:apple/swift into tensorflow-m…
dan-zheng Oct 31, 2019
b9ef133
Fix `@differentiable(linear)` parsing.
dan-zheng Oct 31, 2019
2adc320
No substitution maps for thunks.
pschuh Oct 31, 2019
e4c8c8e
[AutoDiff] Clean up `@transposing` attribute type-checking. (#27988)
dan-zheng Oct 31, 2019
38bc954
[AutoDiff] Store original declaration in `DifferentiableAttr`. (#27985)
dan-zheng Nov 1, 2019
0b2e3ef
Merge branch 'tensorflow' of github.com:apple/swift into tensorflow-m…
dan-zheng Nov 1, 2019
2f1306e
Add monorepo to update-checkout.
pschuh Nov 1, 2019
d6ff384
fix TF-489: stdlib ParseableInterface tests (#27971)
Nov 1, 2019
8a17205
[AutoDiff] Requestify `@differentiable` attribute parameter indices. …
dan-zheng Nov 1, 2019
738f232
Merge tag 'swift-DEVELOPMENT-SNAPSHOT-2019-10-31-a' into tensorflow-m…
pschuh Nov 2, 2019
7dd1ea2
Merge branch 'tensorflow-merge' of github.com:apple/swift into tensor…
pschuh Nov 2, 2019
8505fee
Update llvm-project to be a commit hash.
pschuh Nov 2, 2019
685b30c
Fix TensorFlow module compilation. (#28023)
dan-zheng Nov 4, 2019
28ce7af
Fix tensorflow_osx_base build preset. (#28018)
dan-zheng Nov 4, 2019
bbc1654
Update tensorflow-apis hash.
pschuh Nov 4, 2019
92b1f09
Merge fixes. (#28054)
dan-zheng Nov 5, 2019
04ec3b9
Update checkout for tensorflow-swift-quote. (#28070)
dan-zheng Nov 5, 2019
aacdf7a
Update checkout to swift-DEVELOPMENT-SNAPSHOT-2019-10-31-a.
dan-zheng Nov 5, 2019
c5b5e4a
Remove explicit `-enable-large-loadable-types` flag. (#28069)
dan-zheng Nov 5, 2019
012b992
Merge branch 'tensorflow' of github.com:apple/swift into tensorflow-m…
dan-zheng Nov 5, 2019
ca180f8
update llvm-project checkout commit hash
Nov 5, 2019
8254ae5
Update checkout for swift-syntax. (#28087)
dan-zheng Nov 5, 2019
f8f72fc
update commit hash for llvm-project
Nov 6, 2019
c3cdcba
update commit hash for swift-stress-tester
Nov 6, 2019
d1b06ba
fix lldb build-script-impl to be closer to upstream
Nov 6, 2019
27dfbd1
[AutoDiff] Move stdlib sources to stdlib/public/core/Differentiation.…
dan-zheng Nov 6, 2019
ba21f8d
Merge branch 'tensorflow' into tensorflow-merge
Nov 6, 2019
d11273b
fix lldb build-script-impl to be closer to upstream
Nov 6, 2019
b60de11
Fix gnu-anonmyous-struct warning. (#28115)
bgogul Nov 6, 2019
55d1070
[AutoDiff] Use PrettyStackTrace in differentiation transform. (#28117)
dan-zheng Nov 7, 2019
f54489f
Merge branch 'tensorflow' into tensorflow-merge
Nov 7, 2019
4d1c1df
Merge pull request #28080 from apple/tensorflow-merge
Nov 7, 2019
ac3cafe
Update checkout for tensorflow/swift-apis. (#28124)
dan-zheng Nov 7, 2019
d636456
[AutoDiff] IRGen differentiability witness tables (#28067)
Nov 7, 2019
3943c1e
Update checkout for tensorflow-swift-apis. (#28133)
dan-zheng Nov 7, 2019
473d2ee
[AutoDiff] Update `@differentiable` attribute API/ABI status. (#28148)
dan-zheng Nov 8, 2019
89078cc
[AutoDiff] Add tests. (#28150)
dan-zheng Nov 8, 2019
56548e0
Fix unused variable warning. (#28160)
dan-zheng Nov 9, 2019
e242a88
[AutoDiff] Revamp and fix variedness propagation in activity analysis…
dan-zheng Nov 11, 2019
14d6d31
Pull in the upstream @differentiable attribute changes (#28198)
bgogul Nov 12, 2019
bd156e3
[AutoDiff] Simplify varied propagation in activity analysis. (#28191)
dan-zheng Nov 12, 2019
3714ad9
[AutoDiff] Fix invalid `@differentiable` attribute SILGen crash. (#28…
dan-zheng Nov 12, 2019
317ef49
[AutoDiff] Destroy unused pullback direct results. (#28207)
dan-zheng Nov 12, 2019
439808d
[AutoDiff] Update `@differentiable` syntax. (#28212)
dan-zheng Nov 12, 2019
4016301
Merge tag 'swift-DEVELOPMENT-SNAPSHOT-2019-11-11-a' into tensorflow-m…
bgogul Nov 12, 2019
a6ae26e
Merging swift-DEVELOPMENT-SNAPSHOT-2019-11-11-a into tensorflow
bgogul Nov 12, 2019
7af00ee
[AutoDiff] Add negative tests for TF-954. (#28223)
dan-zheng Nov 13, 2019
414e029
[AutoDiff] Revamp usefulness propagation in activity analysis. (#28225)
dan-zheng Nov 13, 2019
e016e24
Remove TypeChecker from CheckCompilerAvailableBody.
bgogul Nov 13, 2019
16f0229
Fix compilation errors from the merge.
bgogul Nov 13, 2019
79b7231
[AutoDiff] NFC: IRGen gardening. (#28238)
dan-zheng Nov 13, 2019
3b934c5
[AutoDiff] add negative tests found by random code generator (#28219)
Nov 13, 2019
54ba428
[AutoDiff] Emit SIL diff witnesses into original function's IRGenModu…
dan-zheng Nov 14, 2019
d89e9d1
[AutoDiff] NFC: gardening. (#28251)
dan-zheng Nov 14, 2019
8f1de30
[AutoDiff] Add negative test for TF-962. (#28252)
dan-zheng Nov 14, 2019
6683ee0
Renumber some attributes in Attr.def to avoid duplicate values.
bgogul Nov 14, 2019
8335d69
Fix uses of diagnose to ASTContext::Diags::diagnose.
bgogul Nov 14, 2019
a532555
update llvm-project commit hash to the merged version.
bgogul Nov 14, 2019
90ff44b
[AutoDiff] Add negative test for TF-922. (#28256)
dan-zheng Nov 14, 2019
a69efd1
More fixes for TC.Context.
bgogul Nov 14, 2019
0a7d7eb
[Doc] Add link to GPU build status to README.md (#26020)
Vooblin Nov 14, 2019
da6ecc6
[AutoDiff] Fix adjoint value propagation for basic block arguments. (…
dan-zheng Nov 14, 2019
3a845ba
[AutoDiff] Add negative tests for TF-952. (#28258)
dan-zheng Nov 14, 2019
b9d1839
Fix `WhereClauseOwner::getRequirements`.
dan-zheng Nov 14, 2019
e1f3938
Default `EnableExperimentalDifferentiableProgramming` to true.
dan-zheng Nov 14, 2019
79160af
[AutoDiff] Fix over-consume when differentiating `tuple` instruction.…
rxwei Nov 15, 2019
22ab723
[AutoDiff] Fix usefulness propagation for array literal initializatio…
dan-zheng Nov 15, 2019
8796230
[AutoDiff] Fix `destructure_tuple` differentiation. (#28281)
dan-zheng Nov 15, 2019
04dca63
[AutoDiff] Fix activity analysis use-after-free crash. (#28285)
dan-zheng Nov 15, 2019
7a49137
Remove Differentiation from lookup.
bgogul Nov 15, 2019
30d51cb
Change expected error messages to match the expectations in master.
bgogul Nov 15, 2019
3b33b83
Remove "do you want to add protocol stubs" note from expectations.
bgogul Nov 15, 2019
7d91ebc
[AutoDiff] NFC: Fix pretty stack trace locations. (#28312)
dan-zheng Nov 17, 2019
479ce07
Fix for TF-971.
bgogul Nov 16, 2019
ec63a6e
Put back changes related to generic builtins.
bgogul Nov 18, 2019
b36e7ba
Fix tests to match off-by-one line number in error messages.
bgogul Nov 18, 2019
ddf6c51
Disable differentiable_features_disabled.swift in tensorflow branch.
bgogul Nov 18, 2019
3c90afb
Update dependencies to new snapshot version 'swift-DEVELOPMENT-SNAPSH…
bgogul Nov 18, 2019
9c929d4
[AutoDiff] IRGen differentiability_witness_function (#28331)
Nov 18, 2019
f5f7dd8
[AutoDiff] Revamp array literal initialization differentiation. (#28320)
dan-zheng Nov 19, 2019
2d702b3
[test] type_checker_perf test rdar33688063 still fails, let's disable it
xymus Nov 11, 2019
3f7d4c1
Pull in the upstream @differentiable attribute changes (#28198)
bgogul Nov 12, 2019
43041ee
[AutoDiff] Simplify varied propagation in activity analysis. (#28191)
dan-zheng Nov 12, 2019
a58b1df
[AutoDiff] Fix invalid `@differentiable` attribute SILGen crash. (#28…
dan-zheng Nov 12, 2019
711591e
[AutoDiff] Destroy unused pullback direct results. (#28207)
dan-zheng Nov 12, 2019
ca9a6a6
[AutoDiff] Update `@differentiable` syntax. (#28212)
dan-zheng Nov 12, 2019
d0fb9fc
[AutoDiff] Add negative tests for TF-954. (#28223)
dan-zheng Nov 13, 2019
3a5e486
[AutoDiff] Revamp usefulness propagation in activity analysis. (#28225)
dan-zheng Nov 13, 2019
163429e
[AutoDiff] NFC: IRGen gardening. (#28238)
dan-zheng Nov 13, 2019
0b23743
[AutoDiff] add negative tests found by random code generator (#28219)
Nov 13, 2019
250fd3f
[AutoDiff] Emit SIL diff witnesses into original function's IRGenModu…
dan-zheng Nov 14, 2019
0267c13
[AutoDiff] NFC: gardening. (#28251)
dan-zheng Nov 14, 2019
1d0861f
[AutoDiff] Add negative test for TF-962. (#28252)
dan-zheng Nov 14, 2019
ac86195
[AutoDiff] Add negative test for TF-922. (#28256)
dan-zheng Nov 14, 2019
38ae5cd
[Doc] Add link to GPU build status to README.md (#26020)
Vooblin Nov 14, 2019
1f836b3
[AutoDiff] Fix adjoint value propagation for basic block arguments. (…
dan-zheng Nov 14, 2019
a4e43c9
[AutoDiff] Add negative tests for TF-952. (#28258)
dan-zheng Nov 14, 2019
bc2fd6b
[AutoDiff] Fix over-consume when differentiating `tuple` instruction.…
rxwei Nov 15, 2019
b5916ef
[AutoDiff] Fix usefulness propagation for array literal initializatio…
dan-zheng Nov 15, 2019
6390811
[AutoDiff] Fix `destructure_tuple` differentiation. (#28281)
dan-zheng Nov 15, 2019
c45a618
[AutoDiff] Fix activity analysis use-after-free crash. (#28285)
dan-zheng Nov 15, 2019
801642e
[AutoDiff] NFC: Fix pretty stack trace locations. (#28312)
dan-zheng Nov 17, 2019
f8d1b4c
[AutoDiff] IRGen differentiability_witness_function (#28331)
Nov 18, 2019
41b0ef0
Fix assertion failure in swift quotes.
bgogul Nov 19, 2019
958ecc6
[AutoDiff] Fix variedness propagation for `apply` inout arguments. (#…
dan-zheng Nov 19, 2019
0f13e79
update checkout for llvm-project
Nov 19, 2019
9600858
Merge branch 'tensorflow' of github.com:apple/swift into tensorflow-m…
dan-zheng Nov 20, 2019
8ff83a3
[AutoDiff] Clean up parsing and printing. (#28376)
dan-zheng Nov 20, 2019
9c79811
[AutoDiff] Defines remaining derivatives for tgmath functions. (#28108)
vguerra Nov 20, 2019
3880378
[AutoDiff] differentiability witness wrt params test (#28389)
Nov 20, 2019
bcbe65e
[AutoDiff] diff wit silgen: type simplification, getters (#28398)
Nov 21, 2019
46b7a58
Merge pull request #28344 from apple/tensorflow-merge
dan-zheng Nov 21, 2019
b41adcd
[AutoDiff] populate diff witnesses during differentiation (#28402)
Nov 21, 2019
b973555
[AutoDiff] Minor activity analysis changes. (#28409)
dan-zheng Nov 21, 2019
6104e74
[AutoDiff] Update API/ABI status for attributes. (#28410)
dan-zheng Nov 21, 2019
9775a1a
Add `REQUIRES: asserts` to activity_analysis.swift (#28428)
bgogul Nov 22, 2019
ad54102
[AutoDiff] Improve diagnostic for multiple active results. (#28429)
dan-zheng Nov 22, 2019
51fe5e1
[AutoDiff] NFC: fix incorrect JIRA issue reference. (#28437)
dan-zheng Nov 22, 2019
dd47de3
Update checkout for tensorflow-swift-apis. (#28448)
dan-zheng Nov 23, 2019
21a4bc5
[AutoDiff] Fix differentiability witness SIL serialization. (#28463)
dan-zheng Nov 24, 2019
e0789da
Add builtin functions that construct a `@differentiable` or `@differe…
rxwei Nov 25, 2019
e90816b
[AutoDiff] Clean up differentiation-related attributes. (#28466)
dan-zheng Nov 25, 2019
9853570
[AutoDiff] Add 'Builtin.applyTranspose*'. (#28469)
rxwei Nov 25, 2019
0e8a67f
[AutoDiff] Imply 'AdditiveArithmetic' generic constraints from '@diff…
rxwei Nov 25, 2019
e1514cf
[AutoDiff] Make `transpose(of:)` available. (#28471)
rxwei Nov 25, 2019
64361eb
[AutoDiff] Update `differentiableFunction(from:)` to use differentiab…
rxwei Nov 25, 2019
658b7f7
[AutoDiff] Support derivative registration for more declaration kinds…
dan-zheng Nov 25, 2019
b935486
[AutoDiff] Rename `@differentiating` to `@derivative(of:)`. (#28481)
dan-zheng Nov 26, 2019
a946ec9
[AutoDiff] Fix aggregate adjoint value accumulation bug. (#28477)
bgogul Nov 26, 2019
682958a
[AutoDiff] Add `Differentiable.zeroTangentVectorInitializer`. (#28416)
dan-zheng Nov 26, 2019
a1aace2
[AutoDiff] Ban local-scope derivative registration. (#28483)
rxwei Nov 26, 2019
82db8fa
[AutoDiff] devirtualize diff witnesses (#28480)
Nov 26, 2019
b9499c3
[AutoDiff] Rename `@transposing` to `@transpose(of:)`. (#28488)
dan-zheng Nov 27, 2019
8a45cbb
[AutoDiff] Fix `@differentiable` attribute type-checking crash. (#28490)
dan-zheng Nov 27, 2019
24d48ca
[AutoDiff] Fix differentiation of tuples with single differentiable e…
dan-zheng Nov 27, 2019
81bcd32
[AutoDiff] Fix unsilenceable `@noDerivative` warning. (#28494)
dan-zheng Nov 28, 2019
e80ab52
[stdlib] Make Dictionary's KeyPathIterable conformance use indices. (…
rxwei Nov 28, 2019
f8c773b
[AutoDiff] make diff_wit_fns instead of fn_refs (#28451)
Nov 29, 2019
cd4a6ba
[AutoDiff] Add `differentiability_witness_function` verification. (#2…
dan-zheng Nov 29, 2019
8d84fa3
Update checkout for tensorflow-swift-apis. (#28499)
dan-zheng Nov 30, 2019
4f0153d
[AutoDiff] Make 'AnyDerivative' '@frozen'. (#28518)
rxwei Dec 2, 2019
77b7d0f
Include AnyDerivative in type calculation.
rxwei Dec 1, 2019
12650a6
Update the type signature of AD builtins.
rxwei Dec 1, 2019
a1b77a8
Attempt to fix SILGen SILGen linear map thunks.
rxwei Dec 1, 2019
6868331
Fix SILGen linear map thunks.
rxwei Dec 2, 2019
0ffd1a8
Calculate derivative types with context tangents when emitting '@diff…
rxwei Dec 2, 2019
0856cc6
Change differential/pullback SIL function types in the transform.
rxwei Dec 2, 2019
9061541
Fix subset parameter differential thunks.
rxwei Dec 2, 2019
c915a76
Fix derivative witness types.
rxwei Dec 2, 2019
c7b40c0
Fix FileCheck tests in simple_math.swift.
rxwei Dec 2, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -18,6 +18,7 @@
# vim swap files
.*.sw[a-z]
.sw?
*.vscode

#==============================================================================#
# Explicit files to ignore (only matches one).
Expand Down
22 changes: 22 additions & 0 deletions CMakeLists.txt
Expand Up @@ -67,6 +67,10 @@ option(SWIFT_BUILD_STDLIB_EXTRA_TOOLCHAIN_CONTENT
"If not building stdlib, controls whether to build 'stdlib/toolchain' content"
TRUE)

option(SWIFT_ENABLE_TENSORFLOW
"Enable TensorFlow in the compiler and build the Swift TensorFlow library"
FALSE)

# In many cases, the CMake build system needs to determine whether to include
# a directory, or perform other actions, based on whether the stdlib or SDK is
# being built at all -- statically or dynamically. Please note that these
Expand Down Expand Up @@ -348,6 +352,19 @@ option(SWIFT_REPORT_STATISTICS
"Create json files which contain internal compilation statistics"
FALSE)

#
# User-configurable TensorFlow specific options.
#
set(SWIFT_TENSORFLOW_HOST_LIB_DIR "" CACHE PATH
"If set, directory with TensorFlow host libraries to be linked into swiftc.")
set(SWIFT_TENSORFLOW_TARGET_LIB_DIR "" CACHE PATH
"If set, directory with TensorFlow target libraries to be linked into swift programs.")

set(SWIFT_TENSORFLOW_HOST_INCLUDE_DIR "" CACHE PATH
"If set, directory with host TensorFlow headers.")
set(SWIFT_TENSORFLOW_TARGET_INCLUDE_DIR "" CACHE PATH
"If set, directory with target TensorFlow headers.")

#
# User-configurable experimental options. Do not use in production builds.
#
Expand Down Expand Up @@ -1083,6 +1100,11 @@ if(SWIFT_NEED_EXPLICIT_LIBDISPATCH)
${SWIFT_PATH_TO_LIBDISPATCH_SOURCE})
endif()

# Enable TensorFlow in compiler code.
if(SWIFT_ENABLE_TENSORFLOW)
add_definitions(-DSWIFT_ENABLE_TENSORFLOW)
endif()

# Add all of the subdirectories, where we actually do work.

###############
Expand Down
24 changes: 20 additions & 4 deletions CONTRIBUTING.md
Expand Up @@ -5,7 +5,23 @@ license](https://swift.org/LICENSE.txt).

---

Before submitting the pull request, please make sure you have [tested your
changes](https://github.com/apple/swift/blob/master/docs/ContinuousIntegration.md)
and that they follow the Swift project [guidelines for contributing
code](https://swift.org/contributing/#contributing-code).
Before submitting a pull request, please make sure that your changes follow the
[Swift project guidelines for contributing code](https://swift.org/contributing/#contributing-code).

We request that code changes unrelated to Swift for TensorFlow be submitted to
the [upstream Swift repository](https://github.com/apple/swift). For example,
code formatting changes that do not affect Swift for TensorFlow source code
should be submitted upstream.

It is a good idea to discuss any non-trivial submissions with the project
maintainers before submitting a pull request: please join the
[swift@tensorflow.org](https://groups.google.com/a/tensorflow.org/d/forum/swift)
mailing list to participate in discussions.

All changes to existing Swift source code should be marked clearly with a
`SWIFT_ENABLE_TENSORFLOW` comment at the top of every diff hunk. This makes
it easier to merge from upstream.

Continuous integration (CI) is still being set up, so if you submit a pull
request with non-trivial changes that require test coverage, please anticipate
some delay before we can properly review and merge it.
259 changes: 122 additions & 137 deletions README.md

Large diffs are not rendered by default.

52 changes: 52 additions & 0 deletions cmake/modules/AddSwift.cmake
Expand Up @@ -676,6 +676,9 @@ endfunction()
# [SWIFT_COMPILE_FLAGS flag1...]
# [LINK_FLAGS flag1...]
# [FILE_DEPENDS target1 ...]
# SWIFT_ENABLE_TENSORFLOW
# [EXTRA_RPATHS rpath1 ...]
# END SWIFT_ENABLE_TENSORFLOW
# [DONT_EMBED_BITCODE]
# [IS_STDLIB]
# [FORCE_BUILD_OPTIMIZED]
Expand Down Expand Up @@ -732,6 +735,11 @@ endfunction()
# FILE_DEPENDS
# Additional files this library depends on.
#
# SWIFT_ENABLE_TENSORFLOW
# EXTRA_RPATHS
# List of directories to add to this library's RPATH.
# END SWIFT_ENABLE_TENSORFLOW
#
# DONT_EMBED_BITCODE
# Don't embed LLVM bitcode in this target, even if it is enabled globally.
#
Expand Down Expand Up @@ -776,6 +784,9 @@ function(_add_swift_library_single target name)
C_COMPILE_FLAGS
DEPENDS
FILE_DEPENDS
# SWIFT_ENABLE_TENSORFLOW
EXTRA_RPATHS
# END SWIFT_ENABLE_TENSORFLOW
FRAMEWORK_DEPENDS
FRAMEWORK_DEPENDS_WEAK
GYB_SOURCES
Expand Down Expand Up @@ -1118,6 +1129,28 @@ function(_add_swift_library_single target name)
endif()
endif()

# SWIFT_ENABLE_TENSORFLOW
# Hande extra RPATHs.
set(local_rpath "")
if("${SWIFTLIB_SINGLE_SDK}" STREQUAL "LINUX" AND NOT "${SWIFTLIB_SINGLE_SDK}" STREQUAL "ANDROID")
set(local_rpath "$ORIGIN:/usr/lib/swift/linux")
elseif("${SWIFTLIB_SINGLE_SDK}" STREQUAL "CYGWIN")
set(local_rpath "$ORIGIN:/usr/lib/swift/cygwin")
endif()
foreach(rpath_element ${SWIFTLIB_SINGLE_EXTRA_RPATHS})
if("${local_rpath}" STREQUAL "")
set(local_rpath "${rpath_element}")
else()
set(local_rpath "${local_rpath}:${rpath_element}")
endif()
endforeach()
if(NOT "${local_rpath}" STREQUAL "")
set_target_properties("${target}"
PROPERTIES
INSTALL_RPATH "${local_rpath}")
endif()
# END SWIFT_ENABLE_TENSORFLOW

set_target_properties("${target}" PROPERTIES BUILD_WITH_INSTALL_RPATH YES)
set_target_properties("${target}" PROPERTIES FOLDER "Swift libraries")

Expand Down Expand Up @@ -2319,6 +2352,18 @@ function(_add_swift_executable_single name)
"-Xlinker" "@executable_path/../lib/swift/${SWIFT_SDK_${SWIFTEXE_SINGLE_SDK}_LIB_SUBDIR}")
endif()

# SWIFT_ENABLE_TENSORFLOW
set(swift_relative_library_path "../lib/swift/${SWIFT_SDK_${SWIFTEXE_SINGLE_SDK}_LIB_SUBDIR}")
is_darwin_based_sdk("${SWIFTEXE_SINGLE_SDK}" IS_DARWIN)
# NOTE: Adding "${SWIFTLIB_DIR}/.." to the rpath was necessary to fix linker
# errors for Syntax/Parser tests on Linux.
if("${SWIFTEXE_SINGLE_SDK}" STREQUAL "LINUX" AND NOT "${SWIFTEXE_SINGLE_SDK}" STREQUAL "ANDROID")
set(local_rpath "$ORIGIN:$ORIGIN/${swift_relative_library_path}:${SWIFTLIB_DIR}/..:/usr/lib/swift/linux")
elseif("${SWIFTEXE_SINGLE_SDK}" STREQUAL "CYGWIN")
set(local_rpath "$ORIGIN:$ORIGIN/${swift_relative_library_path}:${SWIFTLIB_DIR}/..:/usr/lib/swift/cygwin")
endif()
# END SWIFT_ENABLE_TENSORFLOW

_list_add_string_suffix(
"${SWIFTEXE_SINGLE_LINK_LIBRARIES}"
"-${SWIFT_SDK_${SWIFTEXE_SINGLE_SDK}_LIB_SUBDIR}-${SWIFTEXE_SINGLE_ARCHITECTURE}"
Expand Down Expand Up @@ -2386,6 +2431,13 @@ function(_add_swift_executable_single name)
endif()

set_target_properties(${name} PROPERTIES FOLDER "Swift executables")

# SWIFT_ENABLE_TENSORFLOW
if(NOT "${local_rpath}" STREQUAL "")
set_target_properties("${name}" PROPERTIES INSTALL_RPATH "${local_rpath}")
endif()
set_target_properties("${name}" PROPERTIES BUILD_WITH_INSTALL_RPATH YES)
# END SWIFT_ENABLE_TENSORFLOW
endfunction()

macro(add_swift_tool_subdirectory name)
Expand Down
23 changes: 23 additions & 0 deletions cmake/modules/FindTensorFlow.cmake
@@ -0,0 +1,23 @@
# SWIFT_ENABLE_TENSORFLOW
# Find TensorFlow.

include(FindPackageHandleStandardArgs)

find_path(TF_INCLUDE_DIR
NAMES third_party/tensorflow/c tensorflow/c
HINTS ${SWIFT_TENSORFLOW_TARGET_INCLUDE_DIR} /usr/include /usr/local/include)
if (EXISTS ${TF_INCLUDE_DIR}/third_party/tensorflow/c/c_api.h)
# This is experimental and not covered by CI.
set(TF_PATH_ADJUSTMENT "third_party")
else()
# Note: This is the normal workflow.
set(TF_PATH_ADJUSTMENT "")
endif()

find_library(TF_LIBRARY
NAMES tensorflow
HINTS ${SWIFT_TENSORFLOW_TARGET_LIB_DIR} /usr/lib /usr/local/lib)
set(TF_LIBRARIES ${TF_LIBRARY})

find_package_handle_standard_args(TensorFlow DEFAULT_MSG TF_INCLUDE_DIR TF_LIBRARIES)
mark_as_advanced(${TF_INCLUDE_DIR} ${TF_LIBRARIES})
21 changes: 17 additions & 4 deletions cmake/modules/SwiftSource.cmake
Expand Up @@ -228,8 +228,21 @@ function(_compile_swift_files

# The standard library and overlays are always built resiliently.
if(SWIFTFILE_IS_STDLIB)
list(APPEND swift_flags "-enable-library-evolution")
list(APPEND swift_flags "-Xfrontend" "-enable-ownership-stripping-after-serialization")
# SWIFT_ENABLE_TENSORFLOW
# FIXME(TF-328): Resilience is currently disabled for the TensorFlow module
# because it causes compilation to crash during IRGen.
# Also, disable resilience for DifferentiationUnittest because resilience
# changes generated AD code, leading to additional leaks.
if(NOT "${SWIFTFILE_MODULE_NAME}" STREQUAL "TensorFlow" AND
NOT "${SWIFTFILE_MODULE_NAME}" STREQUAL "DifferentiationUnittest")
list(APPEND swift_flags "-enable-library-evolution")
endif()
# FIXME(SR-11336): `-enable-ownership-stripping-after-serialization` for
# swiftCore causes test/AutoDiff/array.swift to crash, related to
# Array and key paths.
# Disabling the flag for swiftCore requires disabling the flag for all
# other standard library modules.
# list(APPEND swift_flags "-Xfrontend" "-enable-ownership-stripping-after-serialization")
endif()

if(SWIFT_STDLIB_USE_NONATOMIC_RC)
Expand Down Expand Up @@ -334,8 +347,8 @@ function(_compile_swift_files
endif()

if (NOT SWIFTFILE_IS_STDLIB_CORE)
list(APPEND swift_module_flags
"-Xfrontend" "-experimental-skip-non-inlinable-function-bodies")
# list(APPEND swift_module_flags
# "-Xfrontend" "-experimental-skip-non-inlinable-function-bodies")
endif()

# If we have extra regexp flags, check if we match any of the regexps. If so
Expand Down
15 changes: 14 additions & 1 deletion docs/ABI/Mangling.rst
Expand Up @@ -517,6 +517,12 @@ Types
FUNCTION-KIND ::= 'C' // C function pointer type
FUNCTION-KIND ::= 'A' // @auto_closure function type (escaping)
FUNCTION-KIND ::= 'E' // function type (noescape)
.. SWIFT_ENABLE_TENSORFLOW
FUNCTION-KIND ::= 'F' // @differentiable function type
FUNCTION-KIND ::= 'G' // @differentiable function type (escaping)
FUNCTION-KIND ::= 'H' // @differentiable(linear) function type
FUNCTION-KIND ::= 'I' // @differentiable(linear) function type (escaping)
.. SWIFT_ENABLE_TENSORFLOW END

function-signature ::= params-type params-type throws? // results and parameters

Expand Down Expand Up @@ -585,12 +591,19 @@ mangled in to disambiguate.
impl-function-type ::= type* 'I' FUNC-ATTRIBUTES '_'
impl-function-type ::= type* generic-signature 'I' PSEUDO-GENERIC? FUNC-ATTRIBUTES '_'

FUNC-ATTRIBUTES ::= CALLEE-ESCAPE? CALLEE-CONVENTION FUNC-REPRESENTATION? PARAM-CONVENTION* RESULT-CONVENTION* ('z' RESULT-CONVENTION)
.. SWIFT_ENABLE_TENSORFLOW
FUNC-ATTRIBUTES ::= CALLEE-ESCAPE? DIFFERENTIABILITY-KIND? CALLEE-CONVENTION FUNC-REPRESENTATION? PARAM-CONVENTION* RESULT-CONVENTION* ('z' RESULT-CONVENTION)

PSEUDO-GENERIC ::= 'P'

CALLEE-ESCAPE ::= 'e' // @escaping (inverse of SIL @noescape)

.. SWIFT_ENABLE_TENSORFLOW
DIFFERENTIABILITY-KIND ::= DIFFERENTIABLE | LINEAR
DIFFERENTIABLE ::= 'd' // @differentiable
LINEAR ::= 'l' // @differentiable(linear)
.. SWIFT_ENABLE_TENSORFLOW END

CALLEE-CONVENTION ::= 'y' // @callee_unowned
CALLEE-CONVENTION ::= 'g' // @callee_guaranteed
CALLEE-CONVENTION ::= 'x' // @callee_owned
Expand Down
16 changes: 15 additions & 1 deletion docs/ContinuousIntegration.md
Expand Up @@ -27,7 +27,21 @@ This page is designed to assist in the understanding of proper practices for tes

In order for the Swift project to be able to advance quickly, it is important that we maintain a green build [[1]](#footnote-1). In order to help maintain this green build, the Swift project heavily uses pull request (PR) testing. Specifically, an important general rule is that **all** non-trivial checkins to any Swift Project repository should at least perform a [smoke test](#smoke-testing) if simulators will not be impacted *or* a full [validation test](#validation-testing) if simulators may be impacted. If in addition one is attempting to make a source breaking change across multiple repositories, one should follow the cross repo source breaking changes workflow. We now continue by describing the Swift system for Pull Request testing, @swift-ci:

### @swift-ci
### @swift-ci (Swift for TensorFlow)


Platform | Comment
------------ | -------
All supported platforms | @swift-ci Please test tensorflow
All supported platforms | @swift-ci Please clean test tensorflow
Linux | @swift-ci Please test tensorflow Linux
Linux GPU | @swift-ci Please test tensorflow Linux GPU
macOS | @swift-ci Please test tensorflow macOS

Status can be checked at https://ci-external.swift.org/view/Pull%20Request/.


### @swift-ci (general Swift)

Users with [commit access](https://swift.org/contributing/#commit-access) can trigger pull request testing by writing a comment on a PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment used. The current test types are:

Expand Down