From 8707062a39f3e962482d0be6e0a988d445e4542e Mon Sep 17 00:00:00 2001 From: Kyle Mabee <118925087+kmabeeTT@users.noreply.github.com> Date: Sat, 14 Sep 2024 17:01:12 -0400 Subject: [PATCH] Metal Runtime use Buffer allocate=false in createBufferFromTensorRef(), remove temp hack #408 (#692) - Now that metal uplift with fix happened this isn't need anymore. --- runtime/include/tt/runtime/detail/ttmetal.h | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/runtime/include/tt/runtime/detail/ttmetal.h b/runtime/include/tt/runtime/detail/ttmetal.h index 723db96fa..e655c4fb0 100644 --- a/runtime/include/tt/runtime/detail/ttmetal.h +++ b/runtime/include/tt/runtime/detail/ttmetal.h @@ -159,23 +159,11 @@ createBufferFromTensorRef(::tt::tt_metal::Device *device, .buffer_type = bufferType, .buffer_layout = TensorMemoryLayout::BLOCK_SHARDED, .shard_parameters = shardSpecBuffer, + .allocate = false, }; std::shared_ptr<::tt::tt_metal::Buffer> buffer = ::tt::tt_metal::CreateBuffer(shardedBufferConfig); assert(tensorRef->address()); - - // Issue #408: Temporary Hack, remove when fix available. - // Update tt-metal BUFFER_MAP with updated address and remove - // entry for original alloc'd address. - auto &buffer_map = tt::tt_metal::detail::BUFFER_MAP; - auto map_copy = buffer_map.value(); - auto old_key = std::make_tuple(device->id(), buffer->address()); - if (auto it = map_copy.find(old_key); it != map_copy.end()) { - auto new_key = std::make_tuple(device->id(), tensorRef->address()); - buffer_map.insert(new_key, it->second); - buffer_map.erase(old_key); - } - buffer->set_address(tensorRef->address()); return buffer; }