Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

[MXNET-1227] Adding CornerPooling operator #13401

Closed
wants to merge 15 commits into from

Conversation

BigDeviltjj
Copy link

@BigDeviltjj BigDeviltjj commented Nov 25, 2018

Description

Add operator:

  1. CornerPooling operator

link to JIRA issue 1227

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant JIRA issue created (except PRs with tiny changes)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
  • Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
  • Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
  • Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
  • Code is well-documented:
  • For user-facing API changes, API doc string has been updated.
  • For new C++ functions in header files, their functionalities and arguments are documented.
  • For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
  • Check the API doc at http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
  • To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

Changes

  • CornerPooling
  • docs
  • unittest

Comments

  • If this change is a backward incompatible change, why must this change be made.
  • Interesting edge cases to note here

@stu1130
Copy link
Contributor

stu1130 commented Nov 25, 2018

@mxnet-label-bot add [pr-awaiting-review]
Thanks for doing this @BigDeviltjj

@marcoabreu marcoabreu added the pr-awaiting-review PR is waiting for code review label Nov 25, 2018
@Roshrini
Copy link
Member

@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')
Copy link
Member

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

Copy link
Author

Choose a reason for hiding this comment

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

No problem, thank you!

Copy link
Author

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 .

Copy link
Member

@anirudh2290 anirudh2290 left a 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;
Copy link
Member

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)
Copy link
Member

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) {
Copy link
Member

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);
Copy link
Member

Choose a reason for hiding this comment

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

use TYPE_ASSIGN_CHECK

Copy link
Author

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!

@Roshrini
Copy link
Member

Roshrini commented Jan 2, 2019

@anirudh2290 @anirudhacharya Can you take a look if your comments are addressed? Thanks!

@anirudhacharya
Copy link
Member

My comments are addressed.

@BigDeviltjj can you please rebase push.

@BigDeviltjj
Copy link
Author

@anirudhacharya I have rebased my push.

@sandeep-krishnamurthy
Copy link
Contributor

@anirudhacharya - Can you please take a look back at this PR?

@anirudhacharya
Copy link
Member

@sandeep-krishnamurthy As mentioned above my comments have already been addressed. If @anirudh2290's comments are addressed, this PR can be merged.

@vandanavk
Copy link
Contributor

@BigDeviltjj could you resolve the branch conflict?

@anirudh2290 for review/merge

@anirudhacharya
Copy link
Member

@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>>>
Copy link
Member

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

@karan6181
Copy link
Contributor

@BigDeviltjj Can you please address the @anirudh2290 comments?
Also, please resolve the branch conflicts. Thanks!

@abhinavs95
Copy link
Contributor

@BigDeviltjj ping again! Could you please address the new comments and rebase?

@mxnet-label-bot update [pr-awaiting-response]

@marcoabreu marcoabreu added pr-awaiting-response PR is reviewed and waiting for contributor to respond and removed pr-awaiting-review PR is waiting for code review labels Mar 28, 2019
@piyushghai
Copy link
Contributor

@BigDeviltjj Gentle ping...

@Roshrini
Copy link
Member

@BigDeviltjj Can you address few comments and resolve conflicts so that we can move forward with this PR?

@roywei
Copy link
Member

roywei commented Apr 30, 2019

@BigDeviltjj gentle ping to resolve the conflicts. thanks!

@vandanavk
Copy link
Contributor

@mxnet-label-bot add [Operator]

@karan6181
Copy link
Contributor

@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!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Operator pr-awaiting-response PR is reviewed and waiting for contributor to respond
Projects
None yet
Development

Successfully merging this pull request may close these issues.