Brian Hirsh
7b3a0ff87a
Port index.Tensor to structured kernels.
...
Tracking issue: #55070
Pull Request resolved: https://github.com/pytorch/pytorch/pull/69607
Approved by: https://github.com/bdhirsh
2022-06-10 17:27:47 +00:00
PyTorch MergeBot
4b82ef7928
Revert "Port index.Tensor to structured kernels."
...
This reverts commit cfd84125bd .
Reverted https://github.com/pytorch/pytorch/pull/69607 on behalf of https://github.com/zengk95 due to This is breaking mac trunk tests cfd84125bd
2022-06-08 20:16:10 +00:00
Brian Hirsh
cfd84125bd
Port index.Tensor to structured kernels.
...
Tracking issue: #55070
Pull Request resolved: https://github.com/pytorch/pytorch/pull/69607
Approved by: https://github.com/bdhirsh
2022-06-08 18:17:52 +00:00
PyTorch MergeBot
bcb424c8cf
Fix #78675
...
Signed-off-by: Edward Z. Yang <ezyangfb.com>
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78699
Approved by: https://github.com/tugsbayasgalan
2022-06-04 01:07:24 +00:00
PyTorch MergeBot
fca1f495c2
Revert "Port index.Tensor to structured kernels."
...
This reverts commit 9fe6f1baf5 .
Reverted https://github.com/pytorch/pytorch/pull/69607 on behalf of https://github.com/suo due to this broke master, see: 9fe6f1baf5
2022-06-01 00:12:15 +00:00
Brian Hirsh
9fe6f1baf5
Port index.Tensor to structured kernels.
...
Tracking issue: #55070
Pull Request resolved: https://github.com/pytorch/pytorch/pull/69607
Approved by: https://github.com/bdhirsh
2022-05-31 22:15:20 +00:00
Antonio Kim
02c4d877b4
Codegen Non-Native IR Nodes ( #76535 )
...
Add codegen infrastructure to generate IR nodes for non-native ops.
The proposed change is to add a `non_native` key to the `{backend}_native_functions.yaml` file that contains schema definitions similar to what is found in `native_functions.yaml`. e.g.
```
non_native:
...
- func: expand(Tensor input, int[] size, bool is_scalar_expand) -> Tensor
...
```
these definitions are parsed into a `LazyIrSchema` that can be used for generating IR nodes using `GenLazyIR`.
Fixes #74628
CC: @wconstab @desertfire @henrytwo
Pull Request resolved: https://github.com/pytorch/pytorch/pull/76535
Approved by: https://github.com/wconstab
2022-05-24 19:29:23 +00:00
Mengwei Liu
9e806619cc
[Codegen] Remove view operator check in NativeFunctionGroups and allow skipping native function generation ( #78145 )
...
Summary:
This PR adds two features:
* A boolean to turn off native function generation in codegen
* Relaxing `view` operator check for `NativeFunctionGroups`
Differential Revision: D36604646
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78145
Approved by: https://github.com/iseeyuan , https://github.com/bdhirsh
2022-05-24 05:48:30 +00:00
Brian Hirsh
0161e9eb00
[test] attempt to functionalize ops with mutable positional-only args
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/76320
Approved by: https://github.com/ezyang
2022-05-19 18:50:34 +00:00
Edward Z. Yang
befa4e371e
Fix typo
...
Fixes #77412
Signed-off-by: Edward Z. Yang <ezyangfb.com>
Pull Request resolved: https://github.com/pytorch/pytorch/pull/77488
Approved by: https://github.com/mruberry
2022-05-18 18:25:54 +00:00
Kulin Seth
f348b1b2b5
Add the Runtime components for MPS backend. ( #76725 )
...
The PR adds the runtime components and few basic operations like copy, as_strided for MPS backend.
Current list of identified TODOs are:
- https://github.com/pytorch/pytorch/issues/77176
- Unify the logic with CUDACachingAllocator and remove redundant code.
- https://github.com/pytorch/pytorch/issues/77170
- Look into using C++ smart pointers where possible with ObjC code
- Use empty_strided_generic() to implement the `empty_strided_mps` code
- https://github.com/pytorch/pytorch/issues/77144
Pull Request resolved: https://github.com/pytorch/pytorch/pull/76725
Approved by: https://github.com/albanD
2022-05-11 17:19:45 +00:00
Peter Bell
6df5a53127
Fix unmarked fstring
...
This error message currently prints the format string literally, because the string isn't marked with the `f`.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/76841
Approved by: https://github.com/bdhirsh
2022-05-04 21:18:05 +00:00
anjali411
b204ad863f
Revert "Revert "Allow specifying tags for aten operators in native_functions.yaml""
...
This reverts commit ea44645c9a .
Pull Request resolved: https://github.com/pytorch/pytorch/pull/76456
Approved by: https://github.com/osalpekar
2022-04-28 02:04:57 +00:00
Brian Hirsh
74e93f727a
remove _is_foreach_op codegen special cases, clean up mutable return type checks
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/76190
Approved by: https://github.com/ezyang
2022-04-25 21:34:17 +00:00
Brian Hirsh
7d44b3675b
functionalization: add support for zero_()
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/75913
Approved by: https://github.com/albanD
2022-04-25 21:31:48 +00:00
Edward Yang
36420b5e8c
Rename tools/codegen to torchgen ( #76275 )
...
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/76275
In preparation for addressing
https://github.com/pytorch/pytorch/issues/73212
Diff was generated with:
```
git mv tools/codegen torchgen
git grep -l 'tools.codegen' | xargs sed -i 's/tools.codegen/torchgen/g'
sed -i "s/\${TOOLS_PATH}\/codegen/\${TORCH_ROOT}\/torchgen/g" caffe2/CMakeLists.txt
```
and a manual edits to:
* tools/test/test_gen_backend_stubs.py
* torchgen/build.bzl
* torchgen/gen_backend_stubs.py
aka this diff:
```
diff --git a/tools/test/test_gen_backend_stubs.py b/tools/test/test_gen_backend_stubs.py
index 3dc26c6d2d..104054575e 100644
--- a/tools/test/test_gen_backend_stubs.py
+++ b/tools/test/test_gen_backend_stubs.py
@@ -9,7 +9,7 @@ from torchgen.gen_backend_stubs import run
from torchgen.gen import _GLOBAL_PARSE_NATIVE_YAML_CACHE # noqa: F401
path = os.path.dirname(os.path.realpath(__file__))
-gen_backend_stubs_path = os.path.join(path, '../torchgen/gen_backend_stubs.py')
+gen_backend_stubs_path = os.path.join(path, '../../torchgen/gen_backend_stubs.py')
# gen_backend_stubs.py is an integration point that is called directly by external backends.
# The tests here are to confirm that badly formed inputs result in reasonable error messages.
diff --git a/torchgen/build.bzl b/torchgen/build.bzl
index ed04e35a43..d00078a3cf 100644
--- a/torchgen/build.bzl
+++ b/torchgen/build.bzl
@@ -1,6 +1,6 @@
def define_targets(rules):
rules.py_library(
- name = "codegen",
+ name = "torchgen",
srcs = rules.glob(["**/*.py"]),
deps = [
rules.requirement("PyYAML"),
@@ -11,6 +11,6 @@ def define_targets(rules):
rules.py_binary(
name = "gen",
- srcs = [":codegen"],
+ srcs = [":torchgen"],
visibility = ["//visibility:public"],
)
diff --git a/torchgen/gen_backend_stubs.py b/torchgen/gen_backend_stubs.py
index c1a672a655..beee7a15e0 100644
--- a/torchgen/gen_backend_stubs.py
+++ b/torchgen/gen_backend_stubs.py
@@ -474,7 +474,7 @@ def run(
) -> None:
# Assumes that this file lives at PYTORCH_ROOT/torchgen/gen_backend_stubs.py
- pytorch_root = pathlib.Path(__file__).parent.parent.parent.absolute()
+ pytorch_root = pathlib.Path(__file__).parent.parent.absolute()
template_dir = os.path.join(pytorch_root, "aten/src/ATen/templates")
def make_file_manager(install_dir: str) -> FileManager:
```
run_all_fbandroid_tests
Test Plan: sandcastle
Reviewed By: albanD, ngimel
Differential Revision: D35770317
fbshipit-source-id: 153ac4a7fef15b1e750812a90bfafdbc8f1ebcdf
(cherry picked from commit c6d485d1d4648fa1c8a4c14c5bf3d8e899b9b4dd)
2022-04-25 01:38:06 +00:00