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

Integration of perftest CI with standardised benchmarks #6514

Draft
wants to merge 75 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
a105781
Add initial nanobench benchmark config
vrnimje Feb 16, 2024
1d9194e
Pyperf integration for testing puporses
vrnimje Feb 21, 2024
b854128
Added interface for nanbench backend, and tested interface with minma…
vrnimje Feb 25, 2024
d21a0c5
Added workflows to test out benchmarks
vrnimje Feb 26, 2024
38e91e3
Modified CI to build and test minmax benchmark only
vrnimje Feb 26, 2024
7bada72
Added separate CI for benchmark without nanobench
vrnimje Feb 26, 2024
8d35c46
Changing new CI name
vrnimje Feb 26, 2024
d43015a
Correcting CI names
vrnimje Feb 26, 2024
63d3c59
Changing CI activations to PR only
vrnimje Feb 27, 2024
2677440
Adding back namespace defs and add_library call for nanobench
vrnimje Mar 7, 2024
296587c
Clean up minmax test
vrnimje Mar 16, 2024
4b4ab60
Adding command line argument for detailed bench output
vrnimje Mar 16, 2024
cb12ce5
Fixing CI format
vrnimje Mar 16, 2024
bf3ad36
Adding initial benchmark visualisation script
vrnimje Mar 17, 2024
f7228b9
Added benchmark output specialisations for normal case as well
vrnimje Mar 27, 2024
4ff833e
Standardised modules.datastructures.small_vector_benchmark, and made …
vrnimje Mar 28, 2024
acb38b7
Updated cmdline switching to local config, and refactored benchmarks …
vrnimje Apr 11, 2024
95309f9
Removing definition of inline variable, and modified CIs to use the c…
vrnimje Apr 12, 2024
1ccd4b8
Applying cmake-format and clang-format
vrnimje Apr 19, 2024
da0ce5f
Adding explicit double to long double conversions for the default case
vrnimje Apr 22, 2024
0ede042
Fixed implicit conversion issue while using add_time function
vrnimje Apr 22, 2024
ceeba99
Standardised foreach_report, stream_report and future_overhead_report…
vrnimje Jun 10, 2024
7e6606e
Added initial perftests CI config for displaying plots in CDash
vrnimje Jun 1, 2024
bab5e13
Configured ctest.cmake into CI, instead of directly using ctest -D
vrnimje Jun 3, 2024
b9a0c72
Moved plot generation to ctest.cmake
vrnimje Jun 4, 2024
bce01c6
Changed some internal paths for json file generation
vrnimje Jun 4, 2024
f6402f8
Fixed issue, where python script was not executing from ctest.cmake
vrnimje Jun 5, 2024
7053cc6
Adding custom target for cdash results and plot generation, for each …
vrnimje Jun 10, 2024
7e51dc8
Separate cmake function defined for perftest reports, for taking addi…
vrnimje Jun 17, 2024
d31811a
Added more perf-report tests, and made improvements to the perftest h…
vrnimje Jun 18, 2024
52348b4
Removing debgugging modifications
vrnimje Jun 18, 2024
a280fe5
Removed the cdash image printing for detailed config of perftest report
vrnimje Jun 18, 2024
6783468
Defined the cmake config command for cdash properly
vrnimje Jun 18, 2024
5c813af
Fixing syntax for perftest_init in standardised benchmarks
vrnimje Jun 21, 2024
5ee6eb0
Removing unnecessary perftest_cfg call from future_overhead_report test
vrnimje Jun 21, 2024
950c28d
Update the plotting script
vrnimje Jun 21, 2024
192e943
Added comparision with pre-defined baselines, and standardised transf…
vrnimje Jul 2, 2024
a27a1f0
Standardised benchmark_inplace_merge and benchmark_merge
vrnimje Jul 3, 2024
eba0181
Standardised benchmark_is_heap and benchmark_remove
vrnimje Jul 4, 2024
6b7b969
Standardised benchmark_remove_if and fixed formatting issues with ben…
vrnimje Jul 4, 2024
8c7c1a6
Added KS-test for benchmark comparision, and updated baselines
vrnimje Jul 14, 2024
6772090
Made modifications for perftests comment mechanism
vrnimje Jul 15, 2024
6e4c647
Removed the reports folder from the artifacts, and clang-formatted files
vrnimje Jul 15, 2024
7dd0bf7
Moved comment mechanism to entry.sh
vrnimje Jul 15, 2024
2cf0409
Sourcing the environment file, and removed boost fetch from perftests…
vrnimje Jul 15, 2024
f48016f
Added asio fetch option for CMake Configure step in perftests' ctest.…
vrnimje Jul 15, 2024
7100ba0
Manually installing scipy module for plotting script
vrnimje Jul 15, 2024
3eac684
Using user installation for scipy, due to permission issues
vrnimje Jul 15, 2024
db6137e
Removed scipy installation, as it has been added to virtual env
vrnimje Jul 15, 2024
b935650
Importing scipy.stats in plotting script
vrnimje Jul 15, 2024
6072f1b
Removed pushd commands in comment_github.sh
vrnimje Jul 16, 2024
1ab4def
Re-formatted comment for performance discrepancy, and reverted back t…
vrnimje Jul 22, 2024
d305da4
Removed addition of newlines into perf-report, and referenced correct…
vrnimje Jul 22, 2024
f197521
Added commands to write CTest Build ID to the file, in ctest.cmake
vrnimje Jul 22, 2024
d3b59d0
Calling status_computation function manually in lsu-perftest, and men…
vrnimje Jul 23, 2024
b3e4382
Added option for printing CDash image path, and modified lsu-perftest…
vrnimje Jul 29, 2024
653a28a
Updated perftest-baselines, moved comment mechanism to status functio…
vrnimje Jul 29, 2024
d561688
Removed explicit call to artifacts-storage function, and modified per…
vrnimje Jul 30, 2024
1589588
Removing ctest_status check for commenting perftest-report
vrnimje Jul 30, 2024
9f3853d
Changed plotting format, and made definitions of dependencies and exe…
vrnimje Aug 14, 2024
91a6d3f
Standardised the following tests, and made formatting changes to plot…
vrnimje Aug 14, 2024
f6e9b0b
Fixed subplot indexing issue in perftest plotting script, updated bas…
vrnimje Aug 15, 2024
40e38d0
Scaling down perftest plot images, so that it is displayed entirely o…
vrnimje Aug 15, 2024
54e422c
Changed plotting format orientation
vrnimje Aug 15, 2024
d7de092
Increasing test output size for CDash, using CTestCustom.ctest file
vrnimje Aug 15, 2024
a9d5df2
Renamed ctestcustom file with cmake extension, and resized image plot…
vrnimje Aug 15, 2024
363eefb
Increased number of epochs for performance measurements
vrnimje Aug 17, 2024
195bae6
Updated baselines with updated number of epochs, and changed uploaded…
vrnimje Aug 17, 2024
ff62d46
Separated comparision subplot images, and changed bootstrap statistic…
vrnimje Aug 19, 2024
17dfd82
Added measurements for each sub-test on CDash, and prefixed performan…
vrnimje Aug 22, 2024
f3620d7
Removed escape characters from the CDash mustache template
vrnimje Aug 22, 2024
b53373e
Added options for test_count in the tests missing it and increased in…
vrnimje Aug 23, 2024
7f53069
Updated perftest baselines to have 1000 iterations, and cleaned up pe…
vrnimje Aug 24, 2024
70461b3
Modified bootstrapping parameters, and reduced the perftest iteration…
vrnimje Aug 24, 2024
c69f9a3
Changed plots to histogram with kde, removed generated images from ar…
vrnimje Aug 27, 2024
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
46 changes: 46 additions & 0 deletions .github/workflows/linux_with_bench_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright (c) 2024 Vedant Nimje
#
# SPDX-License-Identifier: BSL-1.0
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

name: Linux CI (Debug) with Benchmark Test

on: [pull_request]


jobs:
build:
runs-on: ubuntu-latest
container: stellargroup/build_env:14

steps:
- uses: actions/checkout@v4
- name: Configure
shell: bash
run: |
cmake \
. \
-Bbuild \
-GNinja \
-DCMAKE_BUILD_TYPE=Debug \
-DHPX_WITH_MALLOC=system \
-DHPX_WITH_FETCH_ASIO=ON \
-DHPX_WITH_EXAMPLES=ON \
-DHPX_WITH_TESTS=ON \
-DHPX_WITH_TESTS_MAX_THREADS_PER_LOCALITY=2 \
-DHPX_WITH_CHECK_MODULE_DEPENDENCIES=On
- name: Build
shell: bash
run: |
cmake --build build/ --target tests.performance.modules.segmented_algorithms.minmax_element_performance
- name: Test
shell: bash
run: |
cd build
./bin/minmax_element_performance_test
- name: Test with detailed output
shell: bash
run: |
cd build
./bin/minmax_element_performance_test --hpx:detailed_bench
48 changes: 48 additions & 0 deletions .github/workflows/linux_with_nanobench_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copyright (c) 2024 Vedant Nimje
#
# SPDX-License-Identifier: BSL-1.0
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

name: Linux CI (Debug) with Nanobench Benchmark Test

on: [pull_request]


jobs:
build:
runs-on: ubuntu-latest
container: stellargroup/build_env:14

steps:
- uses: actions/checkout@v4
- name: Configure
shell: bash
run: |
cmake \
. \
-Bbuild \
-GNinja \
-DCMAKE_BUILD_TYPE=Debug \
-DHPX_WITH_MALLOC=system \
-DHPX_WITH_FETCH_ASIO=ON \
-DHPX_WITH_EXAMPLES=ON \
-DHPX_WITH_TESTS=ON \
-DHPX_WITH_NANOBENCH=ON \
-DHPX_WITH_TESTS_MAX_THREADS_PER_LOCALITY=2 \
-DHPX_WITH_CHECK_MODULE_DEPENDENCIES=On
- name: Build
shell: bash
run: |
cmake --build build/ --target tests.performance.modules.segmented_algorithms.minmax_element_performance
- name: Test
shell: bash
run: |
cd build
./bin/minmax_element_performance_test

- name: Test with detailed output
shell: bash
run: |
cd build
./bin/minmax_element_performance_test --hpx:detailed_bench
19 changes: 12 additions & 7 deletions .jenkins/lsu-perftests/batch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,14 @@ status_computation_and_artifacts_storage() {

# Copy the testing directory for saving as an artifact
cp -r ${build_dir}/Testing ${src_dir}/${configuration_name}-Testing
cp -r ${build_dir}/reports ${src_dir}/${configuration_name}-reports
cp -r ${build_dir}/*.json ${src_dir}/${configuration_name}-reports

echo "${ctest_status}" > "jenkins-hpx-${configuration_name}-ctest-status.txt"

if [[ -s $build_dir/index.html ]]; then
cd $build_dir && sh $src_dir/.jenkins/lsu-perftests/comment_github.sh
fi

exit $ctest_status
}

Expand All @@ -33,7 +38,7 @@ cp -r ${src_dir}/tools/perftests_ci ${build_dir}/tools
# Variables
perftests_dir=${build_dir}/tools/perftests_ci
envfile=${src_dir}/.jenkins/lsu-perftests/env-${configuration_name}.sh
mkdir -p ${build_dir}/reports
mkdir -p ${src_dir}/${configuration_name}-reports
logfile=${build_dir}/reports/jenkins-hpx-${configuration_name}.log

# Load python packages
Expand All @@ -48,14 +53,14 @@ plot_errors=0
wait

# Build and Run the perftests
source ${src_dir}/.jenkins/lsu-perftests/launch_perftests.sh
source ${src_dir}/.jenkins/lsu-perftests/env-${configuration_name}.sh

# Dummy ctest to upload the html report of the perftest
set +e
# CTest to upload the results to CDash
ctest \
--verbose \
-VV \
--output-on-failure \
-S ${src_dir}/.jenkins/lsu-perftests/ctest.cmake \
-DCTEST_BUILD_CONFIGURATION_NAME="${configuration_name}" \
-DCTEST_CONFIGURE_EXTRA_OPTIONS="${configure_extra_options}" \
-DCTEST_SOURCE_DIRECTORY="${src_dir}" \
-DCTEST_BINARY_DIRECTORY="${build_dir}"
set -e
6 changes: 2 additions & 4 deletions .jenkins/lsu-perftests/comment_github.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

set -eux

pushd perftests-reports/reference-comparison
# pushd perftests-reports/reference-comparison

# In the order of replacement rule in sed:
# - Remove the image as does not display in github comments (section Details in the report)
Expand All @@ -23,6 +23,4 @@ curl \
-X POST \
-H "Authorization: token ${GITHUB_TOKEN}" \
https://api.github.com/repos/STEllAR-GROUP/hpx/issues/${ghprbPullId}/comments \
-d "{\"body\": \"<details><summary>Performance test report</summary>${report}<\/details>\"}"

popd
-d "{\"body\": \"<details><summary>Performance test report<\/summary><table><tr><th>Test name<\/th><th>Executor<\/th><th>Percentage Diff.<\/th><th>Classification<\/th><\/tr>${report}<\/table><\/details>\"}"
98 changes: 96 additions & 2 deletions .jenkins/lsu-perftests/ctest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

# This is a dummy file to trigger the upload of the perftests reports
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)

set(CTEST_TEST_TIMEOUT 300)
Expand All @@ -20,7 +19,7 @@ set(CTEST_SUBMIT_RETRY_DELAY 60)

if(NOT "$ENV{ghprbPullId}" STREQUAL "")
set(CTEST_BUILD_NAME "$ENV{ghprbPullId}-${CTEST_BUILD_CONFIGURATION_NAME}")
set(CTEST_TRACK "Experimental")
set(CTEST_TRACK "Pull_Requests")
else()
set(CTEST_BUILD_NAME
"$ENV{git_local_branch}-${CTEST_BUILD_CONFIGURATION_NAME}"
Expand All @@ -29,4 +28,99 @@ else()
endif()

ctest_start(Experimental TRACK "${CTEST_TRACK}")

ctest_update()
ctest_submit(
PARTS Update
BUILD_ID __ctest_build_id
RETURN_VALUE __update_result
)

set(CTEST_CONFIGURE_COMMAND "${CMAKE_COMMAND} ${CTEST_SOURCE_DIRECTORY}")
set(CTEST_CONFIGURE_COMMAND
"${CTEST_CONFIGURE_COMMAND} -G${CTEST_CMAKE_GENERATOR}"
)
set(CTEST_CONFIGURE_COMMAND
"${CTEST_CONFIGURE_COMMAND} -B${CTEST_BINARY_DIRECTORY}"
)
set(CTEST_CONFIGURE_COMMAND
"${CTEST_CONFIGURE_COMMAND} -DHPX_WITH_NANOBENCH=ON"
)
set(CTEST_CONFIGURE_COMMAND
"${CTEST_CONFIGURE_COMMAND} -DHPX_WITH_PARALLEL_TESTS_BIND_NONE=ON"
)
set(CTEST_CONFIGURE_COMMAND
"${CTEST_CONFIGURE_COMMAND} ${CTEST_CONFIGURE_EXTRA_OPTIONS}"
)

ctest_configure()
ctest_submit(
PARTS Configure
BUILD_ID __ctest_build_id
RETURN_VALUE __configure_result
)
if(NOT CTEST_BUILD_ID AND __ctest_build_id)
set(CTEST_BUILD_ID ${__ctest_build_id})
endif()
set(ctest_submission_result ${ctest_submission_result} "Configure: "
${__configure_result} "\n"
)

set(benchmarks
minmax_element_performance
small_vector_benchmark
future_overhead_report
stream_report
foreach_report
transform_reduce_scaling
benchmark_is_heap_until
benchmark_merge
benchmark_inplace_merge
benchmark_is_heap
benchmark_remove
benchmark_remove_if
benchmark_partial_sort
benchmark_partial_sort_parallel
benchmark_nth_element
benchmark_nth_element_parallel
)

foreach(benchmark ${benchmarks})
ctest_build(TARGET ${benchmark}_cdash_results FLAGS "-k0 -j ${CTEST_BUILD_PARALLELISM}")
endforeach()

ctest_submit(
PARTS Build
BUILD_ID __ctest_build_id
RETURN_VALUE __build_result
)
if(NOT CTEST_BUILD_ID AND __ctest_build_id)
set(CTEST_BUILD_ID ${__ctest_build_id})
endif()
set(ctest_submission_result ${ctest_submission_result} "Build: "
${__build_result} "\n"
)

ctest_test(
INCLUDE "_perftest$"
PARALLEL_LEVEL "${CTEST_TEST_PARALLELISM}"
)
ctest_submit(
PARTS Test
BUILD_ID __ctest_build_id
RETURN_VALUE __test_result
)

if(NOT CTEST_BUILD_ID AND __ctest_build_id)
set(CTEST_BUILD_ID ${__ctest_build_id})
endif()
set(ctest_submission_result ${ctest_submission_result} "Tests: "
${__test_result} "\n"
)

file(WRITE "jenkins-hpx-${CTEST_BUILD_CONFIGURATION_NAME}-cdash-build-id.txt"
"${CTEST_BUILD_ID}"
)
file(WRITE "jenkins-hpx-${CTEST_BUILD_CONFIGURATION_NAME}-cdash-submission.txt"
${ctest_submission_result}
)
29 changes: 28 additions & 1 deletion .jenkins/lsu-perftests/entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,36 @@ status_file="jenkins-hpx-${configuration_name}-ctest-status.txt"

# Comment on the PR if any failures
if [[ $(cat ${status_file}) != 0 ]]; then
./.jenkins/lsu-perftests/comment_github.sh
github_commit_status="failure"
else
github_commit_status="success"
fi

cdash_build_id="$(cat jenkins-hpx-${configuration_name}-cdash-build-id.txt)"

if [[ -z "${ghprbPullId:-}" ]]; then
.jenkins/common/set_github_status.sh \
"${GITHUB_TOKEN}" \
"STEllAR-GROUP/hpx" \
"${GIT_COMMIT}" \
"${github_commit_status}" \
"${configuration_name}" \
"${cdash_build_id}" \
"jenkins/lsu-perftests"
else
# Extract just the organization and repo names "org/repo" from the full URL
github_commit_repo="$(echo $ghprbPullLink | sed -n 's/https:\/\/github.com\/\(.*\)\/pull\/[0-9]*/\1/p')"

# Set GitHub status with CDash url
.jenkins/common/set_github_status.sh \
"${GITHUB_TOKEN}" \
"${github_commit_repo}" \
"${ghprbActualCommit}" \
"${github_commit_status}" \
"${configuration_name}" \
"${cdash_build_id}" \
"jenkins/lsu-perftests"
fi

set -e
exit $(cat ${status_file})
4 changes: 4 additions & 0 deletions .jenkins/lsu-perftests/env-perftests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ module load hwloc
module load openmpi

export CXX_STD="20"

configure_extra_options+=" -DHPX_WITH_CXX_STANDARD=${CXX_STD}"
configure_extra_options+=" -DHPX_WITH_MALLOC=system"
configure_extra_options+=" -DHPX_WITH_FETCH_ASIO=ON"
Loading
Loading