-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TOPI, Relay] Support roi_align NHWC layout #7463
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
BTW, did you use ConvertLayout pass to convert the model layout? Would you need to add the corresponding layout converter (e.g., Also out of curiousity, what GPU did you use the get the performance number? |
Ah I see. That makes sense. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* begin nhwc roi align * integrate mode change from upstream * adding test * support nhwc shape func * update strategy * refactoring test * refactor test * refactoring * fix lint * update relay op tests
* begin nhwc roi align * integrate mode change from upstream * adding test * support nhwc shape func * update strategy * refactoring test * refactor test * refactoring * fix lint * update relay op tests
I've been working on optimizing MaskRCNN/FasterRCNN, one I thing I found was that Ansor generates better code for NHWC layout (see https://discuss.tvm.apache.org/t/autoscheduler-why-no-winograd-for-nchw-layout/9139). So I'm looking at improving NHWC end to end support / performance.
roi_align
only supports NCHW layout, solayout_transform
is inserted before/after eachroi_align
. This layout transform turned out expensive on GPU, so I added NHWC impl toroi_align
to removelayout_transform
. This cuts Faster RCNN runtime by 8 milli second.Now, with Ansor NHWC tuning +
roi_align
improvement in this PR, we are beating pytorch by a large margin:please review @kevinthesun @anijain2305 @comaniac @jwfromm @mbrookhart @electriclilies