Skip to content

Commit 5ab6355

Browse files
committed
[Benchmarks] Update perf readme
- remove intel_pstate disabling, this can lead to considerable peak cpu frequency limitation - remove isolcpus, this causes projects to build on a single cpu only - fix cpu governor script, piping sysctl command caused a failure but it is not needed - add a missing command to apply perf_event_paranoid option immediately - minor style updates
1 parent ba85a64 commit 5ab6355

File tree

1 file changed

+11
-27
lines changed

1 file changed

+11
-27
lines changed

devops/scripts/benchmarks/PERFORMANCE_TUNING.md

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,38 +6,16 @@ For framework-specific information, see [README.md](README.md) and [CONTRIB.md](
66
## Table of Contents
77

88
- [Overview](#overview)
9-
- [System Configuration](#system-configuration)
109
- [CPU Tuning](#cpu-tuning)
1110
- [GPU Configuration](#gpu-configuration)
11+
- [Driver Version](#driver-version)
1212
- [Perf Configuration](#perf-configuration)
1313
- [Environment Variables](#environment-variables)
1414

1515
## Overview
1616

1717
Performance benchmarking requires a stable and optimized system environment to produce reliable and reproducible results. This guide covers essential system tuning steps for reducing run-to-run variance in benchmark results.
1818

19-
## System Configuration
20-
21-
### Kernel Parameters
22-
23-
Add the following to `/etc/default/grub` in `GRUB_CMDLINE_LINUX`:
24-
```
25-
# Disable CPU frequency scaling
26-
# intel_pstate=disable
27-
28-
# Isolate CPUs for benchmark workloads (example: reserve cores 2-7), preventing other processes
29-
# from using them.
30-
# isolcpus=2-7
31-
32-
GRUB_CMDLINE_LINUX="intel_pstate=disable isolcpus=2-7 <other_options>"
33-
```
34-
35-
Update GRUB and reboot:
36-
```bash
37-
sudo update-grub
38-
sudo reboot
39-
```
40-
4119
## CPU Tuning
4220

4321
### CPU Frequency Scaling
@@ -66,7 +44,7 @@ After=multi-user.target
6644
6745
[Service]
6846
Type=oneshot
69-
ExecStart=/usr/bin/cpupower frequency-set --governor performance && sysctl --system
47+
ExecStart=/usr/bin/cpupower frequency-set --governor performance
7048
7149
[Install]
7250
WantedBy=multi-user.target
@@ -99,7 +77,12 @@ cat /sys/class/drm/card1/device/vendor # Should be 0x8086 for Intel
9977
cat /sys/class/drm/card1/device/device # Device ID
10078
```
10179

102-
Verify the max frequency is set to the true max. For Arc B580, the maximum frequency is 2850 MHz. To see this value, run “cat /sys/class/drm/card1/device/tile0/gt0/freq0/max_freq”. If the above value is not equal to the max frequency, set it as such:
80+
Verify the max frequency is set to the true max. For Arc B580, the maximum frequency is 2850 MHz. To see this value, run:
81+
```bash
82+
cat /sys/class/drm/card1/device/tile0/gt0/freq0/max_freq
83+
```
84+
85+
If the above value is not equal to the max frequency, set it as such:
10386
```bash
10487
# Arc B580 (Battlemage)
10588
echo 2850 > /sys/class/drm/card1/device/tile0/gt0/freq0/max_freq
@@ -118,9 +101,9 @@ max_freq=$(cat /sys/class/drm/card1/gt_max_freq_mhz)
118101
echo $max_freq | sudo tee /sys/class/drm/card1/gt_min_freq_mhz
119102
```
120103

121-
The result can be verified using tools such as oneprof or unitrace to track frequency over time for some arbitrary benchmark (many iterations of a small problem size is recommended). The frequency should remain fixed assuming thermal throttling does not occur.
104+
The result can be verified using tools such as `oneprof` or `unitrace` to track frequency over time for some arbitrary benchmark (many iterations of a small problem size is recommended). The frequency should remain fixed assuming thermal throttling does not occur.
122105

123-
## Driver version
106+
## Driver Version
124107
Make sure you are using the latest driver (Ubuntu)
125108
```bash
126109
sudo apt update && sudo apt upgrade
@@ -145,6 +128,7 @@ Make the setting persistent across reboots by adding it to sysctl configuration:
145128
echo 'kernel.perf_event_paranoid = -1' | sudo tee -a /etc/sysctl.d/99-perf.conf
146129

147130
# Apply immediately
131+
sudo sysctl kernel.perf_event_paranoid=-1
148132
sudo sysctl -p
149133
```
150134

0 commit comments

Comments
 (0)