File tree Expand file tree Collapse file tree 4 files changed +11
-4
lines changed
examples/models/llama2/custom_ops Expand file tree Collapse file tree 4 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -558,10 +558,6 @@ if(EXECUTORCH_BUILD_PYBIND)
558
558
list (APPEND _dep_libs xnnpack_backend XNNPACK )
559
559
endif ()
560
560
561
- if (EXECUTORCH_BUILD_CUSTOM )
562
- list (APPEND _dep_libs custom_ops )
563
- endif ()
564
-
565
561
if (EXECUTORCH_BUILD_QUANTIZED )
566
562
target_link_options_shared_lib (quantized_ops_lib )
567
563
list (APPEND _dep_libs quantized_kernels quantized_ops_lib )
@@ -571,6 +567,13 @@ if(EXECUTORCH_BUILD_PYBIND)
571
567
if (EXECUTORCH_BUILD_CUSTOM_OPS_AOT AND NOT APPLE )
572
568
list (APPEND _dep_libs custom_ops_aot_lib )
573
569
endif ()
570
+ # TODO(laryliu): Fix linux duplicate registation problem. In GH CI worker
571
+ # libcustom_ops.a doesn't dedup with the one indirectly linked from
572
+ # libcustom_ops_aot_lib.a
573
+ if (EXECUTORCH_BUILD_CUSTOM AND APPLE )
574
+ target_link_options_shared_lib (custom_ops )
575
+ list (APPEND _dep_libs custom_ops )
576
+ endif ()
574
577
# compile options for pybind
575
578
576
579
set (_pybind_compile_options -Wno-deprecated-declarations -fPIC -frtti
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ runtime.python_test(
15
15
],
16
16
preload_deps = [
17
17
":custom_ops_aot_lib",
18
+ ":custom_ops_aot_py",
18
19
],
19
20
deps = [
20
21
"//caffe2:torch",
Original file line number Diff line number Diff line change 9
9
import torch
10
10
import torch .nn .functional as F
11
11
12
+ from .sdpa_with_kv_cache import custom_ops_lib # noqa
13
+
12
14
13
15
class SDPATest (unittest .TestCase ):
14
16
Original file line number Diff line number Diff line change @@ -389,6 +389,7 @@ def run(self):
389
389
390
390
if ShouldBuild .llama_custom_ops :
391
391
cmake_args += [
392
+ "-DEXECUTORCH_BUILD_CUSTOM=ON" , # add llama sdpa ops to pybindings.
392
393
"-DEXECUTORCH_BUILD_CUSTOM_OPS_AOT=ON" ,
393
394
]
394
395
build_args += ["--target" , "custom_ops_aot_lib" ]
You can’t perform that action at this time.
0 commit comments