多 GPU 容器训练的设备映射与通信
多 GPU 容器训练的设备映射与通信
难度:深度。本文为中文技术整理,保留来源中的技术边界;示例只用于阅读,未在本服务器执行。
多卡不仅要让容器看到设备,还要处理进程布局、逻辑设备编号、NCCL、共享内存和网络接口。单卡成功不能推导多卡通信成功。
示例
print(torch.cuda.device_count())
for i in range(torch.cuda.device_count()):
print(i, torch.cuda.get_device_name(i))
来源
- https://pytorch.org/docs/stable/distributed.html
多 GPU 容器训练的设备映射与通信
https://blog.529808.xyz//archives/tech-d286e291f91d