5 ms·
SIMT is interesting because each thread looks like scalar code but multiple threads are executed in lockstep using parallel pipelines. They only had to add a fe
by wmf 4y ago
SIMT is interesting because each thread looks like scalar code but multiple threads are executed in lockstep using parallel pipelines. They only had to add a few instructions (section 2.3) to enable RISC-V to support SIMT.
- nine_k 4y agoThis makes much more sense now, thanks! But I suppose that SIMT-oriented cores also need to disable some instructions, like most jump instructions, and especially jumping back, correct? Also, I suppose, there ought to be an easy way to look into the memory "to the left" and "to the right", but likely it can be preset by making a constant offset available to every thread.
- wmf 4y agoSIMT control flow can get tricky. Unconditional jumps are fine if all the threads jump to the same address (e.g. a function call or return) because they're still in lockstep. Data-dependent conditional branches cause divergence (some threads branch and some don't) which requires special handling mentioned in the paper.
- raphlinus 4y agoTypically in SIMT, all lanes in a "simd" (aka subgroup in Vulkanspeak) share the same program counter. However, there is an execution mask so not all lanes are active. Thus, to simulate "if A then B else C", you evaluate A for each lane to derive a mask, jump to C if the mask is empty, evaluate B only for the enabled lanes, invert the mask, skip over C if the mask is then empty, and evaluate C only for the enabled lanes. Loops also work, with similar logic (the real loop terminates when the predicate is false for all lanes).