Skip to content
Permalink
Browse files

Add pytorch/Glow to the test suite

It (still) requires a noasserts LLVM build, thus not ready
to be a tier1 test just yet.
  • Loading branch information...
pjaaskel committed Oct 14, 2019
1 parent a9dce31 commit 1decde783b9b2c802ce3afa946b69255a2b41fcd
Showing with 72 additions and 8 deletions.
  1. +3 −7 examples/CLBlast/README
  2. +1 −1 examples/CMakeLists.txt
  3. +68 −0 examples/Glow/CMakeLists.txt
@@ -1,11 +1,7 @@
To run the CLBlast tests using pocl:

1) git clone git@github.com:CNugteren/CLBlast.git to this
directory

2) Install a BLAS that the CLBlast's tests can compare the
1) Install a BLAS that the CLBlast's tests can compare the
runs against, e.g. "apt install libblas-dev".

3) Reconfigure pocl. It should autodetect the CLBlast cloned
repository and enable it as a test suite (see the final
messages printed.
2) Reconfigure pocl and run make prepare_examples, which
clones CLBlast, builds it and enables it as a stest suite.
@@ -59,7 +59,7 @@ set(ALL_TESTSUITES
conformance CloverLeaf Halide IntelSVM
opencl-book-samples OpenCV
Parboil piglit PyOpenCL
Rodinia VexCL ViennaCL)
Rodinia VexCL ViennaCL Glow)

if("${ENABLE_TESTSUITES}" STREQUAL "all")
set(ENABLE_TESTSUITES ${ALL_TESTSUITES})
@@ -0,0 +1,68 @@
#=============================================================================
# CMake build file for CLBlast's test suite.
#
# Copyright (c) 2019 Pekka Jääskeläinen
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
#=============================================================================

set(TS_NAME "Glow")
set(TS_BASEDIR "${TESTSUITE_BASEDIR}/${TS_NAME}")
set(TS_BUILDDIR "${TS_BASEDIR}/src/${TS_NAME}-build")
set(TS_SRCDIR "${TESTSUITE_SOURCE_BASEDIR}/${TS_NAME}")

# This tests the Parmance-tested Glow branch in 32b dimension mode.
# The branch occasionally has OpenCL-related or misc. patches on top,
# and is rebased on top of the Glow master (with force push).
set(FETCH_SOURCE GIT_REPOSITORY "https://github.com/parmance/glow.git")

message(STATUS "Enabling testsuite ${TS_NAME}")
list(APPEND ACTUALLY_ENABLED_TESTSUITES "${TS_NAME}")
set(ACTUALLY_ENABLED_TESTSUITES ${ACTUALLY_ENABLED_TESTSUITES} PARENT_SCOPE)

ExternalProject_Add(
${TS_NAME}
${FETCH_SOURCE}
PREFIX "${TS_BASEDIR}"

CMAKE_ARGS
-DCMAKE_BUILD_TYPE=Release
-DGLOW_WITH_CPU=OFF
-DGLOW_WITH_OPENCL=ON
-DTENSOR_DIMS_32_BITS=ON
-DGLOW_WITH_LLVMIRCODEGEN=OFF
# This is needed with some drivers due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67791
-DCMAKE_CXX_FLAGS=-pthread
INSTALL_COMMAND /bin/true
)

set_target_properties(${TS_NAME} PROPERTIES EXCLUDE_FROM_ALL TRUE)
add_dependencies(prepare_examples ${TS_NAME})

# Run the basic "ninja check" suite excluding known problematic
# cases. OpenCLMLTest is a very long running suite especially on simulated
# targets, so exclude it for now and perhaps add as a separate test case
# later. BundleSaver has some (likely) temporary issue of using a
# wrong command line switch.
add_test(NAME Glow
COMMAND "${CMAKE_CTEST_COMMAND}"
"-E" ".*BackendCorrectnessTest|.*MLTest|.*GradCheckTest|^BundleSaver.*"
"-LE" "EXPENSIVE"
WORKING_DIRECTORY "${TS_BUILDDIR}")

0 comments on commit 1decde7

Please sign in to comment.
You can’t perform that action at this time.