Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AMD CPU limited to 1 proc. #157

Closed
mtaylorDW opened this issue Jul 6, 2022 · 1 comment
Closed

AMD CPU limited to 1 proc. #157

mtaylorDW opened this issue Jul 6, 2022 · 1 comment

Comments

@mtaylorDW
Copy link

My desktop PC has an AMD CPU (Ryzen 5900x) with 12 cores and 24 threads. My code only utilizes 6-7% of the total CPU resources, about 1 core. I have repeated the test, disabling multithreading using proc=0 and get an almost identical result in terms of speed. Increasing populations, population values, using batching or batch size have not made a difference.

running multiprocessing.cpu_count() returns 24 so python can see the cores. Running the example jupyter notebook yields the same result for the simple test code, but uses all of the cores when evaluating the machine learning section (GPU disabled, CPU only). The issue persists for both Jupyter, and pycharm.

I have tested the same code on the following:

  • 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)

I don't think it's a BIOS or OS issue since other applications can load up my CPU to 100% if needed on the AMD system.

Is it possible the Julia code is compiled with some intel-only flags?

I am using the latest 64-bit version of Julia.

import numpy as np
from pysr import PySRRegressor
from matplotlib import pyplot as plt
import seaborn as sns
import pandas as pd

model = PySRRegressor(
    model_selection="best",  # Result is mix of simplicity+accuracy
    niterations=1000,
    binary_operators=["+", "*","/","-"],
    unary_operators=[
        "exp",
       # "inv(x) = 1/x",
        # ^ Custom operator (julia syntax)
    ],
   # extra_sympy_mappings={"inv": lambda x: 1 / x},
    # ^ Define operator for SymPy as well
    loss="loss(x, y) = (x - y)^2",
    # ^ Custom loss function (julia syntax)
)
@MilesCranmer
Copy link
Owner

I assume #158 is a duplicate, so will close this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants