Skip to content

Commit b84d922

Browse files
[Executorch][llm] Compile custom op with -O2 (#6587)
Pull Request resolved: #6518 This enable some optimizations for inlining vectorized lib functions ghstack-source-id: 251021622 @exported-using-ghexport Differential Revision: [D64910576](https://our.internmc.facebook.com/intern/diff/D64910576/) Co-authored-by: Kimish Patel <[email protected]>
1 parent 6086d6e commit b84d922

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

extension/llm/custom_ops/targets.bzl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
2+
load(
3+
"@fbsource//xplat/executorch/kernels/portable:op_registration_util.bzl",
4+
"get_compiler_optimization_flags",
5+
)
6+
27

38
def define_common_targets():
49
"""Defines targets that should be shared between fbcode and xplat.
@@ -34,7 +39,7 @@ def define_common_targets():
3439
"//executorch/kernels/portable/cpu/util:reduce_util",
3540
"//executorch/extension/llm/custom_ops/spinquant:fast_hadamard_transform",
3641
],
37-
compiler_flags = ["-Wno-missing-prototypes", "-Wno-global-constructors"],
42+
compiler_flags = ["-Wno-missing-prototypes", "-Wno-global-constructors"] + get_compiler_optimization_flags(),
3843
visibility = [
3944
"//executorch/...",
4045
"//executorch/extension/llm/custom_ops/...",

0 commit comments

Comments
 (0)