Is it possible to manually set the SMs used for one CUDA stream?

三世轮回 提交于 2021-02-05 10:51:05

问题


By default, the kernel will use all available SMs of the device (if enough blocks). However, now I have 2 stream with one computational-intense and one memory-intense, and I want to limit the maximal SMs used for 2 stream respectively (after setting the maximal SMs, the kernel in one stream will use up to maximal SMs, like 20SMs for computational-intense and 4SMs for memory-intense), is it possible to do so? (if possible, which API should I use)


回答1:


In short, no there is no way to do what you envisage.

The CUDA execution model doesn't provide that sort of granularity, and that isn't an accident. By abstracting that level of scheduling and work distribution away, it means (within reason) any code you can run on the smallest GPU of a given architecture can also run on the largest without any modification. That is important from a portability and interoperability point of view.



来源:https://stackoverflow.com/questions/62529623/is-it-possible-to-manually-set-the-sms-used-for-one-cuda-stream

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!