Skip to content

link bmm, mm, view_copy, slice_copy, split_with_sizes_copy to jarvis #10436

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions backends/cadence/hifi/operators/op_bmm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ using exec_aten::ScalarType;
using executorch::runtime::KernelRuntimeContext;
using executorch::runtime::kTensorDimensionLimit;
using executorch::runtime::resize_tensor;
using executorch::runtime::tensors_have_same_dim_order;
using executorch::runtime::tensor_is_default_dim_order;
using executorch::runtime::tensors_have_same_dim_order;
using torch::executor::check_bmm_args;
using torch::executor::Error;
using torch::executor::get_bmm_out_target_size;
Expand Down Expand Up @@ -78,16 +78,16 @@ Tensor& bmm_out(
WORD32 out_stride = p;

WORD32* __restrict__ tmp =
(WORD32* __restrict__)kernels::allocate_temp_memory(
ctx, (batch_size * m * p) * sizeof(float));
(WORD32* __restrict__)kernels::allocate_temp_memory(
ctx, (batch_size * m * p) * sizeof(float));

ET_KERNEL_CHECK(ctx, tmp != nullptr, MemoryAllocationFailed, out);

tmp[batch_size * m * p] = {0};

WORD32* __restrict__ p_o =
(WORD32* __restrict__)kernels::allocate_temp_memory(
ctx, (batch_size * m * p) * sizeof(WORD32));
(WORD32* __restrict__)kernels::allocate_temp_memory(
ctx, (batch_size * m * p) * sizeof(WORD32));

ET_KERNEL_CHECK(ctx, p_o != nullptr, MemoryAllocationFailed, out);

Expand Down
4 changes: 2 additions & 2 deletions backends/cadence/hifi/operators/op_mm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ Tensor& mm_out(
WORD32 out_stride = p;

WORD32* __restrict__ p_o =
(WORD32* __restrict__)kernels::allocate_temp_memory(
ctx, (n * p) * sizeof(WORD32));
(WORD32* __restrict__)kernels::allocate_temp_memory(
ctx, (n * p) * sizeof(WORD32));

WORD32 p_inp_shape[2];
p_inp_shape[0] = n;
Expand Down
5 changes: 5 additions & 0 deletions backends/cadence/hifi/operators/targets.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ def define_operator(name: str, deps: list[str] | None = None) -> None:
OPERATORS = [
"add",
"atan2",
"bmm",
"mm",
"slice_copy",
"split_with_sizes_copy",
"view_copy",
"cat",
"clamp",
"dequantize_per_tensor",
Expand Down
Loading