Page 1 of 1

Possibly suppoert for SMT technology and NUMA

Posted: Wed Aug 23, 2023 1:51 pm
by TheKillerChicken
Hi, I am curious if the Factorio code is able to be programmed to support SMT technology (Simultanius Multithreading) and NUMA. I know this is far-out because not everyone has an advanced workstation server as a gamer, so I will not blame you if you choose not to support it.

Re: Possibly suppoert for SMT technology and NUMA

Posted: Wed Aug 23, 2023 2:14 pm
by Rseding91
Factorio already supports and uses SMT where it helps.

Re: Possibly suppoert for SMT technology and NUMA

Posted: Sat Sep 02, 2023 10:03 am
by TheKillerChicken
Rseding91 wrote: Wed Aug 23, 2023 2:14 pm Factorio already supports and uses SMT where it helps.
I did bot know that. Will there ever be a time where it can use 12-16 cores at a time?

Re: Possibly suppoert for SMT technology and NUMA

Posted: Sat Sep 02, 2023 5:49 pm
by TheKillerChicken
If it is SMT capable, why is it using 2 cores max on the server/client? Or is SMT only for the startup sequence?

Re: Possibly suppoert for SMT technology and NUMA

Posted: Sat Sep 02, 2023 6:04 pm
by Rseding91
You can read the 22~ pages of discussion here: viewtopic.php?f=5&t=39893 but the TL-DR version of it is: because maxing out cores is not the bottleneck.

Re: Possibly suppoert for SMT technology and NUMA

Posted: Sat Sep 02, 2023 6:14 pm
by TheKillerChicken
I do know this game is DRAM dependent, so I am wondering if I populate all 16 DDR3-1866 slots, will that give any performance increase? It is 8-channel memory supported.

Re: Possibly suppoert for SMT technology and NUMA

Posted: Sat Sep 02, 2023 6:24 pm
by TheKillerChicken
Rseding91 wrote: Sat Sep 02, 2023 6:04 pm You can read the 22~ pages of discussion here: viewtopic.php?f=5&t=39893 but the TL-DR version of it is: because maxing out cores is not the bottleneck.
So pretty much this game could use a trillion cores and still be bound to the DRAM, to what I am getting at.

Re: Possibly suppoert for SMT technology and NUMA

Posted: Sat Sep 02, 2023 7:12 pm
by Rseding91
TheKillerChicken wrote: Sat Sep 02, 2023 6:14 pm I do know this game is DRAM dependent, so I am wondering if I populate all 16 DDR3-1866 slots, will that give any performance increase? It is 8-channel memory supported.
Theoretically yes.

Re: Possibly suppoert for SMT technology and NUMA

Posted: Sat Sep 02, 2023 7:16 pm
by TheKillerChicken
Rseding91 wrote: Sat Sep 02, 2023 7:12 pm
TheKillerChicken wrote: Sat Sep 02, 2023 6:14 pm I do know this game is DRAM dependent, so I am wondering if I populate all 16 DDR3-1866 slots, will that give any performance increase? It is 8-channel memory supported.
Theoretically yes.
It also uses NUMA. Will Factorio benefit from that feature also?

Re: Possibly suppoert for SMT technology and NUMA

Posted: Sat Sep 02, 2023 10:54 pm
by TheKillerChicken
I also want to add that you all are incredibly awesome. The only other development studio that is like this is Colossal Order. Wube and CO are my favourites as you both keep in constant communications with you customers/users. Thanks for keeping your integrity where others have fallen.

Re: Possibly suppoert for SMT technology and NUMA

Posted: Sun Sep 03, 2023 12:11 am
by TheKillerChicken
I just read up on multicore tech. I did not realise that using more processor cores could actually degrade performance. I also did not realise that it would be a monumental task to code such a thing. Now I understand why this game does not use mass-core usage.

Re: Possibly suppoert for SMT technology and NUMA

Posted: Sun Sep 03, 2023 12:08 pm
by Premu
TheKillerChicken wrote: Sat Sep 02, 2023 7:16 pm
Rseding91 wrote: Sat Sep 02, 2023 7:12 pm
TheKillerChicken wrote: Sat Sep 02, 2023 6:14 pm I do know this game is DRAM dependent, so I am wondering if I populate all 16 DDR3-1866 slots, will that give any performance increase? It is 8-channel memory supported.
Theoretically yes.
It also uses NUMA. Will Factorio benefit from that feature also?
I had to look up what NUMA actually means, and found out that this is one annoying hassle I have at work. :x (In short - access to some memory regions is faster from a specific core than from other cores.)

To fully optimize the usage of the fastest physical memory region you'd have to allocate variables to the core from which they are called. I don't think that's really doable on a PC though - because applications are not able to allocate variable to physical memory regions. They get a virtual region from the OS which does that for them. Also, the threads don't necessarily always end on the same core. Each tick they could move to a different core, so that a former good variable allocation might be less optimal one tick later.

Still, there might be some benefit: Each thread has a stack. That one is a safe bet for the OS to be put on the core it allocates the thread. So - as long as the activation of NUMA only improves the access time in some cases and doesn't hurt for the rest, you should see at least a small improvement if Windows supports NUMA. Still, I wouldn't expect miracles from that.

If I remember correctly, we had an improvement of a few percent for optimizing the variable layout to the core specific regions. Now that is of course a different CPU than you find in a PC, but I don't expect the benefits there to be significantly larger. It's nice to have and it might save you in a pinch, but it will not be the big breakthrough.

Re: Possibly suppoert for SMT technology and NUMA

Posted: Sun Sep 03, 2023 10:20 pm
by TheKillerChicken
Premu wrote: Sun Sep 03, 2023 12:08 pm
TheKillerChicken wrote: Sat Sep 02, 2023 7:16 pm
Rseding91 wrote: Sat Sep 02, 2023 7:12 pm
TheKillerChicken wrote: Sat Sep 02, 2023 6:14 pm I do know this game is DRAM dependent, so I am wondering if I populate all 16 DDR3-1866 slots, will that give any performance increase? It is 8-channel memory supported.
Theoretically yes.
It also uses NUMA. Will Factorio benefit from that feature also?
I had to look up what NUMA actually means, and found out that this is one annoying hassle I have at work. :x (In short - access to some memory regions is faster from a specific core than from other cores.)

To fully optimize the usage of the fastest physical memory region you'd have to allocate variables to the core from which they are called. I don't think that's really doable on a PC though - because applications are not able to allocate variable to physical memory regions. They get a virtual region from the OS which does that for them. Also, the threads don't necessarily always end on the same core. Each tick they could move to a different core, so that a former good variable allocation might be less optimal one tick later.

Still, there might be some benefit: Each thread has a stack. That one is a safe bet for the OS to be put on the core it allocates the thread. So - as long as the activation of NUMA only improves the access time in some cases and doesn't hurt for the rest, you should see at least a small improvement if Windows supports NUMA. Still, I wouldn't expect miracles from that.

If I remember correctly, we had an improvement of a few percent for optimizing the variable layout to the core specific regions. Now that is of course a different CPU than you find in a PC, but I don't expect the benefits there to be significantly larger. It's nice to have and it might save you in a pinch, but it will not be the big breakthrough.
I see. So I should keep NUMA disabled then.

Re: Possibly suppoert for SMT technology and NUMA

Posted: Sat Dec 16, 2023 8:55 am
by TheKillerChicken
I just upgraded my gaming machine to a Ryzen 9 7950x with 64GB DDR5-5200. so the NUMA/SMT request is no longer relevant. My workstation was a dinosaur and I figured it was time to retire that energy-consuming pig for a more efficient, new, and much faster system.