pytorch/tools/codegen/api
Brian Hirsh 1a9efbbc92 generate inplace/out kernels for xla (#57510)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/57510

This is a re-write of https://github.com/pytorch/pytorch/pull/56835, which is significantly shorter thanks to the data model change in the PR below this one in the stack. See the original description in the linked PR for details.

The functional changes in this PR are the same as in the above linked one, so the description is the same with a few small changes:
- I don't bother generating `at::xla::{op}` entries for CPU fallbacks. After looking around, I see precedent for that. For example, we don't have `at::cpu::{op}` entries for composite ops- if you really want to bypass the dispatcher you need to call `at::compositeimplicitautograd::{op}`. Maybe we should revisit that later if we find an important use case for having full namespace coverage, but that doesn't seem worth half-fixing for external backends in this PR.

Test Plan: Imported from OSS

Reviewed By: navahgar

Differential Revision: D28474364

Pulled By: bdhirsh

fbshipit-source-id: 4d58b60e5debad6f1ff06420597d8df8505b2876
2021-05-17 12:25:38 -07:00
..
__init__.py
autograd.py Revert "Revert D28387764: Codegen inplace forward AD formula from out of place one if needed" (#58231) 2021-05-14 08:35:38 -07:00
cpp.py Reland of "D27708346: generate xla codegen in-tree" (#56601) 2021-04-21 19:36:31 -07:00
dispatcher.py Reland of "D27708346: generate xla codegen in-tree" (#56601) 2021-04-21 19:36:31 -07:00
meta.py Un-ignore F403 in .flake8 (#55838) 2021-04-13 09:24:07 -07:00
native.py [PyTorch] Fix const correctness for resize native functions (#55351) 2021-04-21 14:51:41 -07:00
python.py add C++ namespacing logic to ctypes (#55047) 2021-04-16 11:43:06 -07:00
structured.py split out NamedCType from CType. Remove direct string comparison from autograd codegen (#55334) 2021-04-16 11:43:08 -07:00
translate.py split out NamedCType from CType. Remove direct string comparison from autograd codegen (#55334) 2021-04-16 11:43:08 -07:00
types.py generate inplace/out kernels for xla (#57510) 2021-05-17 12:25:38 -07:00