PyTorch ROCm 已推出 - 如何选择 Radeon GPU 作为设备

2024-02-07

由于 Pytorch 发布了 ROCm 版本,这使我能够使用 nvidias 之外的其他 GPU,我如何在 python 中选择我的 radeon gpu 作为设备? 显然,像 device = torch.cuda.is_available 或 device = torch.device("cuda") 这样的代码不起作用。谢谢你的帮助。 :)


这花了我很长时间才弄清楚。我的 AMD GPU 仍然存在一些配置问题,所以我无法测试这是否有效,但是,根据这个 github pytorch 线程,Rocm 集成是这样编写的,因此您可以can只需调用 torch.device('cuda') 即可,无需实际移植!

请参阅此处的线程:https://github.com/pytorch/pytorch/issues/10670 https://github.com/pytorch/pytorch/issues/10670

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

PyTorch ROCm 已推出 - 如何选择 Radeon GPU 作为设备 的相关文章

随机推荐