CUDA Stream优化经验

Multi-Process Service(MPS)原理:

    一个GPU卡上同时只能执行一个context;因此多进程同时往一个GPU卡上提交任务时,同时只能有一个任务跑起来,没法多任务并行;

    MPS服务:多进程提交的任务先提交至MPS服务进程,该进程会把所有任务使用同一个context但不同的stream, 提交给该块GPU卡,使得可以多任务并行;

    缺点:增大了任务提交的延迟,因为要多经过MPS服务进程这个“代理”;

CUDA Context里面有什么:

The cuda API exposes features of a stateful library: two consecutive calls relate one-another. In short, the context is its state.

The runtime API is a wrapper/helper of the driver API. You can see in the driver API that the context is explicitly made available, and you can have a stack of contexts for convenience. There is one specific context which is shared between driver and runtime API (See 

评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值