Skip to content

cuda4dnn(resize): process multiple channels each iteration - #16097

Merged
alalek merged 4 commits into
opencv:masterfrom
YashasSamaga:cuda4dnn-optimize-resize-bilinear
Dec 9, 2019
Merged

alalek merged 4 commits into
opencv:masterfrom
YashasSamaga:cuda4dnn-optimize-resize-bilinear

Conversation

@YashasSamaga

@YashasSamaga YashasSamaga commented Dec 8, 2019 •

Copy link
Copy Markdown
Contributor

This pullrequest changes

  • optimize resize kernels (bilinear and nn) to process multiple channels each iteration

Bilinear resize kernel was compute-heavy. To ease the compute load, the calculations involving spatial dimensions at a location (x, y) can be reused by multiple channels.

Inception v2 MaskRCNN performs bilinear resize on a tensor of 204800 channels. The resize takes around 7.5ms. With this PR, it takes just 3.5ms. That's 2.15x improvement.

force_builders=Custom,docs
buildworker:Custom=linux-4
docker_image:Custom=ubuntu-cuda:16.04

@YashasSamaga YashasSamaga changed the title cuda4dnn(resize_bilinear): process multiple channels each iteration [WIP] cuda4dnn(resize_bilinear): process multiple channels each iteration Dec 9, 2019
@YashasSamaga YashasSamaga changed the title [WIP] cuda4dnn(resize_bilinear): process multiple channels each iteration cuda4dnn(resize): process multiple channels each iteration Dec 9, 2019

@alalek alalek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contribution 👍

@alalek
alalek merged commit 476a027 into opencv:master Dec 9, 2019
a-sajjad72 pushed a commit to a-sajjad72/opencv that referenced this pull request Mar 30, 2023
…esize-bilinear

cuda4dnn(resize): process multiple channels each iteration

* resize bilinear: process multiple chans. per iter.

* remove unused headers

* correct dispatch logic

* resize_nn: process multiple chans. per iter.
SavyaSanchi-Sharma pushed a commit to SavyaSanchi-Sharma/opencv that referenced this pull request Jul 30, 2026
…esize-bilinear

cuda4dnn(resize): process multiple channels each iteration

* resize bilinear: process multiple chans. per iter.

* remove unused headers

* correct dispatch logic

* resize_nn: process multiple chans. per iter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants