Skip to content

Conversation

@kimishpatel
Copy link
Contributor

@kimishpatel kimishpatel commented Jul 24, 2020

Stack from ghstack:

Summary:
zero buffer and indirection pointers are allocatoed on every iterations.
With this refactor we create op once for qnnpackconv struct and keep
repopulating indirection pointer as necessary.

For deconv moved much of op creation outside so that we can avoid creating and
destroying ops every time.

Test Plan:
CI quantization tests.
deconvolution-test

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: D22726972

Summary:
zero buffer and indirection pointers are allocatoed on every iterations.
With this refactor we create op once for qnnpackconv struct and keep
repopulating indirection pointer as necessary.

For deconv moved much of op creation outside so that we can avoid creating and
destroying ops every time.

Test Plan:
CI quantization tests.
deconvolution-test

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
@dr-ci
Copy link

dr-ci bot commented Jul 24, 2020

💊 CI failures summary and remediations

As of commit d1cd111 (more details on the Dr. CI page):


  • 2/2 failures possibly* introduced in this PR
    • 2/2 non-CircleCI failure(s)

Extra GitHub checks: 1 failed


ci.pytorch.org: 1 failed


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group.

See how this bot performed.

This comment has been revised 77 times.

Summary:
zero buffer and indirection pointers are allocatoed on every iterations.
With this refactor we create op once for qnnpackconv struct and keep
repopulating indirection pointer as necessary.

For deconv moved much of op creation outside so that we can avoid creating and
destroying ops every time.

Test Plan:
CI quantization tests.
deconvolution-test

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: [D22726972](https://our.internmc.facebook.com/intern/diff/D22726972)

[ghstack-poisoned]
Summary:
zero buffer and indirection pointers are allocatoed on every iterations.
With this refactor we create op once for qnnpackconv struct and keep
repopulating indirection pointer as necessary.

For deconv moved much of op creation outside so that we can avoid creating and
destroying ops every time.

Test Plan:
CI quantization tests.
deconvolution-test

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: [D22726972](https://our.internmc.facebook.com/intern/diff/D22726972)

[ghstack-poisoned]
Summary:
zero buffer and indirection pointers are allocatoed on every iterations.
With this refactor we create op once for qnnpackconv struct and keep
repopulating indirection pointer as necessary.

For deconv moved much of op creation outside so that we can avoid creating and
destroying ops every time.

Test Plan:
CI quantization tests.
deconvolution-test

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: [D22726972](https://our.internmc.facebook.com/intern/diff/D22726972)

[ghstack-poisoned]
Summary:
zero buffer and indirection pointers are allocatoed on every iterations.
With this refactor we create op once for qnnpackconv struct and keep
repopulating indirection pointer as necessary.

For deconv moved much of op creation outside so that we can avoid creating and
destroying ops every time.

Test Plan:
CI quantization tests.
deconvolution-test

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: [D22726972](https://our.internmc.facebook.com/intern/diff/D22726972)

[ghstack-poisoned]
Summary:
zero buffer and indirection pointers are allocatoed on every iterations.
With this refactor we create op once for qnnpackconv struct and keep
repopulating indirection pointer as necessary.

For deconv moved much of op creation outside so that we can avoid creating and
destroying ops every time.

Test Plan:
CI quantization tests.
deconvolution-test

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: [D22726972](https://our.internmc.facebook.com/intern/diff/D22726972)

[ghstack-poisoned]
Summary:
zero buffer and indirection pointers are allocatoed on every iterations.
With this refactor we create op once for qnnpackconv struct and keep
repopulating indirection pointer as necessary.

For deconv moved much of op creation outside so that we can avoid creating and
destroying ops every time.

Test Plan:
CI quantization tests.
deconvolution-test

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: [D22726972](https://our.internmc.facebook.com/intern/diff/D22726972)

[ghstack-poisoned]
Summary:
zero buffer and indirection pointers are allocatoed on every iterations.
With this refactor we create op once for qnnpackconv struct and keep
repopulating indirection pointer as necessary.

For deconv moved much of op creation outside so that we can avoid creating and
destroying ops every time.

Test Plan:
CI quantization tests.
deconvolution-test

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: [D22726972](https://our.internmc.facebook.com/intern/diff/D22726972)

[ghstack-poisoned]
Summary:
zero buffer and indirection pointers are allocatoed on every iterations.
With this refactor we create op once for qnnpackconv struct and keep
repopulating indirection pointer as necessary.

For deconv moved much of op creation outside so that we can avoid creating and
destroying ops every time.

Test Plan:
CI quantization tests.
deconvolution-test

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: [D22726972](https://our.internmc.facebook.com/intern/diff/D22726972)

[ghstack-poisoned]
Summary:
zero buffer and indirection pointers are allocatoed on every iterations.
With this refactor we create op once for qnnpackconv struct and keep
repopulating indirection pointer as necessary.

For deconv moved much of op creation outside so that we can avoid creating and
destroying ops every time.

Test Plan:
CI quantization tests.
deconvolution-test

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: [D22726972](https://our.internmc.facebook.com/intern/diff/D22726972)

[ghstack-poisoned]
Summary:
zero buffer and indirection pointers are allocatoed on every iterations.
With this refactor we create op once for qnnpackconv struct and keep
repopulating indirection pointer as necessary.

For deconv moved much of op creation outside so that we can avoid creating and
destroying ops every time.

Test Plan:
CI quantization tests.
deconvolution-test

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: [D22726972](https://our.internmc.facebook.com/intern/diff/D22726972)

[ghstack-poisoned]
Summary:
zero buffer and indirection pointers are allocatoed on every iterations.
With this refactor we create op once for qnnpackconv struct and keep
repopulating indirection pointer as necessary.

For deconv moved much of op creation outside so that we can avoid creating and
destroying ops every time.

Test Plan:
CI quantization tests.
deconvolution-test

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: [D22726972](https://our.internmc.facebook.com/intern/diff/D22726972)

[ghstack-poisoned]
Summary:
zero buffer and indirection pointers are allocatoed on every iterations.
With this refactor we create op once for qnnpackconv struct and keep
repopulating indirection pointer as necessary.

For deconv moved much of op creation outside so that we can avoid creating and
destroying ops every time.

Test Plan:
CI quantization tests.
deconvolution-test

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: [D22726972](https://our.internmc.facebook.com/intern/diff/D22726972)

[ghstack-poisoned]
Summary:
zero buffer and indirection pointers are allocatoed on every iterations.
With this refactor we create op once for qnnpackconv struct and keep
repopulating indirection pointer as necessary.

For deconv moved much of op creation outside so that we can avoid creating and
destroying ops every time.

Test Plan:
CI quantization tests.
deconvolution-test

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: [D22726972](https://our.internmc.facebook.com/intern/diff/D22726972)

[ghstack-poisoned]
Summary:
zero buffer and indirection pointers are allocatoed on every iterations.
With this refactor we create op once for qnnpackconv struct and keep
repopulating indirection pointer as necessary.

For deconv moved much of op creation outside so that we can avoid creating and
destroying ops every time.

Test Plan:
CI quantization tests.
deconvolution-test

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: [D22726972](https://our.internmc.facebook.com/intern/diff/D22726972)

[ghstack-poisoned]
@kimishpatel kimishpatel requested a review from supriyar August 18, 2020 16:08
pytorch_qnnp_log_error(
"Per channel quantized weights are not supported for XZP kernels");
assert("Failed to initialize QNNPACK conv_param_t struct.");
}
Copy link
Contributor

@AshkanAliabadi AshkanAliabadi Aug 18, 2020

Choose a reason for hiding this comment

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

Can this cause unexpected behavior if someone uses the XZP kernels? I know we are not currently using it but it would be safer to either remove it completely or leave it functional rather than an in-between state.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the catch. Strange I removed this. Will reinstate.

@@ -1,4 +1,5 @@
#include <conv_utils.h>
#include <conv_utils.h>
Copy link
Contributor

Choose a reason for hiding this comment

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

Redundant include

input_pixel_stride,
output,
output_pixel_stride,
threadpool);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the logic removed to the left entirely contained in pytorch_qnnp_setup_convolution2d_nhwc_q8?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes.

const uint32_t cr = pytorch_qnnp_params.q8dw9.cr;
const size_t group_stride = (groups + (cr - 1)) & -cr;

if (any_padding) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain why this block is removed? From 376 to 414.

const void** indirection_buffer = (const void**)realloc(
deconvolution->indirection_buffer, indirection_buffer_size);
if (indirection_buffer == NULL) {
pytorch_qnnp_status status = pytorch_qnnp_setup_deconvolution2d_nhwc_q8(
Copy link
Contributor

Choose a reason for hiding this comment

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

So again, all of the logic removed to the left is replaced with pytorch_qnnp_setup_deconvolution2d_nhwc_q8?

const bool any_padding = (conv_p.padding[0]| conv_p.padding[1]
|conv_p.padding[2] | conv_p.padding[3]) != 0;

if (any_padding) {
Copy link
Contributor

Choose a reason for hiding this comment

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

OK I see, it is moved here.

Summary:
zero buffer and indirection pointers are allocatoed on every iterations.
With this refactor we create op once for qnnpackconv struct and keep
repopulating indirection pointer as necessary.

For deconv moved much of op creation outside so that we can avoid creating and
destroying ops every time.

Test Plan:
CI quantization tests.
deconvolution-test

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: [D22726972](https://our.internmc.facebook.com/intern/diff/D22726972)

[ghstack-poisoned]
Summary:
zero buffer and indirection pointers are allocatoed on every iterations.
With this refactor we create op once for qnnpackconv struct and keep
repopulating indirection pointer as necessary.

For deconv moved much of op creation outside so that we can avoid creating and
destroying ops every time.

Test Plan:
CI quantization tests.
deconvolution-test

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: [D22726972](https://our.internmc.facebook.com/intern/diff/D22726972)

[ghstack-poisoned]
Summary:
zero buffer and indirection pointers are allocatoed on every iterations.
With this refactor we create op once for qnnpackconv struct and keep
repopulating indirection pointer as necessary.

For deconv moved much of op creation outside so that we can avoid creating and
destroying ops every time.

Test Plan:
CI quantization tests.
deconvolution-test

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: [D22726972](https://our.internmc.facebook.com/intern/diff/D22726972)

[ghstack-poisoned]
Summary:
zero buffer and indirection pointers are allocatoed on every iterations.
With this refactor we create op once for qnnpackconv struct and keep
repopulating indirection pointer as necessary.

For deconv moved much of op creation outside so that we can avoid creating and
destroying ops every time.

Test Plan:
CI quantization tests.
deconvolution-test

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: [D22726972](https://our.internmc.facebook.com/intern/diff/D22726972)

[ghstack-poisoned]
Summary:
zero buffer and indirection pointers are allocatoed on every iterations.
With this refactor we create op once for qnnpackconv struct and keep
repopulating indirection pointer as necessary.

For deconv moved much of op creation outside so that we can avoid creating and
destroying ops every time.

Test Plan:
CI quantization tests.
deconvolution-test

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: [D22726972](https://our.internmc.facebook.com/intern/diff/D22726972)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 04aa42a.

@facebook-github-bot facebook-github-bot deleted the gh/kimishpatel/36/head branch August 25, 2020 14:14
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.

5 participants