diff options
author | Edward Yang <ezyang@fb.com> | 2019-04-02 08:03:29 -0700 |
---|---|---|
committer | Facebook Github Bot <facebook-github-bot@users.noreply.github.com> | 2019-04-02 08:06:48 -0700 |
commit | aed7c9bc96fe35fce6508e19dab1e2cfbc766968 (patch) | |
tree | bf04e5f9adad7cf636da036f903590bf57b7bf7d /c10 | |
parent | baac5489a832a7394901db5db0a72999f00e9940 (diff) | |
download | pytorch-aed7c9bc96fe35fce6508e19dab1e2cfbc766968.tar.gz pytorch-aed7c9bc96fe35fce6508e19dab1e2cfbc766968.tar.bz2 pytorch-aed7c9bc96fe35fce6508e19dab1e2cfbc766968.zip |
Improve Backend comment. (#18567)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18567
ghimport-source-id: 1e50e611a3afcfae86828b7afe06c3fdc6a7bef7
Stack from [ghstack](https://github.com/ezyang/ghstack):
* **#18567 Improve Backend comment.**
Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Reviewed By: dzhulgakov
Differential Revision: D14666189
fbshipit-source-id: 64a41c4a998b1a59ff780d1ae06fa16e5ef3c7c4
Diffstat (limited to 'c10')
-rw-r--r-- | c10/core/Backend.h | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/c10/core/Backend.h b/c10/core/Backend.h index 0e1e1fa962..3a3c6c8430 100644 --- a/c10/core/Backend.h +++ b/c10/core/Backend.h @@ -10,15 +10,21 @@ namespace c10 { /** - * This legacy enum class defines the set of backends supported by - * old school, code generated Type-based ATen. The reason we are - * sunsetting this enum class is because it doesn't allow for - * open registration of backends. TensorTypeId is the replacement - * for Backend which supports open registration. + * This legacy enum class defines the set of backends supported by old school, + * code generated Type-based ATen. A "backend" in this sense roughly + * corresponds to the cartesian product of (device type, layout), but restricted + * only to combinations which we actually have kernels for. Backend does NOT + * include dtype. * - * ARE YOU SURE YOU WANT TO USE THIS TYPE? Think about if SparseCPU/SparseCUDA - * would make sense in your use case. If it doesn't make sense, maybe - * you want DeviceType. + * The reason we are sunsetting this enum class is because it doesn't allow for + * open registration; e.g., if you want to add SparseXLA, you'd have to + * edit this enum; you wouldn't be able to do it out of tree. TensorTypeId is + * the replacement for Backend which supports open registration. + * + * NB: The concept of 'Backend' here disagrees with the notion of backend + * exposed to users in torch.backends. Backend here is something like "CPU" + * or "SparseCUDA"; backend in torch.backends is something like "MKL" or + * "CUDNN". */ enum class Backend { CPU, CUDA, HIP, SparseCPU, SparseCUDA, SparseHIP, MSNPU, XLA, Undefined, NumOptions }; |