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

Set CPU frequency governor and frequency before running the benchmarks #6715

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 6 additions & 2 deletions nix/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ let
'';


# Underlying benchmarking library used by plutus-benchmark and tasty-papi
papi-pkgs = lib.optional pkgs.hostPlatform.isLinux pkgs.papi;
papi-pkgs = lib.optionals pkgs.hostPlatform.isLinux [
# Needed to fix the frequency and governor of the CPU running the benchmarks
pkgs.cpufrequtils
# Underlying benchmarking library used by plutus-benchmark and tasty-papi
pkgs.papi
];


all-pkgs = [
Expand Down
4 changes: 4 additions & 0 deletions scripts/ci-plutus-benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ cabal clean
if [[ -z $(which taskset) ]]; then
TASKSET=""
else
echo "[ci-plutus-benchmark]: Setting CPU $CAPABILITY_NUM frequency governor to 'userspace' and frequency to 4.21GHz"
# This makes the benchmark reliable on a single core and addresses the issue of large variance in the results.
cpufreq-set --cpu $CAPABILITY_NUM --governor userspace
cpufreq-set --cpu $CAPABILITY_NUM --related --freq 4.21GHz
TASKSET="taskset -c $CAPABILITY_NUM"
fi

Expand Down
Loading