From 166e26f2d1901900582f490da6c8c219b5710869 Mon Sep 17 00:00:00 2001 From: iefgnoix Date: Fri, 10 May 2024 22:20:15 +0000 Subject: [PATCH 1/3] Add missing type uint16, uint32, and uint64 to TensorHash in LTC. --- torch/csrc/lazy/core/hash.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/torch/csrc/lazy/core/hash.h b/torch/csrc/lazy/core/hash.h index bb6a779555f22..5afbab974017e 100644 --- a/torch/csrc/lazy/core/hash.h +++ b/torch/csrc/lazy/core/hash.h @@ -135,6 +135,12 @@ static inline hash_t TensorHash(const at::Tensor& tensor) { return DataHash(ctensor.const_data_ptr>(), size); case at::ScalarType::ComplexDouble: return DataHash(ctensor.const_data_ptr>(), size); + case at::ScalarType::UInt16: + return DataHash(ctensor.const_data_ptr(), size); + case at::ScalarType::UInt32: + return DataHash(ctensor.const_data_ptr(), size); + case at::ScalarType::UInt64: + return DataHash(ctensor.const_data_ptr(), size); default: TORCH_INTERNAL_ASSERT( false, "Unsupported scalar type:", ctensor.scalar_type()); From a579ad20556a4a787a241cc2f9a728d40c436512 Mon Sep 17 00:00:00 2001 From: iefgnoix Date: Mon, 13 May 2024 18:20:08 +0000 Subject: [PATCH 2/3] wfind the failing test. --- torch/csrc/lazy/core/hash.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/torch/csrc/lazy/core/hash.h b/torch/csrc/lazy/core/hash.h index 5afbab974017e..6ecadcd1dfd13 100644 --- a/torch/csrc/lazy/core/hash.h +++ b/torch/csrc/lazy/core/hash.h @@ -108,6 +108,8 @@ static inline hash_t Hash(const c10::Scalar& value) { } static inline hash_t TensorHash(const at::Tensor& tensor) { + TORCH_INTERNAL_ASSERT( + false, "Unsupported scalar type:"); // This is to figure out where to add the tests. at::Tensor ctensor = tensor.contiguous(); int64_t size = ctensor.numel() * ctensor.element_size(); switch (ctensor.scalar_type()) { From 31cff150435062b6f96cbc0664fd9535f5ddab1a Mon Sep 17 00:00:00 2001 From: iefgnoix Date: Mon, 13 May 2024 23:17:09 +0000 Subject: [PATCH 3/3] remove unwanted check --- torch/csrc/lazy/core/hash.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/torch/csrc/lazy/core/hash.h b/torch/csrc/lazy/core/hash.h index 6ecadcd1dfd13..5afbab974017e 100644 --- a/torch/csrc/lazy/core/hash.h +++ b/torch/csrc/lazy/core/hash.h @@ -108,8 +108,6 @@ static inline hash_t Hash(const c10::Scalar& value) { } static inline hash_t TensorHash(const at::Tensor& tensor) { - TORCH_INTERNAL_ASSERT( - false, "Unsupported scalar type:"); // This is to figure out where to add the tests. at::Tensor ctensor = tensor.contiguous(); int64_t size = ctensor.numel() * ctensor.element_size(); switch (ctensor.scalar_type()) {