Live data from Hacker News

Implementing a GPU's programming model on a CPU

litherum.blogspot.com

41–50 of 61 posts

Re: Implementing a GPU's programming model on a CPU

#41
post #3

See also: https://ispc.github.io/

ISPC is great software. It's a shame in many ways Intel didn't put more resources behind it.

As Bryan mentions in https://news.ycombinator.com/item?id=37880669, I would read Matt's post-Intel and post-Google write up of why Intel didn't really invest.

https://pharr.org/matt/blog/2018/04/30/ispc-all if you don't want to follow the comment link again :).

Re: Implementing a GPU's programming model on a CPU

#42
post #32

Earlier quoted context omitted.

[flagged]

You've continued to post aggressively, attacking other users and generally posting in the flamewar style, even though we've asked you many times to stop. If this keeps up, we're going to have to ban you. I don't want to ban you, because you obviously have a lot of knowledge to share, but your aggressiveness destroys more than your knowledge contributes—a lot more, actually. Fortunately, there are plenty of other know…

It pointless trying to abide by your rules of decorum - I call a thing a rant - as if it isn't and that makes me aggressive? In reality you're just mad I pointed out your kafka-esque moderation policies.

> Please be like them instead.

Be an arrogant martinet? No thanks. But I'll stop posting so congrats on keeping your community homogeneously obnoxious (and ignorant).

Re: Implementing a GPU's programming model on a CPU

#43
post #32

Earlier quoted context omitted.

You've continued to post aggressively, attacking other users and generally posting in the flamewar style, even though we've asked you many times to stop. If this keeps up, we're going to have to ban you. I don't want to ban you, because you obviously have a lot of knowledge to share, but your aggressiveness destroys more than your knowledge contributes—a lot more, actually. Fortunately, there are plenty of other know…

It pointless trying to abide by your rules of decorum - I call a thing a rant - as if it isn't and that makes me aggressive? In reality you're just mad I pointed out your kafka-esque moderation policies. > Please be like them instead. Be an arrogant martinet? No thanks. But I'll stop posting so congrats on keeping your community homogeneously obnoxious (and ignorant).

I don't remember anything you pointed out about moderation, and in any case we don't ban accounts for criticizing the mods.

This isn't a response to just one comment, let alone one word, but to the pattern of your comments in general: they stand out as nasty, abusive towards other commenters, and not in the intended spirit of the site; not just by a little, but a lot. It's not a borderline call.

Re: Implementing a GPU's programming model on a CPU

#44
post #43

Earlier quoted context omitted.

It pointless trying to abide by your rules of decorum - I call a thing a rant - as if it isn't and that makes me aggressive? In reality you're just mad I pointed out your kafka-esque moderation policies. > Please be like them instead. Be an arrogant martinet? No thanks. But I'll stop posting so congrats on keeping your community homogeneously obnoxious (and ignorant).

I don't remember anything you pointed out about moderation, and in any case we don't ban accounts for criticizing the mods. This isn't a response to just one comment, let alone one word, but to the pattern of your comments in general: they stand out as nasty, abusive towards other commenters, and not in the intended spirit of the site; not just by a little, but a lot. It's not a borderline call.

there's a single questionable word in the flagged comment (the word `rant`) and it's not a borderline call? yup totally makes sense. Like do you even read the flagged comment or you just go by the fact that it offended someone?

Re: Implementing a GPU's programming model on a CPU

#45
post #9

Isn't this already implemented in QEMU?

I don't think so. I was quite interested in getting emulated GPUs to work for CI workers to be able to test CUDA stuff without needing actual GPU passthrough, but all I could find in this space were abandoned, early stage hobby projects on GitHub.

Re: Implementing a GPU's programming model on a CPU

#47

I helped make a really cursed RISC-V version of this for a class project last year! The idea was to first compile each program to WASM using clang, and lower the WASM back to C but this time with all opcodes implemented in terms of the RISC-V vector intrinsics. That was a hack to be sure, but a surprisingly elegant one since 1. WASM's structured control flow maps really well to lane masking 2. Stack and local values…

This is cool! If you wrote a blog post going detail about the insights, I'd read it

Re: Implementing a GPU's programming model on a CPU

#48
post #8
post #7

This so-called GPU programming model has existed many decades before the appearance of the first GPUs, but at that time the compilers were not so good like the CUDA compilers, so the burden for a programmer was greater. As another poster has already mentioned, there exists a compiler for CPUs which has been inspired by CUDA and which has been available for many years: ISPC (Implicit SPMD Program Compiler), at https:/…

DirectX 8 added programmable shaders as we mostly know it today in 2000 with directx 9's shader model 2.0 really solidifying things in 2002. CUDA didn't show up until 2007.

Except that shaders predate DirectX 8 by several decades.

Two major examples,

https://en.m.wikipedia.org/wiki/TMS34010

https://en.m.wikipedia.org/wiki/RenderMan_Shading_Language

Also in DirectX 8, it wasn't as we know them today, because Assembly was the only programming language.

Nowadays CUDA does C, C++, Fortran, Python JIT in the box, and has partner collaborations for Haskell, Java, Julia, C#.

Re: Implementing a GPU's programming model on a CPU

#50
post #7

This so-called GPU programming model has existed many decades before the appearance of the first GPUs, but at that time the compilers were not so good like the CUDA compilers, so the burden for a programmer was greater. As another poster has already mentioned, there exists a compiler for CPUs which has been inspired by CUDA and which has been available for many years: ISPC (Implicit SPMD Program Compiler), at https:/…

SIMT and SIMD are different things. It's fortunate that they have different names. A GPU is a single instruction multiple data machine. That's what the predicated vector operations are. 32 floats at a time, each with a disable bit. Cuda is a single instruction multiple thread language. You write code in terms of one float and branching on booleans, as if it was a CPU, with some awkward intrinsics for accessing the ve…

> It's not totally clear to me why simt won out over writing the vector operations.

From the user side, it is probably simpler to write an algorithm once without vectors, and have a compiler translate it to every vector ISA it supports, rather than to deal with each ISA by hand.

Besides, in many situations, having the algorithm executed sequentially or in parallel is irrelevant to the algorithm itself, so why introduce that concern?

> I'm certainly in the minority opinion here.

There are definitely more userland programmers than compiler/numerical library ones.

Post reply on HN