From 095e8264988ba018e0e18597b7af1f4c9e921736 Mon Sep 17 00:00:00 2001 From: Gregory Comer Date: Thu, 27 Mar 2025 03:12:31 -0700 Subject: [PATCH] Add method variants in dynamic shim to use core tensor/evalue/result types (#7834) Summary: This change adds forward and execute methods to the dynamic shim interface that make use of the core executorch tensor, evalue, and result types. The intent is to allow users to use the "real" ET types, rather than TensorWrapper/EValueWrapper. There are several reasons to do this: 1) Wrapper types are limited in functionality compared to the core types. 2) We need to add more functionality to the wrappers as we support more models, leading to duplicated effort. 3) API surface is inconsistent with ET documentation, which uses the core types. This change should not introduce significant binary size changes, as these new methods are not currently used and are thus optimized out in release builds. When updating call sites to use the new methods and core ET types, impact is <= 5kB (see diffs in this stack). The ET core runtime is designed to be small, so directly including these types should not carry significant size overhead. Reviewed By: metascroy Differential Revision: D67650320 Pulled By: GregoryComer --- runtime/core/portable_type/targets.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/core/portable_type/targets.bzl b/runtime/core/portable_type/targets.bzl index 6178f2c0f9a..41bc6050524 100644 --- a/runtime/core/portable_type/targets.bzl +++ b/runtime/core/portable_type/targets.bzl @@ -25,6 +25,7 @@ def define_common_targets(): # mean I cant just expose visibility to a single rule. visibility = [ "//executorch/backends/...", + "//executorch/extension/fb/dynamic_shim/...", "//executorch/runtime/core/exec_aten/...", "//executorch/runtime/core/portable_type/test/...", ],