Skip to content

gh-155090: Fix ftscalingbench core selection on CPUs with favoured cores - #155105

Open
overlorde wants to merge 1 commit into
python:mainfrom
overlorde:fix-ftscalingbench-pcores
Open

overlorde wants to merge 1 commit into
python:mainfrom
overlorde:fix-ftscalingbench-pcores

Conversation

@overlorde

@overlorde overlorde commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #155090.

The efficiency-core filter compares each core's MAXMHZ against the highest on the machine, which also drops the performance cores that Turbo Boost Max 3.0 bins below their fastest siblings. This splits the two groups at the midpoint between the highest and lowest clock instead.

Machines that report one clock for every core, or none at all, keep every core as before. The >= matters there: with MAXMHZ empty both bounds are zero, and > would have selected nothing.

Splitting at the largest gap between distinct clocks would be more principled and would handle a three-tier layout as well. It seemed like more machinery than this needs, but I'll change it if you'd rather.

The tests are new; five of the six also pass against main unchanged.

…red cores

ftscalingbench keeps only the CPUs whose MAXMHZ equals the highest MAXMHZ
on the machine, so that efficiency cores are left out.  That assumes every
performance core shares one clock ceiling.  Intel's Turbo Boost Max 3.0
bins a couple of cores above their siblings, and on such a part only those
few survive the filter.

On an i7-14650HX (8 performance cores, two of them at 5200 MHz and the
rest at 5000 MHz, plus 8 efficiency cores at 3700 MHz) the benchmark
picked two CPUs and reported scaling for 2 threads instead of 8.

Split performance and efficiency cores at the midpoint between the highest
and lowest clock instead, which keeps all the performance cores however
they are individually binned.  Machines that report one clock for every
core, or no clock at all, are unaffected.
@@ -0,0 +1,4 @@
``Tools/ftscalingbench`` now uses every performance core on processors that

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need NEWS.d for internal tool.

@@ -0,0 +1,75 @@
"""Tests for Tools/ftscalingbench/ftscalingbench.py."""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally don't think that we have to keep this file just for internal tooling.

# Choose only CPUs on the same node, unique cores, and try to avoid
# "efficiency" cores.
if node == 0 and core not in cores and maxmhz == max_mhz_all:
if node == 0 and core not in cores and maxmhz >= min_mhz_wanted:

@corona10 corona10 Aug 25, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the core group is separated into two groups as you siad, why just check something like this?

Suggested change
if node == 0 and core not in cores and maxmhz >= min_mhz_wanted:
if node == 0 and core not in cores and maxmhz > min_mhz_all:

@corona10 corona10 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some suggestion and question about your change.

@bedevere-app

bedevere-app Bot commented Aug 25, 2026

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

And if you don't make the requested changes, you will be poked with soft cushions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tools/ftscalingbench picks too few CPUs on processors with unevenly clocked performance cores

2 participants