bmf icon indicating copy to clipboard operation
bmf copied to clipboard

使用torch.from_dlpack(vf.reformat(rgb).frame().plane(0))方法,会增加很多显存

Open zhangsong1234 opened this issue 1 year ago • 3 comments

人脸检测模型中使用torch.from_dlpack(vf.reformat(rgb).frame().plane(0))方法后显存明显增加了很多,输入是4K图片,使用与不使用这个方法显存差了500M左右

zhangsong1234 avatar May 23 '24 07:05 zhangsong1234

为了把数据给到torch,dlpack应该会额外占用一些显存做copy。

sfeiwong avatar May 23 '24 08:05 sfeiwong

4K图片一张只有24M,但使用这个方法时增加了500M

zhangsong1234 avatar May 23 '24 11:05 zhangsong1234

4K图片一张只有24M,但使用这个方法时增加了500M

Can this be asked to the upstream community(torch)?

JackLau1222 avatar Nov 28 '24 14:11 JackLau1222