Skip to content
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

Refactor convolution test suite #24

Merged
merged 16 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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
21 changes: 21 additions & 0 deletions linalg_ops/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,26 @@ iree_cc_binary(
iree::vm::cc
)

iree_cc_binary(
NAME
iree-e2e-conv2d-test
SRCS
"iree-e2e-conv2d-test.cc"
DEPS
::test_utils
iree::base
iree::base::internal
iree::base::internal::cpu
iree::base::internal::flags
iree::base::internal::path
iree::hal
iree::modules::hal
iree::tooling::context_util
iree::tooling::device_util
iree::vm
iree::vm::cc
)

#-------------------------------------------------------------------------------
# Tests
#-------------------------------------------------------------------------------
Expand All @@ -123,3 +143,4 @@ include(iree_test_suites_native_test)
include(iree_test_suites_runner_test)

add_subdirectory(matmul)
add_subdirectory(convolution)
75 changes: 75 additions & 0 deletions linalg_ops/convolution/CMakeLists.txt
erman-gurses marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Copyright 2024 The IREE Authors
erman-gurses marked this conversation as resolved.
Show resolved Hide resolved
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

# TODO(scotttodd): add filtering here, in the helper functions, or in ctest to
# choose which tests to compile and run

set(_SIZES)
list(APPEND _SIZES "large")
list(APPEND _SIZES "medium")
list(APPEND _SIZES "small")

###############################################################################
#
# CPU - llvm-cpu on local-task, default flags.
#
###############################################################################
erman-gurses marked this conversation as resolved.
Show resolved Hide resolved


set(_DTYPES)
list(APPEND _DTYPES "f16_f16_f16")
list(APPEND _DTYPES "f32_f32_f32")
erman-gurses marked this conversation as resolved.
Show resolved Hide resolved

foreach(_DTYPE IN LISTS _DTYPES)
foreach(_SIZE IN LISTS _SIZES)
iree_test_suites_runner_test(
NAME
conv2d_${_DTYPE}_${_SIZE}
TESTS_SRC
"generated/${_DTYPE}/conv2d_${_DTYPE}_${_SIZE}.mlir"
CALLS_SRC
"generated/${_DTYPE}/conv2d_${_DTYPE}_${_SIZE}_calls.mlir"
TEST_RUNNER
iree-test-suites_iree-e2e-conv2d-test
TARGET_BACKEND
"llvm-cpu"
DRIVER
"local-task"
COMPILER_FLAGS
RUNNER_FLAGS
LABELS
"hostonly"
"local"
)
endforeach()
endforeach()

foreach(_DTYPE IN LISTS _DTYPES)
foreach(_SIZE IN LISTS _SIZES)
iree_test_suites_runner_test(
NAME
conv2d_winograd_${_DTYPE}_${_SIZE}
TESTS_SRC
"generated/${_DTYPE}/conv2d_${_DTYPE}_${_SIZE}.mlir"
CALLS_SRC
"generated/${_DTYPE}/conv2d_${_DTYPE}_${_SIZE}_calls.mlir"
ScottTodd marked this conversation as resolved.
Show resolved Hide resolved
TEST_RUNNER
iree-test-suites_iree-e2e-conv2d-test
TARGET_BACKEND
"llvm-cpu"
DRIVER
"local-task"
COMPILER_FLAGS
"--iree-preprocessing-pass-pipeline=builtin.module\(func.func\(iree-linalg-ext-convert-conv2d-to-winograd{replace-all-convs=true}\)\)"
RUNNER_FLAGS
LABELS
"hostonly"
"local"
TARGET_CPU_FEATURES_VARIANTS
"default"
)
endforeach()
endforeach()
Loading