News for hackers. Stuff that matters.
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