Giter Site home page Giter Site logo

Comments (6)

travisdowns avatar travisdowns commented on September 17, 2024

Hi Edison,

Thanks for this report.

export UARCH_BENCH_CLOCK_MHZ=4000
sudo ./uarch-bench.sh

Median CPU speed: 3.201 GHz
UARCH_BENCH_CLOCK_MHZ does not work?

This is because sudo, by default, does not pass through environment variable from the calling context. So you export that variable but it won't be seen by the process(es) running inside the sudo call.

You could do it like this:

 sudo UARCH_BENCH_CLOCK_MHZ=4000 ./uarch-bench.sh

This explicitly sets the variable for the sudo'd process. Or you can use -E to pass through all vars from the parent process. Finally you could use sudo --preserve-env=UARCH_BENCH_CLOCK_MHZ ./uarch-bench.sh to pass through only the specific variable you care about.

from uarch-bench.

travisdowns avatar travisdowns commented on September 17, 2024

Median CPU speed: 3.201 GHz

@edisonchan that is because ./uarch-bench.sh disables turbo frequencies by default for the duration of the run and the 12900KF has a non-turbo frequency of 3.2 GHz. This gives a much more stable measurement in "cycles" which is usually what I'm interested in, since you don't see many frequency transitions as you would when running at max turbo speed.

However, you can run the test with turbo enabled if you'd like: just run the binary ./uarch-bench directly, rather than the ./uarch-bench.sh wrapper script. This wrapper just calls into the binary after disabling turbo and setting performance governor, but you can do this latter step by hand.

from uarch-bench.

travisdowns avatar travisdowns commented on September 17, 2024

You can confirm this by doing a ./uarch-bench.sh run and then checking cpupower or other frequency reporting tool while the test is running. It should show 3.2 GHz.

from uarch-bench.

edisonchan avatar edisonchan commented on September 17, 2024

@travisdowns thanks for the replies.
I choice set the UARCH_BENCH_CLOCK_MHZ because I can get very stable clock for Intel(add idle=poll in kernel cmdline and set 4 GHzin bios) and AMD(disable turbo clock in linux and set 4 GHz in bios).

and I have another question related. According Intel, when idle=poll, that is mean the CPU keep run NOPs, will that cause the test results not right?

from uarch-bench.

travisdowns avatar travisdowns commented on September 17, 2024

I choice set the UARCH_BENCH_CLOCK_MHZ because I can get very stable clock for Intel(add idle=poll in kernel cmdline and set 4 GHzin bios) and AMD(disable turbo clock in linux and set 4 GHz in bios).

Makes sense. You can run it like ./uarch-bench then to avoid the turbo setting. I should add a mode to the wrapper to allow keeping turbo mode on.

from uarch-bench.

travisdowns avatar travisdowns commented on September 17, 2024

and I have another question related. According Intel, when idle=poll, that is mean the CPU keep run NOPs, will that cause the test results not right?

It would not directly affect "steady state" test results. It just means the CPU will be "hot polling" while it has nothing to do, e.g., before and after the test. The effects are generally: (a) the CPU always runs at a high frequency, rather than ramping down during idle and then back up under load and (b) more heat generated and the CPU runs hotter for the same reason.

Effect (a) can mean that results are more stable since you don't have the frequency ramp-up period, but on the other hand uarch-bench already has lots of warmup in there to try to ensure the CPU is already running at its target frequency before the measurements start.

Effect (b) can have the opposite effect: poll might produce slower and less stable resluts if the CPU throttles from heat because it starts the test already at a high temperature (e.g., the heat sink is already saturated) versus the case where the CPU starts cool and take take advantage of the thermal mass of the cooling system to run at higher than steady-state frequency for a while which may be long enough to complete the test.

from uarch-bench.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.