Earlier quoted context omitted.
Are you even reading the text you cite? That compares SIMD to SIMT. SIMD, not SPMD. SIMD is a more restrictive hardware paradigm, SPMD is just a mutiple copies of a single program running on multiple processes/threads, i.e., exactly what CUDA does. Most MPI-programs are SPMD, and really, the only conceptual difference between MPI and CUDA is that a thread's id is a point in a grid space that's relevant for scheduling…
> Are you even reading the text you cite? Yes I have read it enough times that I knew exactly where it was in the book. > That compares SIMD to SIMT. Yes and so does the op I responded to. > SIMD, not SPMD. SIMD is a more restrictive hardware paradigm, Thanks but I was already aware. The op was the one that conflated SPMD and SIMD, not me. > SPMD is just a mutiple copies of a single program running on multiple proces…
Implementing a GPU's programming model on a CPU
21–30 of 61 posts
Re: Implementing a GPU's programming model on a CPU
#22Earlier quoted context omitted.
Are you even reading the text you cite? That compares SIMD to SIMT. SIMD, not SPMD. SIMD is a more restrictive hardware paradigm, SPMD is just a mutiple copies of a single program running on multiple processes/threads, i.e., exactly what CUDA does. Most MPI-programs are SPMD, and really, the only conceptual difference between MPI and CUDA is that a thread's id is a point in a grid space that's relevant for scheduling…
> Are you even reading the text you cite? Yes I have read it enough times that I knew exactly where it was in the book. > That compares SIMD to SIMT. Yes and so does the op I responded to. > SIMD, not SPMD. SIMD is a more restrictive hardware paradigm, Thanks but I was already aware. The op was the one that conflated SPMD and SIMD, not me. > SPMD is just a mutiple copies of a single program running on multiple proces…
Obviously they can diverge, because this is SPMD/SIMT
Re: Implementing a GPU's programming model on a CPU
#23Earlier quoted context omitted.
> Are you even reading the text you cite? Yes I have read it enough times that I knew exactly where it was in the book. > That compares SIMD to SIMT. Yes and so does the op I responded to. > SIMD, not SPMD. SIMD is a more restrictive hardware paradigm, Thanks but I was already aware. The op was the one that conflated SPMD and SIMD, not me. > SPMD is just a mutiple copies of a single program running on multiple proces…
OP did not conflate them, SPMD and SIMT are the same model, they're just used in different contexts.
Re: Implementing a GPU's programming model on a CPU
#24Earlier quoted context omitted.
OP did not conflate them, SPMD and SIMT are the same model, they're just used in different contexts.
well i guess it's just your word against ... basically any other resource on the matter (in addition to just a common sense understanding) :shrug:
Re: Implementing a GPU's programming model on a CPU
#25This 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…
Re: Implementing a GPU's programming model on a CPU
#26This 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…
AI has relatively simple workflow, less thread divergence, so the SIMT abstractions add very little value. HPC workflow on the other hand is lot more complex. Writing a good simulation program for example, is going to get inhumanly complex with just SIMD.
Re: Implementing a GPU's programming model on a CPU
#27This 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:/…
Subtle difference. A parallel_for can have asynchronous threads. They can all divergen and run independent instructions (due to if statements etc) SIMT means multiple processors all executing the exact same instruction. One instruction decoder, but like 64 execution pipelines.
The difference is that because the software "kernels" (i.e. software threads) may be mapped by the compiler either on hardware threads or on hardware SIMD lanes, and this mapping is not controlled by the programmer, the divergent instructions will cause inefficient (serial) execution when they happen to be executed on SIMD lanes of the same core, so they must be avoided.
This however is only an optimization problem, if the speed would be irrelevant all the kernels could execute divergent instructions.
The reason for the existence of CUDA is to mask for the programmer the existence of the SIMD lanes and to allow programming as if the software threads would map only to hardware threads. Nevertheless, for optimum performance the programmer must be aware that this abstraction is not really true, so the programs should be written with awareness of the limitations introduced by SIMD.
Re: Implementing a GPU's programming model on a CPU
#28Earlier quoted context omitted.
Subtle difference. A parallel_for can have asynchronous threads. They can all divergen and run independent instructions (due to if statements etc) SIMT means multiple processors all executing the exact same instruction. One instruction decoder, but like 64 execution pipelines.
The same is true for CUDA/OpenCL kernels. They can include conditionals and they can execute independent instructions. The difference is that because the software "kernels" (i.e. software threads) may be mapped by the compiler either on hardware threads or on hardware SIMD lanes, and this mapping is not controlled by the programmer, the divergent instructions will cause inefficient (serial) execution when they happen…
On conventional SIMT implementations (pre-Volta), the programmer also has to be aware of it to not cause deadlocks in the atomics across different lanes in the same warp.
On NV Volta onwards, each SIMT lane has its own instruction pointer with opportunistic reconvergence when possible.
Re: Implementing a GPU's programming model on a CPU
#29This statement is comparing the SIMT model to SIMD. Can anyone explain the last part about SIMT being better for many programs operating on its own data? Are they just saying you can have individual “threads” executing independently (via predication/masks and such)?
Re: Implementing a GPU's programming model on a CPU
#30Earlier quoted context omitted.
well i guess it's just your word against ... basically any other resource on the matter (in addition to just a common sense understanding) :shrug:
Ok dude, give me an actual argument. Tell me a substantial way that SIMT is different from SPMD
In SPMD, subgroups aren't easy to model, and would generally be emulated by inter-thread communication if it's important to match the semantics of a source program that includes them. Performance in that case would be terrible.
[1] In Vulkan, OpenGL, OpenCL, and WebGPU they are called "subgroups". In Nvidia including CUDA they are called "warps". In D3D and AMD they are called "waves". In Metal (often running on the same hardware) they are called "simdgroups". This fragmentation of terminology is part of the flavor of working with GPUs.
[2] "Fairly easily" by the standards of GPU infrastructure. In fact, the exact semantics have never been nailed down, and in particular "reconvergence" is poorly defined. Working through this is one of the things blocking subgroups in WebGPU (https://github.com/gpuweb/gpuweb/issues/4306). Even so, they're used commonly in practice, especially for things like fast matrix multiplication where you need to shuffle lots of data into place.