-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[MXNET-1227] Adding CornerPooling operator #13401
Conversation
@mxnet-label-bot add [pr-awaiting-review] |
e44fd5f
to
76c1e1c
Compare
@apeforest @eric-haibin-lin Can you please review this PR? |
@@ -7231,6 +7231,18 @@ def f_sm_ce(data, label): | |||
np_one_hot_label[np.arange(batch_size), np_label] = 1. | |||
check_symbolic_forward(sym, {'data' : np_data, 'label' : np_label}, [np.array([f_sm_ce(np_sm, np_one_hot_label)])], rtol=1e-3, atol=1e-5) | |||
|
|||
@with_seed() | |||
def test_corner_pooling(): | |||
data = mx.sym.Variable(name='data') |
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.
also call check_symbolic_forward
and check_symbolic_backward
- https://mxnet.incubator.apache.org/faq/add_op_in_backend.html#unit-test
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.
No problem, thank you!
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.
I have added these two functions, check_symbolic_forward
and check_symbolic_backward
.
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 the contribution! Don't forget to add your name to CONTRIBUTORS.md
CHECK_EQ(req_type, kWriteTo) | ||
<< "Only support req=kWriteTo in corner pooling operations"; | ||
using mshadow::red::limits::MinValue; | ||
// const TShape &oshape = ishape; |
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.
remove unused code
h_end = height; | ||
} | ||
const index_t data_offset = width * height; | ||
for (index_t b{0}; b < ishape[0]; ++b) |
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.
can you make it consistent with other mxnet code: for (index_t b = 0; b < ishape[0]; ++b)
here and at other places.
const index_t data_offset = width * height; | ||
for (index_t b{0}; b < ishape[0]; ++b) | ||
for (index_t c{0}; c < ishape[1]; ++c) { | ||
for (index_t w{0}; w < width; ++w) { |
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.
can you add TODOs for optimization with Kernel::Launch
static bool CornerPoolingType(const nnvm::NodeAttrs &attrs, | ||
std::vector<int> *in_attrs, | ||
std::vector<int> *out_attrs) { | ||
out_attrs->at(0) = in_attrs->at(0); |
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.
use TYPE_ASSIGN_CHECK
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.
I have modified all the code you mentioned above. Please check my code, Thank you so much and Happy Christmas Eve!
@anirudh2290 @anirudhacharya Can you take a look if your comments are addressed? Thanks! |
My comments are addressed. @BigDeviltjj can you please rebase push. |
bc377b6
to
fda9a2a
Compare
@anirudhacharya I have rebased my push. |
@anirudhacharya - Can you please take a look back at this PR? |
@sandeep-krishnamurthy As mentioned above my comments have already been addressed. If @anirudh2290's comments are addressed, this PR can be merged. |
@BigDeviltjj could you resolve the branch conflict? @anirudh2290 for review/merge |
@anirudh2290 I see that your comments are addressed, can you please take another look at this PR. |
mshadow::cuda::CheckLaunchParam(dimGrid, | ||
dimBlock, "Corner Pooling Forward"); | ||
cudaStream_t stream = mshadow::Stream<gpu>::GetStream(s); | ||
CornerPoolingForwardTBKernel<DType><<< dimGrid, dimBlock, 0, stream>>> |
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.
can we add launch bound guards similar to #13188
@BigDeviltjj Can you please address the @anirudh2290 comments? |
@BigDeviltjj ping again! Could you please address the new comments and rebase? @mxnet-label-bot update [pr-awaiting-response] |
@BigDeviltjj Gentle ping... |
@BigDeviltjj Can you address few comments and resolve conflicts so that we can move forward with this PR? |
@BigDeviltjj gentle ping to resolve the conflicts. thanks! |
@mxnet-label-bot add [Operator] |
@BigDeviltjj Could you please provide an update on this PR? It's being more than 3 months and the PR is idle. If you are unable to work on this PR, you may want to consider closing it, and resubmitting once you have the bandwidth to work on it. Thank You! |
Description
Add operator:
link to JIRA issue 1227
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.
Changes
Comments