Skip to content

Conversation

@xiaomengy
Copy link
Contributor

@xiaomengy xiaomengy commented Nov 14, 2019

Summary:
Improve legacy QuantizedLinear functions to reduce overhead.

The legacy QuantizedLinear functions contains may unnecessary zeros and view ops which brings a large amount of overhead. This PR reduces them and improve the existing model performance.

Differential Revision: D18494988

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D18494988

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D18494988

1 similar comment
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D18494988

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D18494988

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D18494988

Copy link
Member

@jianyuh jianyuh left a comment

Choose a reason for hiding this comment

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

Copy link
Member

@jianyuh jianyuh Nov 15, 2019

Choose a reason for hiding this comment

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

Nit: the spaces added in the comment: Is it some CPP coding style standard? Changing this might mess up the blame.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Member

Choose a reason for hiding this comment

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

Wonder if the bias.contiguous(); implementation under the hood has got such checks?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually the difference is if we use reference here, there will be no tensor shallow copy at all. But anyway we can change it back since it is not a serious thing.

…29773)

Summary:
Pull Request resolved: pytorch#29773

Improve legacy QuantizedLinear functions to reduce overhead.
Separate from the stack of D18381988.

Test Plan: buck test mode/dev-nosan //caffe2/test:jit -- "quant"

Reviewed By: lly-zero-one

Differential Revision: D18494988

fbshipit-source-id: 081687ea8d1e9c67f1213930a40a482e0090a029
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D18494988

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 0995929.

zdevito pushed a commit to zdevito/ATen that referenced this pull request Nov 16, 2019
Summary:
Pull Request resolved: pytorch/pytorch#29773

Improve legacy QuantizedLinear functions to reduce overhead.
Separate from the stack of D18381988.

Test Plan: buck test mode/dev-nosan //caffe2/test:jit -- "quant"

Reviewed By: lly-zero-one

Differential Revision: D18494988

fbshipit-source-id: 5627d7e8b0b7a750852eead9e28c5a9b3fa70559
Copy link
Collaborator

@jamesr66a jamesr66a left a comment

Choose a reason for hiding this comment

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

All the unrelated style changes make it very hard to tell what the actual functional changes from this PR are, and it messes up the blame. Please either refrain from making these changes or separate them out into a separate PR in the future

Tensor quantized = at::native::empty_like(
weight_contig, weight_contig.options().dtype(at::kChar));
// Tensor quantized = at::native::empty_cpu(
// weight_contig.sizes(), weight_contig.options().dtype(at::kChar));
Copy link
Collaborator

Choose a reason for hiding this comment

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

This probably shouldn't be here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants