News for hackers. Stuff that matters.
Re:Ryzen Threadripper Pro 3995WX Spotted by ajross on Friday July 10, 2020 @06:59AM (#23790204)
> What workloads are so massively parallel that they can use 64 cores of x86 but can’t use the thousands of CUDA cores on a Quadro card?

Building software, for one. C compilers and python interpreters don't run on a GPU. Lots of stuff doesn't run on a GPU. In fact in practice the only things that run on a GPU are the tiny handful of known subproblems that the industry has collectively decided are "GPU problems".

Like it or not general purpose scalar software is, has always been, and will always remain the standard mechanism by which computing hardware is applied to new problems. Everything else is an optimization around the edges.

Re:Ryzen Threadripper Pro 3995WX Spotted by lallysingh on Friday July 10, 2020 @09:15AM (#23791131)
.. and chrome and your IDE. They're very bursty, but those bursts can go smoothly over many cores or slowly over a few.
Re:Ryzen Threadripper Pro 3995WX Spotted by waltpad on Friday July 10, 2020 @03:18PM (#23795221)
Disclaimer: I am not a HW designer, I could very well be wrong.

It is true that there are tasks where threading matters, but still require a CPU rather than a GPU. I wonder however if these tasks do need full SSE/AVX etc. Couldn't these extensions be removed of the CPU cores and instead have the necessary work performed by the GPU?

It would be interesting to produce statistics on how much these extensions are used in these scenario. Imagine how much space and complexity could be saved on a CPU die by making stripped down versions. That space could in turn be used for more cores!

I read a little about the Xeon PHI cpus, which iirc, is a multicore CPU with a very small ISA, but I wonder why x86 makers aren't trying to go in that direction: isn't there plenty of dedicated workloads which would happily run on these (eg, web servers), or is this just a (too) simplistic view?

Re:Ryzen Threadripper Pro 3995WX Spotted by dragontamer on Friday July 10, 2020 @06:15PM (#23797209)
> It is true that there are tasks where threading matters, but still require a CPU rather than a GPU. I wonder however if these tasks do need full SSE/AVX etc. Couldn't these extensions be removed of the CPU cores and instead have the necessary work performed by the GPU?

SSE/AVX shares an L1 cache that's damn near instantaneous to access for the CPU core. Total L1 bandwidth is on the scale of TB/s.

PCIe -> GPU takes 1-microsecond to 10-microseconds per access, and operates only at 50GB/s (or 1/20th the speed of L1 bandwidths).

------------

Case in point: Memset is very commonly AVX'd to clear out L1 cache and initialize ~1kb to 32kb of data to 0 as quickly as possible.

There's no way for "memset" to move from CPU to GPU unless you feel like obliterating the entire point of L1, L2, and L3 cache. If you moved a "memset" to GPU, it'd operate only at 15GB/s (the speed of PCIe 3.0 x16 lanes), far, far slower than L1 cache AVX-loads/stores.

SIMD units, like SSE and AVX, are highly "local" and have huge advantages.

Re:Ryzen Threadripper Pro 3995WX Spotted by TinkersW on Friday July 10, 2020 @09:32PM (#23798609)
I think the opposite is where things need to go. Having a wide SIMD ALU quickly accessible from your CPU core is very useful, especially as it shares the same memory system and a much more flexible programming model that allows you to do everything in a single source.
Re:Ryzen Threadripper Pro 3995WX Spotted by waltpad on Saturday July 11, 2020 @04:57AM (#23800621)
The programming model is not very flexible at the lowest level: one has to create all the software infrastructure to communicate with the GPU (which boils down to sending commands and receiving response). There are languages (like futhark, julia, or even python), which handle all that boilerplate transparently.

The main problem is, afaik, that there is not enough control about where the code will run in these languages. At some point, one will want to describe all the algorithms using a single language, and somehow describe how the workload will have to be distributed across all the processors, or at least that's what I've been thinking about for a while. Once you have that level of control, the need for a versatile CPU is less clear. Note that nowadays people seems happy with hybrid solutions where the code is scattered across several languages (eg, one for the main program and one for the shaders, or for the client side UI), so my position is maybe not very strong.

HW-wise, is it possible that integrated GPUs are the first steps toward an architecture where CPU and GPU have better interconnections (ie, larger communication bandwidth and smaller latency) to the point where SIMD becomes moot? There is also the SWAR approach, where one doesn't rely on intrinsic SIMD instructions, but instead emulate them (though it's probably not very realistic for floating point computation).

Some other ideas:

- Apple has this neural engine in their latest chips, which is basically dedicated HW for neural networks

- In the wild, people are getting more and more interested in building their custom ASICs to cut software's middle-man cost: for them, the CPU solution is not good enough

- Intel recently introduced a new matrix ops extension in their CPUs: maybe at some point they'll introduce full GPU capabilities directly baked in the CPU? I am a little worried about the resulting ISA.

Anyway, I am not an HW engineer, nor a very good software one. I only have a limited view of the difficulties in writing good, CPU or GPU efficient code. My first post was prompted by remembering the first "large scale" multicores CPUs 15 years ago (specifically the Ultrasparc T1) which wheren't SIMD heavy. The direction naturally shifted as progress was made on SIMD to try to compete with GPUs, when it seems to me that originally CPUs and GPUs were complementary.

I tend to support modular solutions, but I don't know how costly that would be in term of efficiency at the HW level.

Re:Ryzen Threadripper Pro 3995WX Spotted by waltpad on Monday July 13, 2020 @10:36AM (#23821191)
Ooops, I didn't mean Xeon PHI, I meant an older design with many small x86 cores.

Xeon PHI on the other hand was the first host of AVX-512 instruction set. Sorry.

Re:Ryzen Threadripper Pro 3995WX Spotted by scotty79 on Friday July 10, 2020 @07:04AM (#23790245)
Interesting. Is there a compiler, that runs on GPU?
Re:Ryzen Threadripper Pro 3995WX Spotted by the_pwner224 on Friday July 10, 2020 @07:15AM (#23790310)
GPUs are mainly good at doing matrix multiplication and other math with little branching. Compilers have a lot of if/else statements; training neural networks does not. IIRC (and I may be wrong) the architecture is something like many GPU cores share things like the code cache and branch prediction, so if the different cores have to execute different code paths there is a big performance decrease.

Edit: another reply to this top level comment: https://news.ycombinator.com/item?id=23788755

Re:Ryzen Threadripper Pro 3995WX Spotted by Symmetry on Friday July 10, 2020 @10:58AM (#23792120)
Also GPUs really like predictable memory access patterns so that they can load the data that'll be needed next ahead of time into registers or dedicated caches explicitly. They don't have cache hierarchy features a CPU has to minimize the average disruption from only partially predictable memory accesses and they don't have out of order windows to paper over the occasional low level cache miss.
Re:Ryzen Threadripper Pro 3995WX Spotted by FpUser on Friday July 10, 2020 @12:06PM (#23792942)
Not to counter the main argument but CPU loves it some predictable patterns as well.

pattern like the one below will execute up to 10 times faster if array is sorted due to data locality and branch prediction

  sum: float
  a: float array[some_huge_number] 
  fill_array(a, random(1))
  
  for f in a
      if a[i]>0.5
          sum=sum+f
Re:Ryzen Threadripper Pro 3995WX Spotted by raphlinus on Friday July 10, 2020 @10:01AM (#23791523)
A really interesting exploration is Co-dfns [1]. This is indeed a compiler that runs on the GPU, but it's also extremely out of the mainstream.

IMHO this is an area ripe for more exploration. If I were working on it, I might look to linking first before compilation, because the basic link task is more similar to what GPUs are good at (advanced stuff such as LTO is a different story, though).

[1]: https://github.com/Co-dfns/Co-dfns

Re:Ryzen Threadripper Pro 3995WX Spotted by BiasRegularizer on Friday July 10, 2020 @07:30AM (#23790419)
Also, GPU has VERY limited memory and no virtual memory.
Re:Ryzen Threadripper Pro 3995WX Spotted by rational_indian on Friday July 10, 2020 @07:51AM (#23790563)
> VERY limited memory and no virtual memory

This is incorrect.

Re:Ryzen Threadripper Pro 3995WX Spotted by zdw on Friday July 10, 2020 @09:41AM (#23791370)
Compared to 2-4TB max in a 2 socket server system, the 16 or 32GB/card you get on a GPU is pretty small.

The other issue is loading that memory - PCIe 4 is still the transfer time bottleneck between GPU and main memory.

Re:Ryzen Threadripper Pro 3995WX Spotted by atq2119 on Friday July 10, 2020 @02:54PM (#23794948)
The part about no virtual memory is kind of incorrect though. It doesn't work exactly like on the CPU, but still.
Re:Ryzen Threadripper Pro 3995WX Spotted by zdw on Saturday July 11, 2020 @10:40PM (#23808280)
I'm not totally up to speed on modern GPU's - do they have a MMU that handles page faults on non-resident pages like a CPU would?

My understanding is that the GPU memory models are different enough that what an OS traditionally calls "virtual memory" couldn't be implemented in the same way.

Re:Ryzen Threadripper Pro 3995WX Spotted by baybal2 on Friday July 10, 2020 @07:49AM (#23790549)
> Building software

Well, the problem with that is that no make system can utilise so much core. Even linux kernel, probably the biggest C project in mainstream use, can not consistently load even 16 cores with mostly handwritten makefiles.

P.S.

I do not say that building software is not CPU parallelisable in principles, I'm saying that regular make systems have trouble handing big number of parallel tasks in practice, even in big, well run projects that use handwritten makefiles.

Re:Ryzen Threadripper Pro 3995WX Spotted by ajross on Friday July 10, 2020 @07:52AM (#23790572)
That's... not true at all. A kernel build will be as parallelizable as you like. I do kernel builds fairly regularly on 56 and 64 core hosts and in fact the build time is quite linear with core count. (The ramdisk packing provided by the distro at "make install" time tends to be what hurts scaling, FWIW).

And my day job involves lots of iterations over the Zephyr test suite, which builds and runs hundreds of individual test apps X dozens of platforms. This is almost a pure build-time problem and scales very linearly indeed.

Re:Ryzen Threadripper Pro 3995WX Spotted by CrazyStat on Friday July 10, 2020 @08:56AM (#23790990)
CPU-parallelizable and GPU-parallelizable are different problems. CPU cores are independent. GPU cores are SIMD--every core does the same operation, but with different data. That works really well for things like matrix multiplication where you need to multiply a million times and then add a million times, because you can have all 3000 CUDA cores multiplying and then all 3000 CUDA cores adding. It doesn't work for compiling software.
Re:Ryzen Threadripper Pro 3995WX Spotted by monocasa on Friday July 10, 2020 @11:02AM (#23792174)
It's not that SIMD for GPUs. It'll be 64 or 32 GPU threads together generally sharing the dispatch and control logic. So if you have a 4096 "CUDA core" GPU, it'll be 64 of what would be called cores on the CPU side, each with a 64 lane vector processor.
Re:Ryzen Threadripper Pro 3995WX Spotted by baybal2 on Friday July 10, 2020 @08:54AM (#23790971)
Not in my experience, from time to time it does boost to 40+ compile tasks, especially on drivers code, but it mostly hover at around 10 tasks.
Re:Ryzen Threadripper Pro 3995WX Spotted by emidln on Friday July 10, 2020 @07:56AM (#23790595)
Bazel utilizes the cores near linearly. It even makes use of remote cores in an efficient manner for compiling c++. 128 thread and 256 thread machines are great if you also have enough ddr4 to let each gcc/clang do their thing.
Re:Ryzen Threadripper Pro 3995WX Spotted by pdimitar on Saturday July 11, 2020 @09:41AM (#23802133)
The rumoured Threadripper Pro 3995WC (64c/128t but with 8-channel memory support) might solve that problem.
Re:Ryzen Threadripper Pro 3995WX Spotted by jchw on Friday July 10, 2020 @09:15PM (#23798515)
Something is wrong on your end, you can parallelize the build of typical C and C++ software almost infinitely. The reason why is because most C and C++ software do not have 'happens-before' dependency relationships due to the way translation units work, so basically every translation unit in a module can be compiled 100% independently of any other translation unit. In practice that means you can easily scale up to 1000+ processes with no issue, and in fact, this has been accomplished in combination with AWS Lambda:

https://stanford.edu/~sadjad/gg-paper.pdf

Actual screencast of it in action compiling FFMPEG:

https://asciinema.org/a/257545

(Perhaps the issue is you are bottlenecking on I/O or some other resource?)