Skip to content

Commit

Permalink
fix wrongfully assigning
Browse files Browse the repository at this point in the history
  • Loading branch information
marty1885 committed Nov 20, 2024
1 parent 1d00f7f commit f6b4f38
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ggml/src/ggml-metalium/ggml-metalium.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1707,7 +1707,7 @@ static void ggml_backend_metalium_buffer_get_tensor(ggml_backend_buffer_t buffer
}
GGML_ASSERT(t->layout() == tt::tt_metal::Layout::TILE);
if(t->dtype() != tt::tt_metal::DataType::BFLOAT16 || t->dtype() != tt::tt_metal::DataType::FLOAT32) {
*t = ttnn::experimental::typecast(*t, tt::tt_metal::DataType::BFLOAT16);
t = std::make_shared<tt::tt_metal::Tensor>(ttnn::experimental::typecast(*t, tt::tt_metal::DataType::BFLOAT16));
}

// TODO: Proper handling of data types
Expand Down Expand Up @@ -1737,8 +1737,8 @@ ggml_backend_metalium_buffer_init_tensor(ggml_backend_buffer_t buffer,
ggml_backend_metalium_buffer_context * bufctx = (ggml_backend_metalium_buffer_context *)buffer->context;

bufctx->metadata_to_free.push_back(std::make_unique<TensorWithMetadata>());
tensor->extra = bufctx->metadata_to_free.back().get();
TensorWithMetadata* meta = (TensorWithMetadata*)tensor->extra;
TensorWithMetadata* meta = bufctx->metadata_to_free.back().get();
tensor->extra = meta;
*meta = {
.tensor = nullptr,
.ggtype = GGML_TYPE_COUNT,
Expand Down

0 comments on commit f6b4f38

Please sign in to comment.