Skip to content

Commit

Permalink
Changed invoke method in the runtime so it doesn't fail for <4D tensors
Browse files Browse the repository at this point in the history
  • Loading branch information
azecevicTT committed Dec 5, 2024
1 parent ab5e243 commit b192352
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions runtime/lib/ttnn/operations/data_movement/permute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
#include "permute.h"

#include "tt/runtime/detail/logger.h"
#include "tt/runtime/detail/ttnn.h"
#include "tt/runtime/ttnn/operations/utils.h"
#include "tt/runtime/ttnn/utils.h"
#include "ttnn/common/constants.hpp"

#include <vector>

Expand All @@ -21,7 +19,13 @@ void run(const ::tt::target::ttnn::PermuteOp *op, ProgramContext &context) {
std::vector<int64_t> permutation(op->permutation()->begin(),
op->permutation()->end());

::ttnn::Tensor out = ::ttnn::permute(in, permutation);
// Has to called with the verbose invoke, since calling it with composite=true
// results in an error with the message "Only 4D tensor are supported for
// permute."
::ttnn::Tensor out =
::ttnn::permute(/*queue_id=*/::ttnn::DefaultQueueId, /*input_tensor=*/in,
/*dims=*/permutation, /*memory_config=*/std::nullopt,
/*composite=*/false, /*pad_value=*/std::nullopt);
tensorPool.insert_or_assign(op->out()->global_id(), out);
}
} // namespace tt::runtime::ttnn::operations::data_movement

0 comments on commit b192352

Please sign in to comment.