Skip to content
Open
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
21 changes: 21 additions & 0 deletions extension/llm/custom_ops/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ non_fbcode_target(_kind = define_common_targets,)
# Any targets that should be shared between fbcode and xplat must be defined in
# targets.bzl. This file can contain fbcode-only targets.

load("@fbsource//tools/target_determinator/macros:ci.bzl", "ci")
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
load(":targets.bzl", "define_common_targets")

Expand Down Expand Up @@ -45,6 +46,26 @@ fbcode_target(_kind = runtime.python_test,
],
deps = [
"//caffe2:torch",
],
)

fbcode_target(_kind = runtime.python_test,
name = "test_gated_delta",
srcs = [
"test_gated_delta.py",
],
# Builds the runtime, kernels and custom_ops with -DET_EVENT_TRACER_ENABLED so
# the .pte-execution test can assert the op's per-op native_call_ ETDump event.
labels = [] if runtime.is_oss else ci.labels(
ci.buckconfig("executorch.event_tracer_enabled", "true"),
),
preload_deps = [
":custom_ops_aot_lib",
":custom_ops_aot_py",
],
deps = [
"//caffe2:torch",
"//executorch/devtools:lib",
"//executorch/exir:lib",
"//executorch/runtime:runtime",
],
Expand Down
5 changes: 5 additions & 0 deletions extension/llm/custom_ops/op_sdpa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <ATen/cpu/vec/functional.h>
#include <ATen/cpu/vec/vec.h>
#include <executorch/kernels/optimized/blas/CPUBlas.h>
#include <executorch/runtime/core/event_tracer_hooks.h>
#include <executorch/runtime/core/exec_aten/util/dim_order_util.h>
// @lint-ignore CLANGTIDY facebook-unused-include-check
#include <c10/util/irange.h>
Expand Down Expand Up @@ -1308,6 +1309,10 @@ namespace {
void channelwise_gated_delta_rule_out_boxed(
executorch::runtime::KernelRuntimeContext& ctx,
executorch::runtime::Span<executorch::runtime::EValue*> stack) {
executorch::runtime::internal::EventTracerProfileOpScope
event_tracer_op_scope(
ctx.internal_event_tracer(),
"native_call_llama::channelwise_gated_delta_rule.out");
// Multi-output out variants get a trailing TensorList aggregating the two
// outputs appended by the emitter, so the boxed stack has 9 entries: 6 inputs
// + out + final_state_out + [out, final_state_out]. The aggregate (stack[8])
Expand Down
Loading
Loading