CTranslate2 在StorageView中使用了错误的设备索引,

lbsnaicq  于 2个月前  发布在  其他
关注(0)|答案(1)|浏览(31)

我得到的输出是

Original tensor is on cuda:0 and StorageView is on cuda:0
Original tensor is on cuda:1 and StorageView is on cuda:0

实际数据仍然在 cuda:0 上,对于 y0cuda:1 上的数据。

gr8qqesn

gr8qqesn1#

我们使用 CUDA Array Interface 将 PyTorch Tensor加载到 StorageView 对象中,但在此接口中未暴露设备索引。
我们需要在 from_array 中添加一个新参数来指定 PyTorch Tensor的设备索引。

相关问题