swift
68dcf843 - [AutoDiff] Support differentiation of side effects. (#22057)

Commit
6 years ago
[AutoDiff] Support differentiation of side effects. (#22057) * [AutoDiff] Support differentiation of side effects. This patch adds support for differentiating through reads and writes from/to `var`s. Specifically, what made this possible is a set of differentiation rules for side-effecting operations: `alloc_stack`, `dealloc_stack`, `begin_access`, `end_access`, `load`, `store`, etc. This patch also fixes the following minor bugs: * When `AdjointEmitter::getAdjointValue` creates a default adjoint value, correctly remap the original type to get rid of archetypes. * Handle more reference counting instructions. * Emit better diagnostics for not being able to differentiate writes to global variables and to mutable captures. Note: * Temporarily allow memory leaks to unblock progress/fix tests.
Author
Parents
  • include/swift/AST
    • File
      DiagnosticsSIL.def
  • lib/SILOptimizer/Mandatory
    • File
      Differentiation.cpp
  • test
    • AutoDiff
      • File
        side_effects.swift
      • File
        simple_math.swift
    • TensorFlowRuntime
      • File
        tensor_autodiff_runtime.swift
Loading