pytorch/torchgen
Hansong Zhang fa6df34d30 [ET selective build] add kernel metadata section to selective_build.yaml (#100665)
Summary:
For each op, we have a List[List[dtype;dim-order]]:
  - the inner list contains the `dtype;dim-order` info for each arg if we have a Tensor/TensorList/OptionalTensorList
  - the outer list contains different occurances of dtype/dim-order combinations for that op in the program

Example:
```
et_kernel_metadata:
  aten::add.out:
    # A list of different dtype/dim-order combinations used in model
    - # Each contains the list of args of Tensor dtype and dim order if applicable
      - FLOAT;0,1
      - FLOAT;0,1
      - NON_TENSOR_ARG
      - FLOAT;0,1
      - FLOAT;0,1
    -
      - INT;0,1
      - INT;0,1
      - NON_TENSOR_ARG
      - INT;0,1
      - INT;0,1
  aten::mul.out:
    - - FLOAT;0,1
      - FLOAT;0,1
      - FLOAT;0,1
      - FLOAT;0,1
```

We don't have the arg name so far; we need to parse the schema (functions.yaml) to get that info.  We depend on the order of args from that file.

Test Plan: `buck run fbcode//executorch/codegen/tools:test_gen_oplist_real_model`

Differential Revision: D45551409

Pull Request resolved: https://github.com/pytorch/pytorch/pull/100665
Approved by: https://github.com/larryliu0820
2023-05-09 21:30:01 +00:00
..
api [WIP] enable cuda graphs support for flash attention with dropout (#100196) 2023-05-08 16:19:18 +00:00
decompositions
dest [BE] Use Literal from typing (#98846) 2023-04-12 05:49:37 +00:00
executorch [executorch] Add RuntimeContext to generated C++ API Signature (#94570) 2023-02-16 02:43:18 +00:00
operator_versions [BE] Remove unnecessary dict comprehensions (#97116) 2023-03-20 00:56:57 +00:00
selective_build [ET selective build] add kernel metadata section to selective_build.yaml (#100665) 2023-05-09 21:30:01 +00:00
shape_functions [JIT SSA] Allow updating shape functions without recompilation (#83629) 2022-08-22 18:03:44 +00:00
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 run buildifier on unified build files (#98141) 2023-04-04 00:37:19 +00:00
code_template.py
context.py Change API type Tensor[] for structured kernels. (#73350) 2022-09-26 21:46:38 +00:00
gen_backend_stubs.py Excise yaml dependency in torchgen.model (#100203) 2023-04-28 13:45:39 +00:00
gen_executorch.py [ET] Add RuntimeContext to ET Aten mode (#96084) 2023-03-08 02:51:47 +00:00
gen_functionalization_type.py fix typo in gen_functionalization_type.py (#99303) 2023-04-17 22:59:40 +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 fix: update error when tensor escapes vmap (#89077) 2022-12-06 05:52:09 +00:00
gen.py Excise yaml dependency in torchgen.model (#100203) 2023-04-28 13:45:39 +00:00
local.py Change API type Tensor[] for structured kernels. (#73350) 2022-09-26 21:46:38 +00:00
model.py Revert "Rename DispatchKey.PrivateUse1 to custom device in torchgen. (#99406)" 2023-05-09 15:04:16 +00: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