-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[quant] fill_ path for quantized tensors #43303
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
Conversation
[ghstack-poisoned]
💊 CI failures summary and remediationsAs of commit f48d10b (more details on the Dr. CI page):
ci.pytorch.org: 1 failedThis 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. This comment has been revised 25 times. |
ailzhang
left a comment
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.
ehhh what's the main goal of this PR (perf?) could you please add a bit context?
It's introducing the |
Differential Revision: [D23231947](https://our.internmc.facebook.com/intern/diff/D23231947) [ghstack-poisoned]
Differential Revision: [D23231947](https://our.internmc.facebook.com/intern/diff/D23231947) [ghstack-poisoned]
Differential Revision: [D23231947](https://our.internmc.facebook.com/intern/diff/D23231947) [ghstack-poisoned]
Differential Revision: [D23231947](https://our.internmc.facebook.com/intern/diff/D23231947) [ghstack-poisoned]
Differential Revision: [D23231947](https://our.internmc.facebook.com/intern/diff/D23231947) [ghstack-poisoned]
| Tensor& fill_out(Tensor& self, Scalar value) { | ||
| if (self.is_quantized()) { | ||
| at::Tensor out = at::ones(self.sizes()).to(kFloat) * value; | ||
| out = out.to(self.device()); |
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.
is this needed? Can we assert that out.device() == self.device() instead?
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.
We cannot assert it as the out created in this block. If we don't assign the device, we will have to trust the copy_ to move the tensors across the devices, which is an antipattern :/
Differential Revision: [D23231947](https://our.internmc.facebook.com/intern/diff/D23231947) [ghstack-poisoned]
Codecov Report
@@ Coverage Diff @@
## gh/z-a-f/53/base #43303 +/- ##
=================================================
Coverage 69.24% 69.24%
=================================================
Files 381 381
Lines 47573 47573
=================================================
Hits 32943 32943
Misses 14630 14630 Continue to review full report at Codecov.
|
Differential Revision: [D23231947](https://our.internmc.facebook.com/intern/diff/D23231947) [ghstack-poisoned]
Differential Revision: [D23231947](https://our.internmc.facebook.com/intern/diff/D23231947) [ghstack-poisoned]
Stack from ghstack:
Differential Revision: D23231947