psf / pyperf

Toolkit to run Python benchmarks
http://pyperf.readthedocs.io/
MIT License
782 stars 77 forks source link

Boost tuning for AMD processors #120

Open tiran opened 2 years ago

tiran commented 2 years ago

python -m pyperf system has no code to toggle Boost of AMD Ryzen processors. Boost can be disabled globally with echo 0 > /sys/devices/system/cpu/cpufreq/boost.

processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 23
model           : 113
model name      : AMD Ryzen 7 3800X 8-Core Processor
stepping        : 0
microcode       : 0x8701021
cpu MHz         : 2200.000
cache size      : 512 KB
physical id     : 0
siblings        : 16
core id         : 0
cpu cores       : 8
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 16
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr rdpru wbnoinvd arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif v_spec_ctrl umip rdpid overflow_recov succor smca sme sev sev_es
bugs            : sysret_ss_attrs spectre_v1 spectre_v2 spec_store_bypass
bogomips        : 7784.92
TLB size        : 3072 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 43 bits physical, 48 bits virtual
power management: ts ttp tm hwpstate cpb eff_freq_ro [13] [14]
$ sudo bin/python -m pyperf system
Show the system configuration

System state
============

CPU: use 4 logical CPUs: 12-15
Perf event: Maximum sample rate: 1 per second
ASLR: Full randomization
Linux scheduler: Isolated CPUs (4/16): 12-15
Linux scheduler: RCU disabled on CPUs (4/16): 12-15
CPU Frequency: 0-11=min=2200 MHz, max=3900 MHz; 12-15=min=max=3900 MHz
IRQ affinity: irqbalance service: inactive
IRQ affinity: Default IRQ affinity: CPU 0-11
IRQ affinity: IRQ affinity: IRQ 0,2=CPU 0-15; IRQ 1,3-15,25-27,29-30,41-42,44,46-53,58-59,93-94,96,98=CPU 0-11; IRQ 60=CPU 0; IRQ 61=CPU 1; IRQ 62=CPU 2; IRQ 63=CPU 3; IRQ 64=CPU 4; IRQ 65=CPU 5; IRQ 66=CPU 6; IRQ 67=CPU 7; IRQ 68=CPU 8; IRQ 69=CPU 9; IRQ 70=CPU 10; IRQ 71=CPU 11; IRQ 72=CPU 12; IRQ 73=CPU 13; IRQ 74=CPU 14; IRQ 75=CPU 15; IRQ 76-91=CPU None
Power supply: the power cable is unplugged

Advices
=======

Power supply: The power cable must be plugged

Warnings
========

Turbo Boost (MSR): Failed to read MSR 0x1a0 from /dev/cpu/12/msr: [Errno 5] Input/output error

OK! System ready for benchmarking
corona10 commented 2 years ago

@tiran Do you have plan to submit the PR?