{"action":"created","issue":{"url":"https://api.github.com/repos/apple/swift/issues/21274","repository_url":"https://api.github.com/repos/apple/swift","labels_url":"https://api.github.com/repos/apple/swift/issues/21274/labels{/name}","comments_url":"https://api.github.com/repos/apple/swift/issues/21274/comments","events_url":"https://api.github.com/repos/apple/swift/issues/21274/events","html_url":"https://github.com/apple/swift/pull/21274","id":390467237,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM4MjI3ODU5","number":21274,"title":" [AutoDiff] Teach AD to fill in `autodiff_function` with differentiation associated functions","user":{"login":"rxwei","id":856507,"node_id":"MDQ6VXNlcjg1NjUwNw==","avatar_url":"https://avatars0.githubusercontent.com/u/856507?v=4","gravatar_id":"","url":"https://api.github.com/users/rxwei","html_url":"https://github.com/rxwei","followers_url":"https://api.github.com/users/rxwei/followers","following_url":"https://api.github.com/users/rxwei/following{/other_user}","gists_url":"https://api.github.com/users/rxwei/gists{/gist_id}","starred_url":"https://api.github.com/users/rxwei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rxwei/subscriptions","organizations_url":"https://api.github.com/users/rxwei/orgs","repos_url":"https://api.github.com/users/rxwei/repos","events_url":"https://api.github.com/users/rxwei/events{/privacy}","received_events_url":"https://api.github.com/users/rxwei/received_events","type":"User","site_admin":false},"labels":[{"id":955546636,"node_id":"MDU6TGFiZWw5NTU1NDY2MzY=","url":"https://api.github.com/repos/apple/swift/labels/tensorflow","name":"tensorflow","color":"EF6C00","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-12-13T00:28:28Z","updated_at":"2018-12-13T00:35:26Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/apple/swift/pulls/21274","html_url":"https://github.com/apple/swift/pull/21274","diff_url":"https://github.com/apple/swift/pull/21274.diff","patch_url":"https://github.com/apple/swift/pull/21274.patch"},"body":"In raw SIL, `autodiff_function` does not have to contain associated functions and it acts as the trigger for differentiation. Once the AD transform is run, all `autodiff_function` functions will be canonicalized, containing the differentiation associated functions, i.e. the Jacobian-vector product (JVP) function and the vector-Jacobian product (VJP) function. As of now, we don't have the ability to generate or the need to use JVPs, so we use an `undef` and guarantee that it's never read by emitted code.\r\n\r\nHere's an example.\r\n\r\nBefore AD:\r\n\r\n```swift\r\n%diffFunc = autodiff_function [wrt 0] [order 1] %orig : $@convention(thin) (Float) -> Float\r\n```\r\n\r\nAfter AD:\r\n\r\n```swift\r\n%diffFunc = autodiff_function [wrt 0] [order 1] %orig : $@convention(thin) (Float) -> Float with {undef : $@convention(thin) (Float) -> (Float, @owned @callee_guaranteed (Float) -> Float), %vjp : $@convention(thin) (Float) -> (Float, @owned @callee_guaranteed (Float) -> Float)}\r\n```"},"comment":{"url":"https://api.github.com/repos/apple/swift/issues/comments/446798114","html_url":"https://github.com/apple/swift/pull/21274#issuecomment-446798114","issue_url":"https://api.github.com/repos/apple/swift/issues/21274","id":446798114,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0Njc5ODExNA==","user":{"login":"rxwei","id":856507,"node_id":"MDQ6VXNlcjg1NjUwNw==","avatar_url":"https://avatars0.githubusercontent.com/u/856507?v=4","gravatar_id":"","url":"https://api.github.com/users/rxwei","html_url":"https://github.com/rxwei","followers_url":"https://api.github.com/users/rxwei/followers","following_url":"https://api.github.com/users/rxwei/following{/other_user}","gists_url":"https://api.github.com/users/rxwei/gists{/gist_id}","starred_url":"https://api.github.com/users/rxwei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rxwei/subscriptions","organizations_url":"https://api.github.com/users/rxwei/orgs","repos_url":"https://api.github.com/users/rxwei/repos","events_url":"https://api.github.com/users/rxwei/events{/privacy}","received_events_url":"https://api.github.com/users/rxwei/received_events","type":"User","site_admin":false},"created_at":"2018-12-13T00:35:26Z","updated_at":"2018-12-13T00:35:26Z","author_association":"COLLABORATOR","body":"@swift-ci please test tensorflow Linux GPU"}}
{"actor":{"display_login":"rxwei"}}