pytorch/torchgen
Larry Liu 019c38624c [Executorch][codegen] Add ETKernelIndex for aggregating all kernels for kernel (#102565)
keys and change codegen to take ETKernelIndex

We are adding support for dtype and dim order specialized kernel registration. This requires us to reorganize `BackendIndex` (which is a `Dict[DispatchKey, Dict[OperatorName, BackendMetadata]]`) to be `Dict[OperatorName, Dict[ETKernelKey, BackendMetadata]]`. This PR adds new data structures in order to support this change:

* `ETKernelKey` to retrieve a certain kernel from the registry.
* `ETKernelIndex`, the dictionary from operator name to kernel key to kernel mapping.

Note that the codegen logic is not changed yet, we need subsequent diffs to actually generate code for different kernel keys.

Differential Revision: [D46206339](https://our.internmc.facebook.com/intern/diff/D46206339/)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/102565
Approved by: https://github.com/Jack-Khuu
2023-05-31 09:41:36 +00:00
..
api Enable backward on _foreach_zero_ (#101149) 2023-05-17 03:10:13 +00:00
decompositions
dest [BE] Use Literal from typing (#98846) 2023-04-12 05:49:37 +00:00
executorch [Executorch][codegen] Add ETKernelIndex for aggregating all kernels for kernel (#102565) 2023-05-31 09:41:36 +00:00
operator_versions
selective_build [BE]: Bugfix functorch and some generic typing improvements (#101337) 2023-05-14 14:20:56 +00:00
shape_functions
static_runtime Don't use f-strings in logging calls (1/X) (#98591) 2023-04-07 15:52:50 +00:00
__init__.py
BUCK.oss
BUILD.bazel
build.bzl update rules_python and let bazel install its own pip dependencies (#101405) 2023-05-23 06:20:33 +00:00
code_template.py
context.py
gen.py [Executorch][codegen] Add ETKernelIndex for aggregating all kernels for kernel (#102565) 2023-05-31 09:41:36 +00:00
gen_backend_stubs.py Excise yaml dependency in torchgen.model (#100203) 2023-04-28 13:45:39 +00:00
gen_executorch.py [Executorch][codegen] Add ETKernelIndex for aggregating all kernels for kernel (#102565) 2023-05-31 09:41:36 +00:00
gen_functionalization_type.py add inplace_view tag to resize_as_() (#100786) 2023-05-13 13:49:14 +00:00
gen_lazy_tensor.py Excise yaml dependency in torchgen.model (#100203) 2023-04-28 13:45:39 +00:00
gen_vmap_plumbing.py
local.py
model.py Revert "[Reland] Add sym_size/stride/numel/storage_offset to native_function.… (#100749)" 2023-05-16 18:17:02 -07:00
native_function_generation.py Persist torch.assert in aten graph (#100101) 2023-04-28 07:31:43 +00:00
utils.py Excise yaml dependency in torchgen.model (#100203) 2023-04-28 13:45:39 +00:00
yaml_utils.py Excise yaml dependency in torchgen.model (#100203) 2023-04-28 13:45:39 +00:00