From d5f96cc742ed5fa376bb1a9252efc243ede94a25 Mon Sep 17 00:00:00 2001 From: Ammar Vora Date: Tue, 19 Nov 2024 14:47:00 -0500 Subject: [PATCH] Add support for arrays in CoreRangeSet (#14967) ### Ticket - #14962 ### Problem description For the upcoming matmul1d op that supports inputs sharded on arbitrary cores, the ordering of the cores must be accessible in the program factory. This is so that we can pick a ring such that the NOC directions are optimized according to the following: image ### What's changed - Added support to pass in arrays to the CoreRangeSet object. --- ttnn/cpp/pybind11/tensor.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/ttnn/cpp/pybind11/tensor.cpp b/ttnn/cpp/pybind11/tensor.cpp index e2f6f35800b..2d00d4ee2e3 100644 --- a/ttnn/cpp/pybind11/tensor.cpp +++ b/ttnn/cpp/pybind11/tensor.cpp @@ -256,6 +256,7 @@ void tensor_mem_config_module(py::module& m_tensor) { auto pyCoreRangeSet = static_cast>(m_tensor.attr("CoreRangeSet")); pyCoreRangeSet.def(py::init<>([](const std::set& core_ranges) { return CoreRangeSet(core_ranges); })) + .def(py::init<>([](const std::vector& core_ranges) { return CoreRangeSet(tt::stl::Span(core_ranges)); })) .def( "bounding_box", &CoreRangeSet::bounding_box,