AMD CPU limitation
See original GitHub issueDescribe the bug AMD CPU produces significantly worse performance than Intel CPUs in the “Simple PYSR Example” from pysr_demo.ipynb. AMD appears limited to utilize one core while Intel can utilize all cores.
Additional context Tested CPU / OS:
- Ryzen 5900x (12 cores / 24 threads): 6% CPU usage (using 1 core, 1x baseline)
- i5 2020 macbook pro (4 cores / 8 threads): 60% CPU usage (using all cores, 2.1 x faster than the AMD)
- i5 6600k windows 10 desktop (4 cores / 4 threads): 80% CPU usage (using all cores,1.2 x faster than the AMD)
Running the PyTorch trainer In [12], with gpus=0 utilizes all CPU cores on all systems tested.
Version (please complete the following information):
-
OS: macOS 12.4, intel (OK), Windows 10, intel (OK), Windows 11, AMD (Problem)
-
Version: PYSR 0.9.3
-
Python 3.9 venv in pycharm 2022.1.3
-
Does the bug appear with the latest version of PySR? Yes
Configuration
- What are your PySR settings? Exactly the Simple PySR example found in pysr_demo.ipynb
default_pysr_params = dict(
populations=30,
procs=4,
model_selection="best",
)
# Learn equations
model = PySRRegressor(
niterations=30,
binary_operators=["plus", "mult"],
unary_operators=["cos", "exp", "sin"],
**default_pysr_params
)
model.fit(X, y)
- What dataset are you running on?
# Dataset
np.random.seed(0)
X = 2 * np.random.randn(100, 5)
y = 2.5382 * np.cos(X[:, 3]) + X[:, 0] ** 2 - 2
Error message No message, just performance loss on the AMD chip.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
What are the honest limitations/issues with AMD CPUs ...
AMD has slightly lower single core performance, much better multithread performance, cheaper price. Ryzen is a little more sensitive to memory ...
Read more >AMD clarifies power usage limits of its next-gen AM5 CPUs ...
On Thursday, AMD clarified to Tom's Hardware that the 170 W number refers to the maximum TDP of socket AM5 processors and that...
Read more >AMD Processor in a box (PIB) 3 Year Limited Warranty
AMD warrants that processors sold through the AMD Processor in a Box Program, which have a "qualifying" serial number, when properly installed and...
Read more >Understanding CPU limitations with memory | Crucial.com
As an example a CPU like the i7-6700K can handle up to 64GB of RAM, and has added DDR4 support up to 2133...
Read more >How to Limit the CPU Usage for a Single Program in Windows
Unless you are running heavy programs on a fairly older processor, your CPU usage should remain under 80 percent. Even if it shoots...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Thanks @MilesCranmer ,
multithreading=Falsegave a 2-3x increase in cpu utilization on the AMD machine, utilizing 20% of the CPU resources and doubles the MBP’s speed in cycles per second. I was then able to saturate the CPU by cranking up thepopulation_sizeparameter, which previously had no effect.As a quick fix, if you set
multithreading=False, it will use multiprocessing instead, which is almost guaranteed to fix this, and give you the same performance as on other machines. Windows seems to have issues with the multithreading backend of PySR for some reason.