Skip to content

Commit

Permalink
Add integration for the conv2d (CPU) test suite.
Browse files Browse the repository at this point in the history
Signed-off-by: erman-gurses <[email protected]>
  • Loading branch information
erman-gurses committed Oct 21, 2024
1 parent 9f6bba6 commit fc08f82
Show file tree
Hide file tree
Showing 31 changed files with 3,621 additions and 4 deletions.
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)
112 changes: 112 additions & 0 deletions linalg_ops/convolution/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# Copyright 2024 The IREE Authors
#
# 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.
#
###############################################################################


set(_DTYPES)
list(APPEND _DTYPES "f16_f16_f16")
list(APPEND _DTYPES "f32_f32_f32")

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"
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()

###############################################################################
#
# GPU - ROCm/HIP, default flags.
#
###############################################################################

# if(IREE_HIP_TEST_TARGET_CHIP)

# set(_DTYPES)
# list(APPEND _DTYPES "f16_f16_f16")
# list(APPEND _DTYPES "f32_f32_f32")

# foreach(_DTYPE IN LISTS _DTYPES)
# foreach(_SIZE IN LISTS _SIZES)
# iree_test_suites_runner_test(
# NAME
# matmul_hip_${_DTYPE}_${_SIZE}
# TESTS_SRC
# "generated/${_DTYPE}/matmul_${_DTYPE}_${_SIZE}.mlir"
# CALLS_SRC
# "generated/${_DTYPE}/matmul_${_DTYPE}_${_SIZE}_calls.mlir"
# TEST_RUNNER
# iree-test-suites_iree-e2e-matmul-test
# TARGET_BACKEND
# "rocm"
# DRIVER
# "hip"
# COMPILER_FLAGS
# "--iree-hip-target=${IREE_HIP_TEST_TARGET_CHIP}"
# RUNNER_FLAGS
# LABELS
# )
# endforeach()
# endforeach()

# endif()
Loading

0 comments on commit fc08f82

Please sign in to comment.