From 421274e822fe319f25e2caa7f4e06f22b174ddab Mon Sep 17 00:00:00 2001 From: Roy Oursler Date: Fri, 17 Jan 2025 11:25:24 -0800 Subject: [PATCH] benchdnn: inputs: add test_matmul_random_ci --- tests/benchdnn/CMakeLists.txt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/benchdnn/CMakeLists.txt b/tests/benchdnn/CMakeLists.txt index 39bf83f8e4f..cc0cee6e2e1 100644 --- a/tests/benchdnn/CMakeLists.txt +++ b/tests/benchdnn/CMakeLists.txt @@ -1,5 +1,5 @@ #=============================================================================== -# Copyright 2017-2024 Intel Corporation +# Copyright 2017-2025 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -139,6 +139,8 @@ if(NOT DNNL_CPU_RUNTIME STREQUAL "NONE") set(has_cpu true) endif() +find_package(Python3 COMPONENTS Interpreter) + # Very sad CMake older then 3.2 does not support continue() command. file(GLOB all_drivers RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/inputs inputs/*) @@ -146,6 +148,7 @@ if(NOT ONEDNN_BUILD_GRAPH) list(REMOVE_ITEM all_drivers "graph") endif() +set(RANDOM_CI_DRIVERS "matmul") foreach(driver ${all_drivers}) set(driver_dir ${CMAKE_CURRENT_SOURCE_DIR}/inputs/${driver}) # Collect input files in groups @@ -161,6 +164,17 @@ foreach(driver ${all_drivers}) inputs/brgemm/test_brgemm_all inputs/conv/test_conv_all inputs/graph/test_graph_all inputs/rnn/test_lstm_all) + if(PYTHON3_FOUND AND ${driver} IN_LIST RANDOM_CI_DRIVERS) + set(SYNTHDNN "${CMAKE_CURRENT_SOURCE_DIR}/../synthdnn/synthdnn.py") + set(RANDOM_CI "${CMAKE_CURRENT_BINARY_DIR}/inputs/${driver}/test_${driver}_random_ci") + execute_process(COMMAND ${PYTHON3_EXECUTABLE} ${SYNTHDNN} ${driver} -s2000 -b ${RANDOM_CI} RESULT_VARIABLE RET OUTPUT_VARIABLE OUT ERROR_VARIABLE OUT) + if(${RET}) + message(Warn "Generation of ${RANDOM_CI} exited with error code ${RET}") + else() + set(test_files_ci "${test_files_ci};test_${driver}_random_ci") + endif() + endif() + if(DNNL_TEST_SET_COVERAGE EQUAL DNNL_TEST_SET_SMOKE) if(has_gpu) register_all_tests(gpu "${driver}" "${test_files_smoke}")