Possibly suppoert for SMT technology and NUMA

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Post Reply
User avatar
TheKillerChicken
Long Handed Inserter
Long Handed Inserter
Posts: 70
Joined: Sat Mar 02, 2019 7:06 am
Contact:

Possibly suppoert for SMT technology and NUMA

Post 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.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13226
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Possibly suppoert for SMT technology and NUMA

Post by Rseding91 »

Factorio already supports and uses SMT where it helps.
If you want to get ahold of me I'm almost always on Discord.

User avatar
TheKillerChicken
Long Handed Inserter
Long Handed Inserter
Posts: 70
Joined: Sat Mar 02, 2019 7:06 am
Contact:

Re: Possibly suppoert for SMT technology and NUMA

Post 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?

User avatar
TheKillerChicken
Long Handed Inserter
Long Handed Inserter
Posts: 70
Joined: Sat Mar 02, 2019 7:06 am
Contact:

Re: Possibly suppoert for SMT technology and NUMA

Post 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?

Rseding91
Factorio Staff
Factorio Staff
Posts: 13226
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Possibly suppoert for SMT technology and NUMA

Post 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.
If you want to get ahold of me I'm almost always on Discord.

User avatar
TheKillerChicken
Long Handed Inserter
Long Handed Inserter
Posts: 70
Joined: Sat Mar 02, 2019 7:06 am
Contact:

Re: Possibly suppoert for SMT technology and NUMA

Post 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.

User avatar
TheKillerChicken
Long Handed Inserter
Long Handed Inserter
Posts: 70
Joined: Sat Mar 02, 2019 7:06 am
Contact:

Re: Possibly suppoert for SMT technology and NUMA

Post 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.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13226
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Possibly suppoert for SMT technology and NUMA

Post 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.
If you want to get ahold of me I'm almost always on Discord.

User avatar
TheKillerChicken
Long Handed Inserter
Long Handed Inserter
Posts: 70
Joined: Sat Mar 02, 2019 7:06 am
Contact:

Re: Possibly suppoert for SMT technology and NUMA

Post 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?

User avatar
TheKillerChicken
Long Handed Inserter
Long Handed Inserter
Posts: 70
Joined: Sat Mar 02, 2019 7:06 am
Contact:

Re: Possibly suppoert for SMT technology and NUMA

Post 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.

User avatar
TheKillerChicken
Long Handed Inserter
Long Handed Inserter
Posts: 70
Joined: Sat Mar 02, 2019 7:06 am
Contact:

Re: Possibly suppoert for SMT technology and NUMA

Post 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.

Premu
Fast Inserter
Fast Inserter
Posts: 100
Joined: Wed Nov 13, 2019 4:40 pm
Contact:

Re: Possibly suppoert for SMT technology and NUMA

Post 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.

User avatar
TheKillerChicken
Long Handed Inserter
Long Handed Inserter
Posts: 70
Joined: Sat Mar 02, 2019 7:06 am
Contact:

Re: Possibly suppoert for SMT technology and NUMA

Post 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.

User avatar
TheKillerChicken
Long Handed Inserter
Long Handed Inserter
Posts: 70
Joined: Sat Mar 02, 2019 7:06 am
Contact:

Re: Possibly suppoert for SMT technology and NUMA

Post 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.

Post Reply

Return to “Ideas and Suggestions”