Skip to content

Commit 9108510

Browse files
authored
Merge branch 'master' into compathelper/new_version/2021-01-21-00-54-53-830-758452256
2 parents 7098276 + 4dbf895 commit 9108510

File tree

3 files changed

+65
-1
lines changed

3 files changed

+65
-1
lines changed

Project.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,14 @@ VectorizationBase = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f"
2020
VegaLite = "112f6efa-9a02-5b7d-90c0-432ed331239a"
2121
blis_jll = "6136c539-28a5-5bf0-87cc-b183200dce32"
2222

23-
[compat]
23+
[compat]
24+
=======
25+
BenchmarkTools = "0.5"
26+
DataFrames = "0.22"
27+
LoopVectorization = "0.9"
28+
Octavian = "0.2"
29+
ProgressMeter = "1.4"
30+
Tullio = "0.2"
2431
VectorizationBase = "0.15"
2532
julia = "1.5"
2633

docs/make.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ makedocs(;
1414
pages=[
1515
"Home" => "index.md",
1616
"Usage" => "usage.md",
17+
"Turbo" => "turbo.md",
1718
"Memory Required for Large Matrices" => "memory-required.md",
1819
"Public API" => "public-api.md",
1920
"Internals (Private)" => "internals.md",

docs/src/turbo.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
```@meta
2+
CurrentModule = BLASBenchmarks
3+
```
4+
5+
# Disabling CPU Turbo
6+
7+
Most recent CPUs have the ability to turbo, increasing their clock speeds for brief durations of time as thermal envelope and longer term power-use limitations allow. This is great for performance, but bad for benchmarking.
8+
9+
If you're running Linux, it's probably easy to enable or disable turbo settings without having to reboot into your bios.
10+
The Linux Kernel Documentation is fairly thorough in discussing [CPUFreq](https://www.kernel.org/doc/html/v4.12/admin-guide/pm/cpufreq.html) and [intel_pstate](https://www.kernel.org/doc/html/v4.12/admin-guide/pm/intel_pstate.html) scaling drivers.
11+
12+
To check those on my system, I can run:
13+
```sh
14+
> cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_driver
15+
intel_pstate
16+
intel_pstate
17+
intel_pstate
18+
intel_pstate
19+
intel_pstate
20+
intel_pstate
21+
intel_pstate
22+
intel_pstate
23+
```
24+
This tells me it is using `intel_pstate` in active mode.
25+
26+
The documentation on `intel_pstate` mentions the `no_turbo` attribute:
27+
28+
29+
> If set (equal to 1), the driver is not allowed to set any turbo P-states (see Turbo P-states Support). If unset (equalt to 0, which is the default), turbo P-states can be set by the driver.
30+
31+
This attribute is writable, so running
32+
```sh
33+
echo "1" | sudo tee /sys/devices/system/cpu/intel_pstate/no_turbo
34+
```
35+
disables turbo on this system. This, and closing programs that would compete for system resources (e.g., internet browsers; you can run `(h)top` to see if any processes are consuming non-negligible resources), should hopefully make benchmarking reasonably consistent and reliable.
36+
37+
Finally, when I'm done benchmarking, I can reenable turbo by running:
38+
```sh
39+
echo "0" | sudo tee /sys/devices/system/cpu/intel_pstate/no_turbo
40+
```
41+
42+
If your system does not use the `intel_pstate` driver, check for
43+
```sh
44+
/sys/devices/system/cpu/cpufreq/boost
45+
```
46+
discussed [here](https://www.kernel.org/doc/html/v4.12/admin-guide/pm/cpufreq.html#frequency-boost-support) in the kernel documentation. If the file is present, you should be able to disable boost with
47+
```sh
48+
echo "0" | sudo tee /sys/devices/system/cpu/cpufreq/boost
49+
```
50+
and then reenable with
51+
```sh
52+
echo "1" | sudo tee /sys/devices/system/cpu/cpufreq/boost
53+
```
54+
55+
In either case, you may find it convenient to place these snippets in `#! /bin/bash` scripts for conveniently turning your systems boost on and off as desired.
56+

0 commit comments

Comments
 (0)