madMAx43v3r / chia-plotter

Apache License 2.0
2.27k stars 664 forks source link

Correct taskset for 5950X for parallel plots #485

Open vvavepacket opened 3 years ago

vvavepacket commented 3 years ago

I did some research and tried to find which physical cpu / logical cpu belongs to the same CCX..

Basically 5950X has 16 cores,, and 8 cores belong to each CCX. Zen 3 has 2 CCX now..

So I wanted to do 2 parallel plots on each CCX.. How do we know which CPU core belongs to the same CCX?

Linux numactl and lscpu doesnt help because Ubuntu has no knowledge of the physical placement of core to the die level / layout.. Any ideas?

Now I have this core-to-core latency tests for a 5950X and we can see there is 2 sets of green, which means 2 greens corresponds low latency between cores.. And this could mean each green corresponds to its own CCX..

image

So is it safe to assume that CPU 0-15 belongs to CCX1 and CPU 16-31 belongs to CCX2?

madMAx43v3r commented 3 years ago

it damn well looks like it

madMAx43v3r commented 3 years ago

no wonder ppl are getting inconsistent results...

ByronAP commented 3 years ago

I'm confused... 5950 is 16 cores but your plot is of 32 threads?.?.?. aren't you going to get false results since you are looking at hyperthreading

vvavepacket commented 3 years ago

16 cores, and 5950x has 32 threads... each core has 2 threads

[image: Mailtrack] https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality5& Sender notified by Mailtrack https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality5& 06/15/21, 09:51:59 PM

On Tue, Jun 15, 2021 at 9:49 PM Allen Byron Penner @.***> wrote:

I'm confused... 5950 is 16 cores but your plot is of 32 threads?.?.?.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/madMAx43v3r/chia-plotter/issues/485#issuecomment-861946985, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB7JJWULF3NKOANXGHEL2VDTS77KFANCNFSM46XOIYNA .

PiSCaRGoT commented 3 years ago

So it seems like the consensus is to use the same amount of thread as physical cores, and not logical threads? Let me give this a try and see if there are any difference between 16 and 32 threads (5950x)

fer662 commented 3 years ago

I did some research and tried to find which physical cpu / logical cpu belongs to the same CCX..

Basically 5950X has 16 cores,, and 8 cores belong to each CCX. Zen 3 has 2 CCX now..

So I wanted to do 2 parallel plots on each CCX.. How do we know which CPU core belongs to the same CCX?

Linux numactl and lscpu doesnt help because Ubuntu has no knowledge of the physical placement of core to the die level / layout.. Any ideas?

Now I have this core-to-core latency tests for a 5950X and we can see there is 2 sets of green, which means 2 greens corresponds low latency between cores.. And this could mean each green corresponds to its own CCX..

image

So is it safe to assume that CPU 0-15 belongs to CCX1 and CPU 16-31 belongs to CCX2?

so you want to try pinning 8 cores cores to each process and see if you get sum of times < twice what a single plot takes with 16 cores? I think it's a good plan for the processor but the disks might get in the way. Obviously doesn't work for 110GB ramdisk

PiSCaRGoT commented 3 years ago

Ok, I have confirmed that limiting thread to actual core count (and not logical threads) will deliver same/marginally faster plot times.

Logically I think the next step would be to test 2 parallel jobs, each pegged to 8 cores of the same CCX, and see if we can get even better improvements in output/time. However I have no idea on how to run this, so would be great if someone can test this.

This could be useful (if indeed beneficial) to include core pegging as a feature in this plotter.

GTANAdam commented 3 years ago

Well, I don't think this has anything to do with the plotter. people should correct this by themselves, for instance, I had corrected this using my own set of code that detected NUMA cores and taskset them correctly.

madMAx43v3r commented 3 years ago

@GTANAdam by code you mean bash script?

GTANAdam commented 3 years ago

@GTANAdam by code you mean bash script?

Well, it can be anything that can access syscalls or just execute "taskset". For my instance, I've used Golang, since I've basically rewritten plotman, to control them.