diff --git a/runtime/include/tt/runtime/detail/ttnn.h b/runtime/include/tt/runtime/detail/ttnn.h index 0fdfdbddf..a98271939 100644 --- a/runtime/include/tt/runtime/detail/ttnn.h +++ b/runtime/include/tt/runtime/detail/ttnn.h @@ -41,6 +41,7 @@ #pragma clang diagnostic ignored "-Wundefined-inline" #pragma clang diagnostic ignored "-Wc99-extensions" #pragma clang diagnostic ignored "-Wc++11-narrowing" +#pragma clang diagnostic ignored "-Wdeprecated-declarations" #define FMT_HEADER_ONLY #include "distributed/mesh_device.hpp" diff --git a/runtime/lib/common/system_desc.cpp b/runtime/lib/common/system_desc.cpp index 2ef9acdd8..60f32b61f 100644 --- a/runtime/lib/common/system_desc.cpp +++ b/runtime/lib/common/system_desc.cpp @@ -55,7 +55,7 @@ static ::tt::target::Arch toFlatbuffer(::tt::ARCH arch) { } static std::vector<::tt::target::ChipChannel> -getAllDeviceConnections(const vector<::tt::tt_metal::Device *> &devices) { +getAllDeviceConnections(const std::vector<::tt::tt_metal::Device *> &devices) { std::set> connectionSet; diff --git a/runtime/lib/ttnn/operations/data_movement/slice.cpp b/runtime/lib/ttnn/operations/data_movement/slice.cpp index 5ed520ec6..87ba89d80 100644 --- a/runtime/lib/ttnn/operations/data_movement/slice.cpp +++ b/runtime/lib/ttnn/operations/data_movement/slice.cpp @@ -14,9 +14,10 @@ void run(const ::tt::target::ttnn::SliceOp *op, ProgramContext &context) { ProgramTensorPool &tensorPool = context.getTensorPool(); const ::ttnn::Tensor &in = tensorPool.at(op->in()->global_id()); DEBUG_ASSERT(in.is_allocated()); - std::vector begins(op->begins()->begin(), op->begins()->end()); - std::vector ends(op->ends()->begin(), op->ends()->end()); - std::vector step(op->step()->begin(), op->step()->end()); + ::ttnn::SmallVector begins(op->begins()->begin(), + op->begins()->end()); + ::ttnn::SmallVector ends(op->ends()->begin(), op->ends()->end()); + ::ttnn::SmallVector step(op->step()->begin(), op->step()->end()); ::ttnn::Tensor out = ::ttnn::slice(in, begins, ends, step); tensorPool.insert_or_assign(op->out()->global_id(), out); diff --git a/runtime/lib/ttnn/operations/pool/maxpool2d.cpp b/runtime/lib/ttnn/operations/pool/maxpool2d.cpp index 32790b3d9..f04f7d226 100644 --- a/runtime/lib/ttnn/operations/pool/maxpool2d.cpp +++ b/runtime/lib/ttnn/operations/pool/maxpool2d.cpp @@ -32,8 +32,8 @@ preshardForMaxPool2d(const ::tt::target::ttnn::MaxPool2dOp *op, auto parallel_config = ::ttnn::operations::conv::conv2d::determine_parallel_config( ::ttnn::TensorMemoryLayout::HEIGHT_SHARDED, op->batch_size(), - op->channels(), output_height, output_width, op->channels(), &device, - ShardOrientation::ROW_MAJOR); + op->channels(), output_height, output_width, op->channels(), + device.compute_with_storage_grid_size(), ShardOrientation::ROW_MAJOR); auto sharded_memory_config = ::ttnn::operations::conv::conv2d:: create_sharded_memory_config_from_parallel_config(inputShape, parallel_config, 1); diff --git a/runtime/lib/ttnn/operations/reduction/reduction.cpp b/runtime/lib/ttnn/operations/reduction/reduction.cpp index b9f494dc8..2330a5287 100644 --- a/runtime/lib/ttnn/operations/reduction/reduction.cpp +++ b/runtime/lib/ttnn/operations/reduction/reduction.cpp @@ -12,8 +12,8 @@ static void runReductionOp( ::tt::target::ttnn::ReductionOp const *op, ProgramTensorPool &tensorPool, std::function<::ttnn::Tensor( const ::ttnn::Tensor &, - const std::optional>> &, const bool, - const std::optional<::tt::tt_metal::MemoryConfig> &, + const std::optional>> &, + const bool, const std::optional<::tt::tt_metal::MemoryConfig> &, const std::optional<::ttnn::DeviceComputeKernelConfig> &, float)> ttnnOp) { ::tt::tt_metal::MemoryConfig outputMemoryConfig = @@ -22,9 +22,9 @@ static void runReductionOp( DEBUG_ASSERT(in.is_allocated()); const auto *fbDimArg = op->dim_arg(); - std::optional> dimArg = - fbDimArg ? std::make_optional( - std::vector(fbDimArg->begin(), fbDimArg->end())) + std::optional<::ttnn::SmallVector> dimArg = + fbDimArg ? std::make_optional(::ttnn::SmallVector(fbDimArg->begin(), + fbDimArg->end())) : std::nullopt; ::ttnn::Tensor out = ttnnOp( diff --git a/runtime/lib/ttnn/runtime.cpp b/runtime/lib/ttnn/runtime.cpp index 24c372b68..00d7c4abc 100644 --- a/runtime/lib/ttnn/runtime.cpp +++ b/runtime/lib/ttnn/runtime.cpp @@ -9,6 +9,9 @@ #include "tt/runtime/utils.h" #include "ttmlir/Target/TTNN/Target.h" #include "ttmlir/Version.h" +#include "ttnn/tensor/shape/small_vector.hpp" +#include "ttnn/tensor/types.hpp" + namespace tt::runtime::ttnn { using ::tt::runtime::DeviceRuntime; @@ -45,9 +48,14 @@ Tensor createTensor(std::shared_ptr data, std::vector const &stride, std::uint32_t itemsize, ::tt::target::DataType dataType) { std::uint32_t numElements = shape[0] * stride[0]; + + ::tt::tt_metal::SmallVector small_vector_shape(shape.begin(), + shape.end()); + auto tensor = std::make_shared<::ttnn::Tensor>( - createStorage(data.get(), numElements, dataType), shape, - utils::toTTNNDataType(dataType), ::ttnn::Layout::ROW_MAJOR); + createStorage(data.get(), numElements, dataType), + ::ttnn::Shape(small_vector_shape), utils::toTTNNDataType(dataType), + ::ttnn::Layout::ROW_MAJOR); return Tensor(tensor, data, DeviceRuntime::TTNN); }