Vision: Transformations in GPU

Created on 24 Jan 2017  路  11Comments  路  Source: pytorch/vision

Is there any plan to support image transformations for GPU?
Doing big transformations e.g resizing (224x224) <-> (64x64) with PIL seems a bit slow.

enhancement help wanted

Most helpful comment

@edgarriba we are thinking about it. It seems like a good idea, and NVIDIA has the relevant GPU kernels already implemented.

All 11 comments

@edgarriba we are thinking about it. It seems like a good idea, and NVIDIA has the relevant GPU kernels already implemented.

nice! that good could be a very appreciate feature :wink:

also OpenCV seems a bit faster with this, however I think that such GPU routines are not available in Python

@edgarriba You may try pytorch/accimage with PR #15 to leverage Intel IPP for preprocessing. Keep in mind that this package is beta (like in beta than nothing) and barely tested.

@Maratyszcza thx to point me to this, looks pretty good. I'll try to run and give feedback

I'd be happy to give this a go, if there's still interest?

I think there might still be interest in having this cc @soumith who might have a stronger opinion here

so any plans for GPU data-augmentations or do we still stick to cpu PIL?

@radenmuaz in kornia.org we recently introduced an API for that. Not only supports GPU but also differentiablility. Please check the kornia.augmentation module.

Those of us on non-x86-64 systems would benefit from GPU accelerated transformations given the lack of optimizations for our architecture at times. For example, we are seeing significant performance disparities between x86-64 and power9 systems that use the same GPU and profiling points the finger at the Power9 CPU taking longer to crunch torchvision/transforms and PIL.

@qhaas https://github.com/pytorch/vision/pull/2278 is a first step towards making the transforms run seamlessly on the CPU / GPU via torch tensors. For now it will be on a per-image basis so GPUs will probably be slow, but in the future with NestedTensor support we might be able to make it efficient for batches of different image sizes

Was this page helpful?
0 / 5 - 0 ratings