News for hackers. Stuff that matters.
Re:Are your memory-bound benchmarking timings normally distr... by hinkley on Thursday April 06, 2023 @07:08PM (#35475769)
I want a viewport onto a parallel universe where we embraced NUMA more thoroughly, and instead of making processors with ever growing layers of transparent caching, we just put 16MB of working memory on each chip. Partitionable for concurrent workloads.

Maybe it could never have been then, but maybe it can be now, or soon.

For instance a borrow checker might be a very good way to help decide how and when to move working memory between processors and main memory. But what do you do with all of the existing C code? I think for backward compatibility you'd need to implement virtual memory at the working memory layer. It wouldn't be the fastest code, but it would work.

Re:Are your memory-bound benchmarking timings normally distr... by sliken on Thursday April 06, 2023 @07:18PM (#35475846)
Well the tools are there, and the hardware is there as well.

Early AMD epycs had multiple chiplets, each with it's own memory controller. However that means that even on a single socket different chiplets would see different memory latencies and some apps/benchmarks people cared about handled it poorly.

The newest AMD Epycs have a unified memory controller per socket, so all chiplets see the same memory latency. But now Intel entered the chiplet game, and now has one memory controller per chiplet again.

There's plenty of support for NUMA support in the kernel and various language runtimes. Apps and OSs can pin processes to cores, allocate local ram, and migrate non-local ram to local or migrate processes to cores that are memory local. Generally the automatic stuff works reasonably, but numactl and various NUMA related calls let you override those decisions as needed.

Re:Are your memory-bound benchmarking timings normally distr... by hinkley on Thursday April 06, 2023 @07:40PM (#35476062)
I missed the 16 bit era by dragging my feet and then leaping onto 32 bit as soon as it was viable.

64k of memory was not really enough to do useful things and it occupied so much of your design. But 4GB is a pretty big leap from 64k. There's lots of interesting things a person can do with 10, 30, 100MB of memory, without having to treat every piece of data like it sits in a perfectly flat data plane. And with 64 bit addressing you have ample, ample space to use some bits as metadata that lets you know things about the memory without dereferencing it first.

Re:Are your memory-bound benchmarking timings normally distr... by sliken on Thursday April 06, 2023 @08:10PM (#35476342)
Heh, I was running DOS and Deskview, windows 3 was out of coming soon. I jumped into Linux with a 386sx-16, not even a FPU. I think it had 4MB ram, eventually upgraded to 16mb.

Your ideas remind me of the Sun MAJC CPU. Claimed to be designed to run Java well, be aware of Java Objects, enabling prefetch of objects, speculative execution without side effects, and other pointer magic related to assuming JVM+Java instead of C/C++. Sounded really promising, sadly died shortly afterwards. An expert I talked with later mentioned that it was all marketing and it was just a normal CPU for it's time. Sad. Does seem like today's new languages could result in a CPU with significantly more freedom for speculation, optimization, and efficiency if it assumed a particular language runtime.

Re:Are your memory-bound benchmarking timings normally distr... by hinkley on Thursday April 06, 2023 @08:24PM (#35476448)
> Your ideas remind me of the Sun MAJC CPU.

Probably not a coincidence. It was memory of some Sun product data sheets that got me ruminating on this line of thought, though I don't think it was MAJC. 4MB per core, 4 cores per daughter card, if memory serves. Those product lines were probably a big reason why Java had to solve the NUMA memory problem, and then other languages just copied what they did.

Re:Are your memory-bound benchmarking timings normally distr... by marcosdumay on Thursday April 06, 2023 @08:44PM (#35476618)
Hum... The hardware isn't actually there.

It has the capabilities the GP wants, but it doesn't export them in a way you could tune into that NUMA machine.

Re:Are your memory-bound benchmarking timings normally distr... by sliken on Thursday April 06, 2023 @09:06PM (#35476783)
You can run any process on any core and allocate local memory to that core. What is missing?

Sure you can't hide metadata in the unused bits of a pointer, but that didn't seem particularly critical for making good use of a NUMA machine.

Re:Are your memory-bound benchmarking timings normally distr... by marcosdumay on Friday April 07, 2023 @11:05AM (#35482313)
> What is missing?

Fast memory, addressable by the core.

The one that is there, but can only used by accessing the slow memory.

Re:Are your memory-bound benchmarking timings normally distr... by hinkley on Friday April 07, 2023 @05:36PM (#35487296)
And praying that the slow memory is magically in the fast memory.

I think ultimately what I'm asking for means a much, much tighter bound on worst case performance, but at the cost of best case performance. That most of us never see anyway. For certain workloads, that could end up being a net positive. And there's probably some way to expose CPU metadata that gives some of that difference back.

Re:Are your memory-bound benchmarking timings normally distr... by chas on Friday April 07, 2023 @06:51PM (#35488101)
I think it’s worthwhile to distinguish between throughput and latency for these sorts of discussions, rather than just talking about performance since scratchpads are usually better for latency (even best-case latency) and caches are usually better for throughput. Though of course in this as in any sort of discussion of computer performance, caveats abound.
Re:Are your memory-bound benchmarking timings normally distr... by singron on Thursday April 06, 2023 @09:38PM (#35477002)
This is basically how tile renderers work in mobile GPUs. Supercomputers also have a similar design with MPI and toroid networks although on a multi-machine scale.
Re:Are your memory-bound benchmarking timings normally distr... by Dylan16807 on Thursday April 06, 2023 @10:17PM (#35477224)
Partitioning memory and cores is easy enough, and a bunch of Xeons have cache partitioning. It's still generally transparent to the program, but I don't think that makes it less NUMA.
Re:Are your memory-bound benchmarking timings normally distr... by vvanders on Friday April 07, 2023 @01:55AM (#35478517)
We kinda had that world with the PS3 and SPE/SPUs[1]. Stuff written for them tended to run faster on more traditional hardware since you needed to vectorize all of your loads(which made the prefetcher on other hardware really happy) but it was an absolute beast to port in any code. I remember stuff from PC/X360 just running like absolute garbage(not that multicore was well handled anyway during that era) until significant refactoring was done(up to and even including full rewrites in some cases).

[1] https://en.m.wikipedia.org/wiki/Cell_(processor)#Synergistic...

Re:Are your memory-bound benchmarking timings normally distr... by geocar on Friday April 07, 2023 @03:07AM (#35478968)
> we just put 16MB of working memory on each chip.

Just? The chips we've got have between 32kb and 64kb -- maybe 128kb in some really big chips, and it's been that way for forty years! Everything else has to swap or cache through messaging layers (L2, L3) with real latency because we can't "just" put a bunch of memory on a chip.

I mean, I like thinking about star-trek computers too, but "just" isn't the word I would use for something like this... What would you possibly do with so much memory in a circuit?

> But what do you do with all of the existing C code? I think for backward compatibility you'd need to implement virtual memory at the working memory layer.

People rewrote almost everything in Java. And are doing it again with Rust. Programmers want to program, and if they can't come up with anything else to do, they'll just rewrite what someone else did. I don't think you should valuate existing C code the way its owners do, but by how their competition will valuate it; If someone can use FutureLang to outperform their business-competition who uses C, this problem will solve itself.

Re:Are your memory-bound benchmarking timings normally distr... by jeffreygoesto on Friday April 07, 2023 @07:04AM (#35480347)
Reminds me of Movidius Myriad [0] or NEC IMAPCAR [1]. Other comments also mention Cell.

Programmung those is so different that you need to dressing specifically for the chip and unless there is no great consolidation, they stay niche.

[0] https://www.tomshardware.com/news/movidiud-myriad2-vpu-visio...

[1] https://www.nec.com/en/global/techrep/journal/g06/n05/pdf/t0...