Skip to content
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

Changes to enable per channel support on dynamic linear. #37623

Closed
wants to merge 25 commits into from

Conversation

kimishpatel
Copy link
Contributor

@kimishpatel kimishpatel commented Apr 30, 2020

Stack from ghstack:

Summary:
Follows the same strategy as static linear. Supply pointer to an array of zero points and requantization scales. Thus same kernel now supports both per-channel and per-tensor linear.

Test Plan:
qnnpack tests
q8gemm
fully-connected-test

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: D21339040

Summary:
Follows the same strategy as static linear.
Same kernel now supports both per-channel and per-tensor linear.
Fixed fully connected test.

Test Plan:
qnnpack tests
q8gemm
fully-connected-test

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
@dr-ci
Copy link

dr-ci bot commented Apr 30, 2020

💊 CI failures summary and remediations

As of commit 259e09c (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 123 times.

Summary:
Follows the same strategy as static linear.
Same kernel now supports both per-channel and per-tensor linear.
Fixed fully connected test.

Test Plan:
qnnpack tests
q8gemm
fully-connected-test

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
Summary:
Follows the same strategy as static linear.
Same kernel now supports both per-channel and per-tensor linear.
Fixed fully connected test.

Test Plan:
qnnpack tests
q8gemm
fully-connected-test

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
Summary:
Follows the same strategy as static linear.
Same kernel now supports both per-channel and per-tensor linear.
Fixed fully connected test.

Test Plan:
qnnpack tests
q8gemm
fully-connected-test

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
Summary:
Follows the same strategy as static linear.
Same kernel now supports both per-channel and per-tensor linear.
Fixed fully connected test.

Test Plan:
qnnpack tests
q8gemm
fully-connected-test

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
Summary:
Follows the same strategy as static linear.
Same kernel now supports both per-channel and per-tensor linear.
Fixed fully connected test.

Test Plan:
qnnpack tests
q8gemm
fully-connected-test

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
Summary:
Follows the same strategy as static linear.
Same kernel now supports both per-channel and per-tensor linear.
Fixed fully connected test.

Test Plan:
qnnpack tests
q8gemm
fully-connected-test

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
@kimishpatel kimishpatel mentioned this pull request May 5, 2020
Summary:
Follows the same strategy as static linear.
Same kernel now supports both per-channel and per-tensor linear.
Fixed fully connected test.

Test Plan:
qnnpack tests
q8gemm
fully-connected-test

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
Summary:
Follows the same strategy as static linear.
Same kernel now supports both per-channel and per-tensor linear.
Fixed fully connected test.

Test Plan:
qnnpack tests
q8gemm
fully-connected-test

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
Summary:
Follows the same strategy as static linear.
Same kernel now supports both per-channel and per-tensor linear.
Fixed fully connected test.

Test Plan:
qnnpack tests
q8gemm
fully-connected-test

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
Summary:
Follows the same strategy as static linear.
Same kernel now supports both per-channel and per-tensor linear.
Fixed fully connected test.

Test Plan:
qnnpack tests
q8gemm
fully-connected-test

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
Summary:
Follows the same strategy as static linear.
Same kernel now supports both per-channel and per-tensor linear.
Fixed fully connected test.

Test Plan:
qnnpack tests
q8gemm
fully-connected-test

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
Summary:
Follows the same strategy as static linear. Supply pointer to an array of zero points and requantization scales. Thus same kernel now supports both per-channel and per-tensor linear. 

Test Plan:
qnnpack tests
q8gemm
fully-connected-test

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
xuezhou1998 pushed a commit to xuezhou1998/new_pytorch that referenced this pull request May 9, 2020
Summary:
Follows the same strategy as static linear.
Same kernel now supports both per-channel and per-tensor linear.
Fixed fully connected test.

Test Plan:
qnnpack tests
q8gemm
fully-connected-test

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 93fdcb14221310b172caa1d2fa3976b7c088bd4b
Pull Request resolved: pytorch/pytorch#37623
Summary:
Follows the same strategy as static linear. Supply pointer to an array of zero points and requantization scales. Thus same kernel now supports both per-channel and per-tensor linear. 

Test Plan:
qnnpack tests
q8gemm
fully-connected-test

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
Summary:
Follows the same strategy as static linear. Supply pointer to an array of zero points and requantization scales. Thus same kernel now supports both per-channel and per-tensor linear. 

Test Plan:
qnnpack tests
q8gemm
fully-connected-test

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
Summary:
Follows the same strategy as static linear. Supply pointer to an array of zero points and requantization scales. Thus same kernel now supports both per-channel and per-tensor linear. 

Test Plan:
qnnpack tests
q8gemm
fully-connected-test

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
Summary:
Follows the same strategy as static linear. Supply pointer to an array of zero points and requantization scales. Thus same kernel now supports both per-channel and per-tensor linear. 

Test Plan:
qnnpack tests
q8gemm
fully-connected-test

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
Comment on lines 259 to 261
// TODO Kimish, we are allocating affine_quantized regardless of per channel or not.
// This allocation is actually used only for packing weight and thus will be freed.
// Still we should be consistent. Fix this.
Copy link
Contributor

Choose a reason for hiding this comment

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

Are the scale and offset even used here? Could this just be a normal CPU tensor of dtype uint8?

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 it can be. Let me do that after this stack lands.

Copy link
Contributor

@dreiss dreiss left a comment

Choose a reason for hiding this comment

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

Didn't review the microkernel changes, but the rest looks good.

Summary:
Follows the same strategy as static linear. Supply pointer to an array of zero points and requantization scales. Thus same kernel now supports both per-channel and per-tensor linear. 

Test Plan:
qnnpack tests
q8gemm
fully-connected-test

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
Summary:
Follows the same strategy as static linear. Supply pointer to an array of zero points and requantization scales. Thus same kernel now supports both per-channel and per-tensor linear. 

Test Plan:
qnnpack tests
q8gemm
fully-connected-test

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
Summary:
Follows the same strategy as static linear. Supply pointer to an array of zero points and requantization scales. Thus same kernel now supports both per-channel and per-tensor linear. 

Test Plan:
qnnpack tests
q8gemm
fully-connected-test

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
Summary:
Follows the same strategy as static linear. Supply pointer to an array of zero points and requantization scales. Thus same kernel now supports both per-channel and per-tensor linear. 

Test Plan:
qnnpack tests
q8gemm
fully-connected-test

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
Summary:
Follows the same strategy as static linear. Supply pointer to an array of zero points and requantization scales. Thus same kernel now supports both per-channel and per-tensor linear. 

Test Plan:
qnnpack tests
q8gemm
fully-connected-test

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
Summary:
Follows the same strategy as static linear. Supply pointer to an array of zero points and requantization scales. Thus same kernel now supports both per-channel and per-tensor linear. 

Test Plan:
qnnpack tests
q8gemm
fully-connected-test

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
Summary:
Follows the same strategy as static linear. Supply pointer to an array of zero points and requantization scales. Thus same kernel now supports both per-channel and per-tensor linear. 

Test Plan:
qnnpack tests
q8gemm
fully-connected-test

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
Summary:
Follows the same strategy as static linear. Supply pointer to an array of zero points and requantization scales. Thus same kernel now supports both per-channel and per-tensor linear. 

Test Plan:
qnnpack tests
q8gemm
fully-connected-test

Reviewers:

Subscribers:

Tasks:

Tags:

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

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

This pull request has been merged in 0a554ae.

@facebook-github-bot facebook-github-bot deleted the gh/kimishpatel/17/head branch May 24, 2020 14:16
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.

None yet

4 participants