Author Topic: Messing with WOF Tables  (Read 12714 times)

ejfluhr

  • Newbie
  • *
  • Posts: 48
  • Karma: +6/-0
    • View Profile
Re: Messing with WOF Tables
« Reply #15 on: March 21, 2025, 05:24:04 pm »
Quote
Ah-ha. So that's why VRATIO_INDEX is always 0-23 and VRATIO_STEP is always exactly 1/24 to 3 figures. VRATIO_STEP is always 0.0409 to account for rounding in VRATIO_STEP to ensure that 23*VRATIO_STEP + VRATIO_START == 1. So really, VRATIO_INDEX is the easier to follow number since it's just the number of active cores. And for a 16 core CPU, one should be able to ignore any VRATIO_INDEX > 15, as 0-15 cover 1-16 active cores, right?

I don't know for sure, but I don't think it works that way.  Rather the index is set up to handle 24 cores, but if the particular processor has < 24 cores, the denominator of that ratio becomes the number of valid cores.  So a 16-core part would be 16/16=1.0, but if 1 core was stopped then the ratio would be 15/16=0.9375 which would then get rounded up the nearest VRATIO point so 23/24.  If 14 cores were active, the ratio 14/16=0.875 would math out to exactly the same as 21/24=0.875 so no rounding needed.

Quote
I had thought it was the case where if 2 active cores in a quad had requested frequencies of 2200 and 1800 then the quad (and thus both cores) would run at 2200MHz.

It is true that all cores in the same quad have to run at the same frequency, and I believe you are correct that the highest-requested frequency wins.  Different quads have the capability to run at different frequencies if implemented by that Linux so, if it's reporting different frequencies aligned with different quads, that could be real.

What are you using to monitor frequencies?   Something like watch -n2 "cat /proc/cpuinfo | grep MHz" or turbostat?
The Sforza datasheet indicates 02CY231 to have a core base frequency of 2.50GHz and max boost of 3.8GHz with Tj Maximum of 85C.  So the cores should not go below 2.50GHz unless some power-saving mode is kicking in, e.g. OS governor settings (e.g. detecting idle and lowering frequency for energy savings). 

I like to use this Mersenne-prime code to push the core power and processor temperatures pretty hard.  I'm pretty sure I compiled & ran on the Blackbird system here, but I cannot seem to log into that right now.   Maybe you can give it a go and see what happens?   I think if you run just 1 or a few threads, the power stress is low but hopefully enough to kick the governor into performance state and it should run close to 3.8GHz.   Then run max-threads and it should drive frequency down toward 2.5GHz, maybe get you closer to that 160W TDP spec?

#include <stdio.h>
#include <stdlib.h>
#include <gmp.h>
int main(int argc, char *argv[]) {
   char *endptr;
   unsigned long int p = strtoul(argv[1],&endptr,10);
   mpz_t M, powerof2, one, two;
   mpz_init(M); mpz_init(powerof2);
   mpz_init_set_str(one,"1",10);
   mpz_init_set_str(two,"2",10);
   mpz_pow_ui(powerof2,two,p);
   mpz_sub(M,powerof2,one);
   gmp_printf("%Zd",M);
   return 0;
}

E.g. I take my Intel lapdown down by running 8 copies of
num=82589933; time ./mersenne $num > M48.1 &
« Last Edit: March 21, 2025, 05:36:59 pm by ejfluhr »

ejfluhr

  • Newbie
  • *
  • Posts: 48
  • Karma: +6/-0
    • View Profile
Re: Messing with WOF Tables
« Reply #16 on: March 24, 2025, 11:03:43 am »
Got my login working.  I used these two easy scripts to watch freq, temp, and power:

cat ./watch_cpu_freq.ksh
watch -n2 "cat /proc/cpuinfo | grep MHz"

cat ./watch_sensors.ksh
# Watch thermal sensors
watch -n 1 -d sensors

My 4-core CPU idles at ~2170MHz, then when I run 1 thread of the aforementioned mersenne just one set of cores jumps to 3783MHz which is ~= 3800MHz Fmax.   So apparently frequency is managed per quad. 

When I run 2 threads, sometimes both sets jump to max, sometimes only 1 set...I guess it depends on which quads the OS allocates the threads to. 

When I run 4 threads, frequency maxes at 3400MHz.   At 8 threads, frequency maxes at 3250MHz.   So it looks like WOF is optimizing the frequency to the amount of power used by the set of active workloads on my system.