Skip to content

refactor XNNPACK's ukernel config srcs #12152

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion backends/xnnpack/third-party/XNNPACK
Submodule XNNPACK updated 7178 files
15 changes: 12 additions & 3 deletions backends/xnnpack/third-party/xnnpack.buck.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ load(
"OPERATOR_SRCS",
"SUBGRAPH_SRCS",
"TABLE_SRCS",
"XNNPACK_SRCS",
"get_xnnpack_headers",
"get_ukernel_config_srcs",
"prod_srcs_for_arch_wrapper",
)

Expand Down Expand Up @@ -1070,7 +1070,7 @@ def define_xnnpack():
# @lint-ignore BUCKLINT: native and fb_native are explicitly forbidden in fbcode.
native.cxx_library(
name = "XNNPACK",
srcs = XNNPACK_SRCS + LOGGING_SRCS + [
srcs = get_ukernel_config_srcs() + LOGGING_SRCS + [
"XNNPACK/src/init.c",
"XNNPACK/src/params.c",
"XNNPACK/src/configs/hardware-config.c",
Expand Down Expand Up @@ -1100,7 +1100,16 @@ def define_xnnpack():
# "-DXNN_ENABLE_DWCONV_MULTIPLASS=1",
"-DXNN_ENABLE_ARM_I8MM=1",
"-DXNN_ENABLE_ARM_FP16_VECTOR=1",
"-DXNN_ENABLE_AVX512BF16=0"
"-DXNN_ENABLE_AVX512BF16=1"
"-DXNN_ENABLE_AVX512F=1",
"-DXNN_ENABLE_AVX512SKX=1",
"-DXNN_ENABLE_AVX512VNNI=1",
"-DXNN_ENABLE_AVX512VNNIGFNI=1",
"-DXNN_ENABLE_AVX512AMX=1",
"-DXNN_ENABLE_AVX512VBMI=1",
"-DXNN_ENABLE_AVX512FP16=1",
"-DXNN_ENABLE_AVXVNNIINT8=1",
"-DXNN_ENABLE_AVX256VNNIGFNI=1",
],
visibility = ["PUBLIC"],
exported_deps = COMMON_XNNPACK_DEPS + [
Expand Down
32 changes: 5 additions & 27 deletions backends/xnnpack/third-party/xnnpack_src_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,6 @@ load("//backends/xnnpack/third-party/XNNPACK/gen:microkernels.bzl", "prod_srcs_f
load("@fbsource//xplat/executorch/third-party:glob_defs.bzl", "subdir_glob")

# To get from XNNPACK:build_srcs.bzl in the future
_XNNPACK_SRCS = [
"src/configs/argmaxpool-config.c",
"src/configs/avgpool-config.c",
"src/configs/binary-elementwise-config.c",
"src/configs/cmul-config.c",
"src/configs/conv-hwc2chw-config.c",
"src/configs/dwconv-config.c",
"src/configs/dwconv2d-chw-config.c",
"src/configs/gemm-config.c",
"src/configs/ibilinear-chw-config.c",
"src/configs/ibilinear-config.c",
"src/configs/lut32norm-config.c",
"src/configs/maxpool-config.c",
"src/configs/pack-lh-config.c",
"src/configs/raddstoreexpminusmax-config.c",
"src/configs/reduce-config.c",
"src/configs/spmm-config.c",
"src/configs/transpose-config.c",
"src/configs/unary-elementwise-config.c",
"src/configs/unpool-config.c",
"src/configs/vmulcaddc-config.c",
"src/configs/x8-lut-config.c",
"src/configs/xx-fill-config.c",
"src/configs/xx-pad-config.c",
]

def define_xnnpack_build_src(xnnpack_build_src):
return ["XNNPACK/{}".format(src) for src in xnnpack_build_src]

Expand All @@ -56,8 +30,12 @@ def get_xnnpack_headers():
])
return src_headers | include_headers | ukernel_headers

def get_ukernel_config_srcs():
return subdir_glob([
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should do this more instead of lists.

("XNNPACK/src/configs", "*.c"),
]).values()

OPERATOR_SRCS = define_xnnpack_build_src(_OPERATOR_SRCS)
SUBGRAPH_SRCS = define_xnnpack_build_src(_SUBGRAPH_SRCS)
TABLE_SRCS = define_xnnpack_build_src(_TABLE_SRCS)
XNNPACK_SRCS = define_xnnpack_build_src(_XNNPACK_SRCS)
LOGGING_SRCS = define_xnnpack_build_src(_LOGGING_SRCS)
Loading