diff --git a/.gitignore b/.gitignore index 1928c8e56..399635541 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,6 @@ test/lit.site.cfg.py # TTNN and TTMetal flatbuffers *.ttnn *.ttm + +# Root level mlir files (often used for testing, none should be at root) +/*.mlir diff --git a/python/test_infra/ttir_builder.py b/python/test_infra/ttir_builder.py index daae39ac5..3c2d7ead0 100644 --- a/python/test_infra/ttir_builder.py +++ b/python/test_infra/ttir_builder.py @@ -404,7 +404,7 @@ def bitwise_not(self, in0: Operand) -> OpView: return self.eltwise_proxy(torch.bitwise_not, ttir.BitwiseNotOp, [in0]) def ceil(self, in0: Operand) -> OpView: - return self.eltwise_proxy(torch.log, ttir.CeilOp, [in0]) + return self.eltwise_proxy(torch.ceil, ttir.CeilOp, [in0]) def sin(self, in0: Operand) -> OpView: return self.eltwise_proxy(torch.sin, ttir.SinOp, [in0]) diff --git a/runtime/lib/ttnn/runtime.cpp b/runtime/lib/ttnn/runtime.cpp index c0465f329..22cc537c1 100644 --- a/runtime/lib/ttnn/runtime.cpp +++ b/runtime/lib/ttnn/runtime.cpp @@ -510,23 +510,12 @@ Tensor getOpOutputTensor(OpContext opContextHandle, return createNullTensor(); } - ::ttnn::Tensor hostTensor = ::ttnn::from_device(*outPtr); - ::ttnn::Tensor outCopy = - ::ttnn::to_layout(hostTensor, ::ttnn::ROW_MAJOR_LAYOUT, std::nullopt, - std::nullopt, static_cast<::ttnn::IDevice *>(nullptr)); - - void *src = ::tt::tt_metal::get_raw_host_data_ptr(outCopy); - std::uint32_t outCopySize = outCopy.volume() * outCopy.element_size(); - std::shared_ptr data = ::tt::runtime::utils::malloc_shared(outCopySize); - std::memcpy(data.get(), src, outCopySize); - - auto tensor = std::make_shared<::ttnn::Tensor>( - ttnn::createStorage(data.get(), outCopy.volume(), - ::tt::target::DataType::Float32), - outCopy.shape().value, ::ttnn::DataType::FLOAT32, - ::ttnn::Layout::ROW_MAJOR); + std::shared_ptr<::ttnn::Tensor> hostTensor = + std::make_shared<::ttnn::Tensor>(::ttnn::to_layout( + ::ttnn::from_device(*outPtr), ::ttnn::Layout::ROW_MAJOR, std::nullopt, + std::nullopt, static_cast<::ttnn::IDevice *>(nullptr))); - return Tensor(std::static_pointer_cast(tensor), nullptr, + return Tensor(std::static_pointer_cast(hostTensor), nullptr, DeviceRuntime::TTNN); }