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

P-Core and E-Core always 100% usage #73

Open
Else00 opened this issue Apr 9, 2024 · 7 comments
Open

P-Core and E-Core always 100% usage #73

Else00 opened this issue Apr 9, 2024 · 7 comments

Comments

@Else00
Copy link

Else00 commented Apr 9, 2024

M3 Max 40 Core GPU

Screenshot 2024-04-09 at 10 23 35
@SUPERCELLEX
Copy link

Same system, same problem
It's reporting 100% CPU... at 0.5 watts

@tydia
Copy link

tydia commented Apr 14, 2024

same here

@aliasaria
Copy link

aliasaria commented Apr 18, 2024

confirmed that parse_cpu_metrics() doesn't recognize the cores properly on an M3 Max.

For example on an M3 Max with 14 cores (4 Efficiency, 10 Performance) the E-Cluster_active is set to 100 but the the actual cores are named E-Cluster0_active, E-Cluster1_active to P-Cluster13_active

Some sample code that is able to read all cores is:

        for cluster in e_core:
            cpu_metric_dict["E-Cluster_active"] += cpu_metric_dict["E-Cluster" +
                                                                   str(cluster) + "_active"]
            cpu_metric_dict["E-Cluster_freq_Mhz"] = max(
                cpu_metric_dict["E-Cluster_freq_Mhz"], cpu_metric_dict["E-Cluster" + str(cluster) + "_freq_Mhz"])

        cpu_metric_dict["E-Cluster_active"] = int(
            cpu_metric_dict["E-Cluster_active"]/len(e_core))

        for cluster in p_core:
            cluster_name = "P-Cluster" + str(cluster) + "_active"
            cluster_active = cpu_metric_dict[cluster_name]
            cluster_freq = cpu_metric_dict["P-Cluster" +
                                           str(cluster) + "_freq_Mhz"]

            if cluster_freq != 0:
                cpu_metric_dict["P-Cluster_active"] += cluster_active

            cpu_metric_dict["P-Cluster_freq_Mhz"] = max(
                cpu_metric_dict["P-Cluster_freq_Mhz"], cluster_freq)

        cpu_metric_dict["P-Cluster_active"] = int(
            cpu_metric_dict["P-Cluster_active"]/len(p_core))

But even the code above doesn't look the same as the OSX Native activity monitor. The last P-Cores show high usage in asitop and powermetrics on the second performance cluster (P-1 Cluster, CPU 9-13) because these cores can be online or offline and when they are offline they may report high usage which skews the results. So we have to filter out cores that are not online but I am not sure how.

aliasaria added a commit to transformerlab/transformerlab-api that referenced this issue Apr 18, 2024
we have had to customize asitop to work with an m3 machine but it still doesn't work. See this bug tlkh/asitop#73 . We will abandon this branch until asitop is fixed
@aliasaria
Copy link

Looks like 5314e67 may be the necessary fix

@tydia
Copy link

tydia commented Apr 21, 2024

Looks like 5314e67 may be the necessary fix

Yes, or simply use gavi's fork fixed the issue

pip install git+https://github.com/gavi/asitop.git

@ufo2243
Copy link

ufo2243 commented May 26, 2024

same here

@ufo2243
Copy link

ufo2243 commented May 27, 2024

same here

pip install git+https://github.com/gavi/asitop.git works for me

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

5 participants