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

Standardising Benchmarks, with support for nanobench as an option for its backend #6448

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

vrnimje
Copy link
Contributor

@vrnimje vrnimje commented Feb 27, 2024

Background context: #6357

Proposed Changes

  • Added bench-marking interface perftests_report, which also supports nanobench as the backend
  • Added option for using nanobench, or default to timed-loop, as the back-end for performance measurement
  • Fixed compilation issues with the above mentioned PR

@StellarBot
Copy link

Can one of the admins verify this patch?

Copy link

codacy-production bot commented Feb 27, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00% 74.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (eb2bf57) 217975 185524 85.11%
Head commit (2575d63) 190903 (-27072) 162490 (-23034) 85.12% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#6448) 100 74 74.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy will stop sending the deprecated coverage status from June 5th, 2024. Learn more

@isidorostsa
Copy link
Contributor

isidorostsa commented Mar 5, 2024

Congratulations for getting nanobench into the build system!
I left some minor corrections and a suggestion, do not worry about the tests, they are not failing because of your changes.
Great PR overall :)

@vrnimje
Copy link
Contributor Author

vrnimje commented Mar 6, 2024

Congratulations for getting nanobench into the build system! I left some minor corrections and a suggestion, do not worry about the tests, they are not failing because of your changes. Great PR overall :)

Thanks for the response, but I am unable to see your suggestions in the PR. Could you please check once from your side?

cmake/HPX_SetupNanobench.cmake Outdated Show resolved Hide resolved
cmake/HPX_SetupNanobench.cmake Outdated Show resolved Hide resolved
cmake/HPX_SetupNanobench.cmake Outdated Show resolved Hide resolved
libs/core/testing/src/performance.cpp Outdated Show resolved Hide resolved
@Pansysk75
Copy link
Member

retest

@Pansysk75
Copy link
Member

@vrnimje Thanks for making the changes for this to work. Unfortunately, our Jenkins CI is not working right now due to some issues on our side. I'll trigger the jobs once we've resolved the issue. Thanks for your patience.

@vrnimje
Copy link
Contributor Author

vrnimje commented Jun 11, 2024

@vrnimje Thanks for making the changes for this to work. Unfortunately, our Jenkins CI is not working right now due to some issues on our side. I'll trigger the jobs once we've resolved the issue. Thanks for your patience.

Ok, thanks for letting me know

Copy link

codacy-production bot commented Jul 3, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.12% 74.79%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (17bbc63) 222489 189245 85.06%
Head commit (c35e4e4) 191148 (-31341) 162814 (-26431) 85.18% (+0.12%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#6448) 119 89 74.79%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences


🚀 Don’t miss a bit, follow what’s new on Codacy.

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

@Pansysk75
Copy link
Member

retest lsu

@Pansysk75
Copy link
Member

@vrnimje PR #6517 should fix the perftests test failure, could you rebase again to verify?
Thanks for your patience with this

@StellarBot
Copy link

Performance test report

HPX Performance

Comparison

BENCHMARKFORK_JOIN_EXECUTORPARALLEL_EXECUTORSCHEDULER_EXECUTOR
For Each------

Info

PropertyBeforeAfter
HPX Commitd27ac2e2253c4f
HPX Datetime2024-03-18T14:00:30+00:002024-07-10T17:33:21+00:00
Hostnamemedusa08.rostam.cct.lsu.edumedusa08.rostam.cct.lsu.edu
Envfile
Compiler/opt/apps/llvm/13.0.1/bin/clang++ 13.0.1/opt/apps/llvm/18.1.5/bin/clang++ 18.1.5
Clusternamerostamrostam
Datetime2024-03-18T09:18:04.949759-05:002024-07-10T12:39:48.244788-05:00

Comparison

BENCHMARKNO-EXECUTOR
Future Overhead - Create Thread Hierarchical - Latch--

Info

PropertyBeforeAfter
HPX Commitd27ac2e2253c4f
HPX Datetime2024-03-18T14:00:30+00:002024-07-10T17:33:21+00:00
Hostnamemedusa08.rostam.cct.lsu.edumedusa08.rostam.cct.lsu.edu
Envfile
Compiler/opt/apps/llvm/13.0.1/bin/clang++ 13.0.1/opt/apps/llvm/18.1.5/bin/clang++ 18.1.5
Clusternamerostamrostam
Datetime2024-03-18T09:19:53.062988-05:002024-07-10T12:41:38.213424-05:00

Comparison

BENCHMARKFORK_JOIN_EXECUTOR_DEFAULT_FORK_JOIN_POLICY_ALLOCATORPARALLEL_EXECUTOR_DEFAULT_PARALLEL_POLICY_ALLOCATORSCHEDULER_EXECUTOR_DEFAULT_SCHEDULER_EXECUTOR_ALLOCATOR
Stream Benchmark - Add------
Stream Benchmark - Scale-------
Stream Benchmark - Triad------
Stream Benchmark - Copy------

Info

PropertyBeforeAfter
HPX Commitd27ac2e2253c4f
HPX Datetime2024-03-18T14:00:30+00:002024-07-10T17:33:21+00:00
Hostnamemedusa08.rostam.cct.lsu.edumedusa08.rostam.cct.lsu.edu
Envfile
Compiler/opt/apps/llvm/13.0.1/bin/clang++ 13.0.1/opt/apps/llvm/18.1.5/bin/clang++ 18.1.5
Clusternamerostamrostam
Datetime2024-03-18T09:20:13.002391-05:002024-07-10T12:41:58.999029-05:00

Explanation of Symbols

SymbolMEANING
=No performance change (confidence interval within ±1%)
(=)Probably no performance change (confidence interval within ±2%)
(+)/(-)Very small performance improvement/degradation (≤1%)
+/-Small performance improvement/degradation (≤5%)
++/--Large performance improvement/degradation (≤10%)
+++/---Very large performance improvement/degradation (>10%)
?Probably no change, but quite large uncertainty (confidence interval with ±5%)
??Unclear result, very large uncertainty (±10%)
???Something unexpected…

@vrnimje vrnimje marked this pull request as ready for review July 11, 2024 15:43
@vrnimje vrnimje requested a review from hkaiser as a code owner July 11, 2024 15:43
Comment on lines 1 to 31
import sys
import subprocess
import json
import matplotlib.pyplot as plt

if len(sys.argv) != 2:
if len(sys.argv) == 1:
print("No benchmark selected!")
else:
print("Too many arguments!")
print("Usage: python perftests_plot.py [path_to_benchmark_binary]")
else:
test_name = sys.argv[1]

contents = subprocess.run([test_name, "--detailed_bench"], capture_output=True)

json_obj = json.loads(contents.stdout.decode('utf-8'))

test_names = []
samples = []

for test in json_obj["outputs"]:
test_names.append(test["name"] + ",\n" + test["executor"])
samples.append(test["series"])

fig = plt.figure(figsize=(20, 6))
ax = fig.add_subplot()
bp = ax.boxplot(samples, showfliers=False)
plt.setp(ax.set_xticklabels(test_names), fontsize=7)
plt.show()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file can be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in c35e4e4

CMakeLists.txt Outdated
hpx_option(
HPX_WITH_NANOBENCH
BOOL
"Use Nanobench for performance tests. Nanobench will be fetched using FetchContent (defualt: OFF)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in c35e4e4

Comment on lines 37 to 41
// std::cout << "-----Average-(hpx::small_vector<" << typeid(T).name() << ", "
// << N << ">)------ \n"
// << std::left << "Average execution time : " << std::right
// << std::setw(8) << time / 1e9 << "\n";
// }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in c35e4e4

@StellarBot
Copy link

Performance test report

HPX Performance

Comparison

BENCHMARKFORK_JOIN_EXECUTORPARALLEL_EXECUTORSCHEDULER_EXECUTOR
For Each------

Info

PropertyBeforeAfter
HPX Commitd27ac2ebe08d07
HPX Datetime2024-03-18T14:00:30+00:002024-07-14T18:02:01+00:00
Envfile
Compiler/opt/apps/llvm/13.0.1/bin/clang++ 13.0.1/opt/apps/llvm/18.1.5/bin/clang++ 18.1.5
Hostnamemedusa08.rostam.cct.lsu.edumedusa08.rostam.cct.lsu.edu
Clusternamerostamrostam
Datetime2024-03-18T09:18:04.949759-05:002024-07-14T13:10:12.021151-05:00

Comparison

BENCHMARKNO-EXECUTOR
Future Overhead - Create Thread Hierarchical - Latch--

Info

PropertyBeforeAfter
HPX Commitd27ac2ebe08d07
HPX Datetime2024-03-18T14:00:30+00:002024-07-14T18:02:01+00:00
Envfile
Compiler/opt/apps/llvm/13.0.1/bin/clang++ 13.0.1/opt/apps/llvm/18.1.5/bin/clang++ 18.1.5
Hostnamemedusa08.rostam.cct.lsu.edumedusa08.rostam.cct.lsu.edu
Clusternamerostamrostam
Datetime2024-03-18T09:19:53.062988-05:002024-07-14T13:12:02.190209-05:00

Comparison

BENCHMARKFORK_JOIN_EXECUTOR_DEFAULT_FORK_JOIN_POLICY_ALLOCATORPARALLEL_EXECUTOR_DEFAULT_PARALLEL_POLICY_ALLOCATORSCHEDULER_EXECUTOR_DEFAULT_SCHEDULER_EXECUTOR_ALLOCATOR
Stream Benchmark - Add------
Stream Benchmark - Scale-------
Stream Benchmark - Triad------
Stream Benchmark - Copy------

Info

PropertyBeforeAfter
HPX Commitd27ac2ebe08d07
HPX Datetime2024-03-18T14:00:30+00:002024-07-14T18:02:01+00:00
Envfile
Compiler/opt/apps/llvm/13.0.1/bin/clang++ 13.0.1/opt/apps/llvm/18.1.5/bin/clang++ 18.1.5
Hostnamemedusa08.rostam.cct.lsu.edumedusa08.rostam.cct.lsu.edu
Clusternamerostamrostam
Datetime2024-03-18T09:20:13.002391-05:002024-07-14T13:12:22.720325-05:00

Explanation of Symbols

SymbolMEANING
=No performance change (confidence interval within ±1%)
(=)Probably no performance change (confidence interval within ±2%)
(+)/(-)Very small performance improvement/degradation (≤1%)
+/-Small performance improvement/degradation (≤5%)
++/--Large performance improvement/degradation (≤10%)
+++/---Very large performance improvement/degradation (>10%)
?Probably no change, but quite large uncertainty (confidence interval with ±5%)
??Unclear result, very large uncertainty (±10%)
???Something unexpected…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants