mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Summary:
Added a check for the dispatch keys present in native_function.yaml, they must be part of the fixed set of dispatch keys. If not, signal an error. I also removed two dispatch keys from the function schema copy_ , because they are not supported (SparseHIP, SpareXPU).
Pull Request resolved: https://github.com/pytorch/pytorch/pull/67961
Test Plan:
this function schema (for example) in native_function.yaml
```
- func: native_norm(Tensor self, Scalar p=2) -> Tensor
dispatch:
SparseCPU, SparseCUDA, SparseHIP: norm_sparse
```
now generates this error during codegen: `AssertionError: SparseHIP is not a supported dispatch key.`
Fixes https://github.com/pytorch/pytorch/issues/66190
Reviewed By: albanD
Differential Revision: D34327853
Pulled By: ezyang
fbshipit-source-id: 6959d14a7752aefd025baa482d56547b4ed69b4c
(cherry picked from commit
|
||
|---|---|---|
| .. | ||
| api | ||
| dest | ||
| operator_versions | ||
| selective_build | ||
| static_runtime | ||
| __init__.py | ||
| code_template.py | ||
| context.py | ||
| gen_backend_stubs.py | ||
| gen_functionalization_type.py | ||
| gen_lazy_tensor.py | ||
| gen.py | ||
| local.py | ||
| model.py | ||
| utils.py | ||