Commit Graph

2998 Commits

Author SHA1 Message Date
Brent Royal-Gordon
12286197c9 [NFC] Improvements suggested in code review
Thank you, @hamishknight and @varungandhi-apple.
2020-02-18 11:08:36 -08:00
Michael Gottesman
457b5ddaf2 Add guidance about cost of var boxes being captured by an escaping closure. 2020-02-17 23:34:56 -08:00
Luciano Almeida
a32e3f4598 [docs] Updating TypeChecker.rst 2020-02-16 18:41:57 -03:00
swift-ci
ea55a30253 Merge pull request #29439 from buttaface/doc 2020-02-14 09:18:52 -08:00
Dan Zheng
a49428ca7c [AutoDiff upstream] Add differentiability_witness_function instruction. (#29765)
The `differentiability_witness_function` instruction looks up a
differentiability witness function (JVP, VJP, or transpose) for a referenced
function via SIL differentiability witnesses.

Add round-trip parsing/serialization and IRGen tests.

Notes:
- Differentiability witnesses for linear functions require more support.
  `differentiability_witness_function [transpose]` instructions do not yet
  have IRGen.
- Nothing currently generates `differentiability_witness_function` instructions.
  The differentiation transform does, but it hasn't been upstreamed yet.

Resolves TF-1141.
2020-02-13 16:55:46 -08:00
Roopesh Chander
5e2fe48d3a [docs] Add a 'Memory usage' section to DevelopmentTips.md 2020-02-11 06:14:56 +00:00
Ben Rimmington
d30ea11d00 Update docs/HowSwiftImportsCAPIs.md
* Increase heading levels
* Update the introduction
* Use `Int` in `qsort` examples
* Use `CInt` in anonymous structs
* Use `CUnsignedInt` in enums
* De-dupe `HomeworkExcuse` enum
2020-02-07 17:42:16 +00:00
swift-ci
029afb15d6 Merge pull request #29431 from gribozavr/how-swift-imports-c 2020-02-06 06:08:32 -08:00
Dmitri Gribenko
fd88645cba Added a document that explains how Swift imports C modules 2020-02-06 13:28:37 +01:00
Dan Zheng
849bd62a26 [AutoDiff upstream] Add SIL differentiability witnesses. (#29623)
SIL differentiability witnesses are a new top-level SIL construct mapping
"original" SIL functions to derivative SIL functions.

SIL differentiability witnesses have the following components:
- "Original" `SILFunction`.
- SIL linkage.
- Differentiability parameter indices (`IndexSubset`).
- Differentiability result indices (`IndexSubset`).
- Derivative `GenericSignature` representing differentiability generic
  requirements (optional).
- JVP derivative `SILFunction` (optional).
- VJP derivative `SILFunction` (optional).
- "Is serialized?" bit.

This patch adds the `SILDifferentiabilityWitness` data structure, with
documentation, parsing, and printing.

Resolves TF-911.

Todos:
- TF-1136: upstream `SILDifferentiabilityWitness` serialization.
- TF-1137: upstream `SILDifferentiabilityWitness` verification.
- TF-1138: upstream `SILDifferentiabilityWitness` SILGen from
  `@differentiable` and `@derivative` attributes.
- TF-20: robust mangling for `SILDifferentiabilityWitness` names.
2020-02-04 12:53:27 -08:00
Saleem Abdulrasool
ec46f5b987 docs: update the repository name (NFC)
swift-windows was renamed to swift-build.  Update the repository name to
reflect that.
2020-02-01 18:19:42 -08:00
Butta
b516d1930a [Docs] [android] Update to the latest NDK 21, fix commands, and remove cruft 2020-01-25 06:12:39 +05:30
Michael Gottesman
c97a0cf2d6 [sil.rst] Clarify documentation around partial_apply closure contexts/closed over parameters. 2020-01-24 12:25:44 -08:00
Holly Borla
0c00d45d53 [CSDiag] Remove CalleeCandidateInfo::diagnoseSimpleErrors, which is
dead code now.
2020-01-22 10:57:52 -08:00
Holly Borla
86cf6dc03e [ConstraintSystem] Finish porting member failure diagnostics.
Remove special cases for AnyObject member and dynamic member lookup
failures - these are now all handled in the new diagnostic
infrastructure.
2020-01-22 10:57:52 -08:00
Richard Wei
dfb6f2078b [Docs] [AutoDiff] Allow implicitly inherited '@differentiable' on non-public declarations.
Currently, when a conforming type implements a `@differentiable` protocol requirement, the corresponding conforming implemnetation is required to have at least a `@differentiable` that covers all differentiability parameters in the protocol requirement.  However, this is not a great design for usability because developers almost always start with missing `@differentiable` and getting an compilation error.  This also makes ML models built with libraries that use differentiable programming more verbose than those built with other ML frameworks.

We agreed during this Friday's design review to allow `@differentiable` to be implicitly inherited from protocols when the conforming implementation is non-public.
2020-01-18 20:39:59 -08:00
swift-ci
1b0eee95e7 Merge pull request #28925 from apple/derivative-registration-typing-rules 2020-01-18 20:38:19 -08:00
Richard Wei
2a13bb0432 Remove duplicate paragraph. 2020-01-18 18:53:33 -08:00
Richard Wei
b5912e8267 Add missing 'T == T.TangentVector' requirement. 2020-01-18 18:50:50 -08:00
Richard Wei
893dd36327 Fix typo: 'foo' -> 'sinf' 2020-01-18 18:43:50 -08:00
Richard Wei
6df28a2816 Clarify the use of parameter indices and self. 2020-01-18 18:42:53 -08:00
Ross Bayer
bb4e5fe86b [Python: flake8] Appease the utils/python_lint.py script. 2020-01-17 01:03:20 -08:00
Karoy Lorentey
aadd5ef1bb Merge branch 'master' into stdlib-guide-update 2020-01-15 16:55:18 -08:00
Mishal Shah
6126fdbe3c Merge pull request #29125 from apple/hyp-patch-1
Mention where LLVM commits should go to in the branches document
2020-01-15 01:18:42 -08:00
Pavel Yaskevich
20443ad923 Merge pull request #29166 from xedin/port-array-dict-literal-diagnostics
[Diagnostics] Port diagnostics for array/dictionary literals
2020-01-13 16:40:32 -08:00
Pavel Yaskevich
07865c7948 [TypeChecker.rst] NFC: Mark that array/dictionary diagnostics have been ported 2020-01-13 12:42:48 -08:00
Dan Zheng
d8d0f902fc [Docs] [AutoDiff] Fix typos in differentiable programming manifesto.
Add sections:
- Effect on ABI stability
- Effect on API resilience

These sections were incorrectly formatted when converting the doc to Markdown.
2020-01-13 06:53:38 -08:00
Alex Lorenz
9c9528ab1d Mention specifically the Swift/vs non Swift llvm-project changes 2020-01-10 13:13:38 -08:00
Alex Lorenz
8b3cdb4b12 Mention where LLVM commits should go to in the branches document 2020-01-10 11:31:35 -08:00
Pavel Yaskevich
66fe1ec2b2 Merge pull request #29053 from xedin/port-ternary-diags
[Diagnostics] Detect and diagnose ternary branch type mismatches
2020-01-08 00:27:32 -08:00
Pavel Yaskevich
f85dfbb95a [TypeChecker.rst] NFC: Mark that if/ternary diagnostics have been ported 2020-01-07 13:50:53 -08:00
Saleem Abdulrasool
ab11bb68cd docs: remove unused file 2020-01-07 10:05:15 -08:00
yostane
8c2854f8f2 Added more details to "Building Swift on Windows" (#28496)
* Added more details to "Building Swift on Windows"
2020-01-07 10:03:43 -08:00
Saleem Abdulrasool
e3b58be4e7 Merge pull request #28997 from compnerd/git-cannot-be-subverted
docs: remove GitWorkflows
2020-01-05 09:38:16 -08:00
Cruz
3fda9059e1 [Docs] Update TypeChecker.rst document with lower cased of optional case 2020-01-04 14:01:31 +09:00
Saleem Abdulrasool
78de8f959d docs: remove GitWorkflows
The Swift project has entirely migrated to GitHub for development.  This
document covering the migration aspects of subversion are no longer
really relevant.  Prune the obsoleted documentation.
2020-01-03 13:51:40 -08:00
Saleem Abdulrasool
f3a264df0c Merge pull request #28969 from breandan/patch-1
Fix broken link
2020-01-02 12:10:32 -08:00
Robert Widmann
67b6afbe59 Merge pull request #28976 from kastiglione/patch-1
Minor syntax updates to OptimizationTips
2020-01-02 14:01:37 -05:00
Dave Lee
daadc3763d Minor syntax updates to OptimizationTips 2020-01-02 08:37:34 -08:00
Austin Conlon
efb5e1e70b Fix outdated mention of Bug Reporter
Bug Reporter is now Feedback Assistant.
2020-01-01 07:45:13 -08:00
breandan
03fbf6598c Fix broken link 2019-12-30 06:38:02 -05:00
Richard Wei
a8e233fe47 [Docs] [AutoDiff] Add derivative/transpose registration typing rules. 2019-12-22 12:21:35 -08:00
Prashant Rane
7466aa5f34 Fix a typo in ${NEW} variable in Post-processing tools for diagnostics section
While reading up I realized there is a typo in: `how to use  utils/process-stats-dir.py`. The example asks to use OLD and NEW compiler but the documentation uses only ${OLD} compiler in example
2019-12-14 16:26:55 +05:30
swift-ci
9424f44ac8 Merge pull request #28768 from rxwei/correct-ad-builtins 2019-12-13 02:31:50 -08:00
Richard Wei
d4eb63fa03 [Docs] [AutoDiff] Correct AD builtins.
* `Builtin.autodiffApply*` has been renamed to `Builtin.applyDerivative*`.
  * The reason I'm not adding `_jvp` is because there will no longer be `_vjp`, which will make this suffix entirely unnecessary.
* The transpose application builtin is named `Builtin.applyTranspose*`.
2019-12-12 23:09:06 -08:00
Richard Wei
aa5ad262d6 Update docs/DifferentiableProgramming.md
Co-Authored-By: Bart Chrzaszcz <bart.chr@gmail.com>
2019-12-12 15:29:45 -08:00
Richard Wei
b40f076c1e Update docs/DifferentiableProgramming.md
Co-Authored-By: Bart Chrzaszcz <bart.chr@gmail.com>
2019-12-12 14:33:18 -08:00
Richard Wei
df68958ee8 Address review feedback. 2019-12-12 13:47:13 -08:00
Richard Wei
ec887ccdd7 Fix mis-reverted merge. 2019-12-12 13:38:39 -08:00
Richard Wei
e3b129efc7 Fix typo. 2019-12-12 13:37:48 -08:00