Is there any in kernel call that can force a warp evict from SIMD?

As there are multiple warps resident on the same SIMD slot, and the SIMD switches between warps when one is blocked by memread etc., is there any function that can force a warp to evict? Will __nanosleep() achieve that or it is a actually busy loop?

There is no device code you can write that will force a warp to “evict”, that is to become no longer “resident” on a SM, once it has been deposited there by the CWD/Block scheduler.

The general mechanism is called “preemption”, and it is not well described in CUDA documentation, but you can find various mentions of it in various forums.

Just based on the description of nanosleep my assumption is that for the duration of the sleep period, the warp would “sit there” and subsequent instructions would not be scheduleable by the warp scheduler in the SMSP to which that warp is assigned (until the sleep period had ended.)

If that is what you mean by “evict” (effectively stall the warp or make it not schedulable) then yes, nanosleep probably does that. But any dependent operation will do that. For example a warp that is “blocked by memread” I would interpret to be a warp that has a memory read instruction already issued and a subsequent instruction has a dependency on that memory read. In that case that warp would be not scheduleable at that point, until the memory read (and therefore the dependency) was satisfied.

Thanks for the clarification. That is exactly what I mean, I just want the warp to stall so that another warp can be scheduled onto SM.
It looks like nano_sleep will do that job according to your assumption. But nano_sleep only support on arch >= 7.1, is there any alternative of that?

I don’t know of an exact duplicate of nanosleep on cc6.x or 5.x.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.