-
Notifications
You must be signed in to change notification settings - Fork 74.2k
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
[INTEL MKL] Enable mkl group conv #50333
[INTEL MKL] Enable mkl group conv #50333
Conversation
@penpornk Can you please review this PR ? Thanks! |
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.
Thank you for the PR and sorry for the delay! I have a minor nit.
std::vector<MKLDNN_SIZE_DTYPE> mkldnn_sizes(5, -1); | ||
mkldnn_sizes[MKL_GROUP_FILTER_DIM_G] = group_count; | ||
mkldnn_sizes[MKL_GROUP_FILTER_DIM_O] = filter_out_depth / group_count; | ||
mkldnn_sizes[MKL_GROUP_FILTER_DIM_I] = filter_in_depth; | ||
mkldnn_sizes[MKL_GROUP_FILTER_DIM_H] = filter_rows; | ||
mkldnn_sizes[MKL_GROUP_FILTER_DIM_W] = filter_cols; |
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.
Nit: Can't we set filter_dims
directly? Same for other places.
If you agree, we can just add a TODO and do it later in a separate PR (to keep this one focused on enabling group conv).
std::vector<MKLDNN_SIZE_DTYPE> mkldnn_sizes(5, -1); | |
mkldnn_sizes[MKL_GROUP_FILTER_DIM_G] = group_count; | |
mkldnn_sizes[MKL_GROUP_FILTER_DIM_O] = filter_out_depth / group_count; | |
mkldnn_sizes[MKL_GROUP_FILTER_DIM_I] = filter_in_depth; | |
mkldnn_sizes[MKL_GROUP_FILTER_DIM_H] = filter_rows; | |
mkldnn_sizes[MKL_GROUP_FILTER_DIM_W] = filter_cols; | |
filter_dims.resize(5); | |
filter_dims[MKL_GROUP_FILTER_DIM_G] = group_count; | |
filter_dims[MKL_GROUP_FILTER_DIM_O] = filter_out_depth / group_count; | |
filter_dims[MKL_GROUP_FILTER_DIM_I] = filter_in_depth; | |
filter_dims[MKL_GROUP_FILTER_DIM_H] = filter_rows; | |
filter_dims[MKL_GROUP_FILTER_DIM_W] = filter_cols; |
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.
Thanks for review. Yes, we can directly set filter_dims
to remove redundant vector copy. Also I have added a TODO and will submit another PR.
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.
Thank you for the change!
It looks like the Linux GPU failure is related to this PR. Could you please help take a look at |
Looks like Eigen conv backward doesn't support group conv, so I removed the changes for gradient test case. |
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.
Thank you for the fix!
Group conv is already enabled in CPU. This PR enables mkl group conv.