Skip to content
Closed
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
16 changes: 8 additions & 8 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1680,14 +1680,14 @@ jobs:
.ci/scripts/setup-linux.sh --build-tool "cmake"

# Custom operator tests
PYTHON_EXECUTABLE=python bash backends/vulkan/test/custom_ops/build_and_run.sh test_add
./cmake-out/backends/vulkan/test/custom_ops/test_q8csw_linear
./cmake-out/backends/vulkan/test/custom_ops/test_q8csw_conv2d
./cmake-out/backends/vulkan/test/custom_ops/test_q4gsw_linear
./cmake-out/backends/vulkan/test/custom_ops/test_choose_qparams_per_row
./cmake-out/backends/vulkan/test/custom_ops/test_q8ta_qdq
./cmake-out/backends/vulkan/test/custom_ops/test_q8ta_clone
./cmake-out/backends/vulkan/test/custom_ops/test_q8ta_binary
PYTHON_EXECUTABLE=python bash backends/vulkan/test/ops/benchmark/build_and_run.sh test_add
./cmake-out/backends/vulkan/test/ops/benchmark/test_q8csw_linear
./cmake-out/backends/vulkan/test/ops/benchmark/test_q8csw_conv2d
./cmake-out/backends/vulkan/test/ops/benchmark/test_q4gsw_linear
./cmake-out/backends/vulkan/test/ops/benchmark/test_choose_qparams_per_row
./cmake-out/backends/vulkan/test/ops/benchmark/test_q8ta_qdq
./cmake-out/backends/vulkan/test/ops/benchmark/test_q8ta_clone
./cmake-out/backends/vulkan/test/ops/benchmark/test_q8ta_binary

# "Classic" Operator tests
PYTHON_EXECUTABLE=python bash backends/vulkan/test/scripts/test_op.sh --build
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/vulkan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ jobs:
# Operator coverage (mirrors test-vulkan-operators-linux, on real hardware).
# The custom-op prototyping binaries are GPU microbenchmarks that rely on
# GPU timestamp queries, so they require the hardware selected above.
PYTHON_EXECUTABLE=python bash backends/vulkan/test/custom_ops/build_and_run.sh
./cmake-out/backends/vulkan/test/custom_ops/test_add
./cmake-out/backends/vulkan/test/custom_ops/test_q8csw_linear
./cmake-out/backends/vulkan/test/custom_ops/test_q8csw_conv2d
./cmake-out/backends/vulkan/test/custom_ops/test_q4gsw_linear
./cmake-out/backends/vulkan/test/custom_ops/test_choose_qparams_per_row
./cmake-out/backends/vulkan/test/custom_ops/test_q8ta_qdq
./cmake-out/backends/vulkan/test/custom_ops/test_q8ta_clone
./cmake-out/backends/vulkan/test/custom_ops/test_q8ta_binary
PYTHON_EXECUTABLE=python bash backends/vulkan/test/ops/benchmark/build_and_run.sh
./cmake-out/backends/vulkan/test/ops/benchmark/test_add
./cmake-out/backends/vulkan/test/ops/benchmark/test_q8csw_linear
./cmake-out/backends/vulkan/test/ops/benchmark/test_q8csw_conv2d
./cmake-out/backends/vulkan/test/ops/benchmark/test_q4gsw_linear
./cmake-out/backends/vulkan/test/ops/benchmark/test_choose_qparams_per_row
./cmake-out/backends/vulkan/test/ops/benchmark/test_q8ta_qdq
./cmake-out/backends/vulkan/test/ops/benchmark/test_q8ta_clone
./cmake-out/backends/vulkan/test/ops/benchmark/test_q8ta_binary

PYTHON_EXECUTABLE=python bash backends/vulkan/test/scripts/test_op.sh --build vulkan_sdpa_av_test

Expand Down
104 changes: 2 additions & 102 deletions backends/vulkan/test/custom_ops/targets.bzl
Original file line number Diff line number Diff line change
@@ -1,89 +1,14 @@
load("@fbsource//tools/build_defs:platform_defs.bzl", "ANDROID", "CXX")
load("@fbsource//tools/build_defs:platform_defs.bzl", "CXX")
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
load(
"@fbsource//xplat/executorch/backends/vulkan:targets.bzl",
"get_platforms",
"vulkan_spv_shader_lib",
)

def define_custom_op_test_binary(custom_op_name, extra_deps = [], src_file = None, include_torch = False):
deps_list = [
":prototyping_utils",
":operator_implementations",
":custom_ops_shaderlib",
"//executorch/backends/vulkan:vulkan_graph_runtime",
] + ([runtime.external_dep_location("libtorch")] if include_torch else []) + extra_deps

src_file_str = src_file if src_file else "{}.cpp".format(custom_op_name)

runtime.cxx_binary(
name = custom_op_name,
srcs = [
src_file_str,
],
platforms = get_platforms(),
define_static_target = False,
deps = deps_list,
)

def define_common_targets(is_fbcode = False):
if is_fbcode:
return

# Shader library from GLSL files
runtime.filegroup(
name = "custom_ops_shaders",
srcs = native.glob([
"glsl/**/*",
]),
visibility = ["PUBLIC"],
)

vulkan_spv_shader_lib(
name = "custom_ops_shaderlib",
spv_filegroups = {
":custom_ops_shaders": "glsl",
},
is_fbcode = is_fbcode,
)

# Prototyping utilities library
runtime.cxx_library(
name = "prototyping_utils",
srcs = [
"utils.cpp",
"conv2d_utils.cpp",
],
headers = [
"utils.h",
"conv2d_utils.h",
],
exported_headers = [
"utils.h",
"conv2d_utils.h",
],
platforms = get_platforms(),
deps = [
"//executorch/backends/vulkan:vulkan_graph_runtime",
],
visibility = ["PUBLIC"],
)

# Operator implementations library
runtime.cxx_library(
name = "operator_implementations",
srcs = native.glob([
"impl/*.cpp",
]),
platforms = get_platforms(),
deps = [
"//executorch/backends/vulkan:vulkan_graph_runtime",
":custom_ops_shaderlib",
],
visibility = ["PUBLIC"],
link_whole = True,
)

runtime.cxx_test(
name = "utils_test",
srcs = [
Expand All @@ -92,7 +17,7 @@ def define_common_targets(is_fbcode = False):
contacts = ["oncall+ai_infra_mobile_platform@xmail.facebook.com"],
platforms = [CXX],
deps = [
":prototyping_utils",
"//executorch/backends/vulkan/test/ops/benchmark:prototyping_utils",
"//third-party/googletest:gtest_main",
],
)
Expand All @@ -116,28 +41,3 @@ def define_common_targets(is_fbcode = False):
"//executorch/backends/vulkan:vulkan_graph_runtime",
],
)

define_custom_op_test_binary("test_add")
define_custom_op_test_binary("test_q8csw_linear")
define_custom_op_test_binary("test_q8csw_conv2d")
define_custom_op_test_binary("test_choose_qparams_per_row")
define_custom_op_test_binary("test_q4gsw_linear")
define_custom_op_test_binary("test_q8ta_qdq")
define_custom_op_test_binary("test_q8ta_clone")
define_custom_op_test_binary("test_q8ta_binary")
define_custom_op_test_binary("test_q8ta_conv2d")
define_custom_op_test_binary("test_q8ta_conv2d_pw")
define_custom_op_test_binary("test_q8ta_conv2d_dw")
define_custom_op_test_binary("test_q8ta_linear")
define_custom_op_test_binary("test_q8ta_conv2d_transposed")
define_custom_op_test_binary("test_q8ta_pixel_shuffle")
define_custom_op_test_binary("test_q8ta_unary")
define_custom_op_test_binary("test_mm")
define_custom_op_test_binary("test_conv2d")
define_custom_op_test_binary("test_conv2d_pw")
define_custom_op_test_binary("test_conv2d_dw")
define_custom_op_test_binary("test_embedding_q4gsw")
define_custom_op_test_binary("test_conv1d_pw")
define_custom_op_test_binary("test_conv1d_dw")
define_custom_op_test_binary("test_fpa_q4gsw_linear")
define_custom_op_test_binary("test_sdpa")
Loading
Loading