Fix all factory invocations in quantized to correctly propagate options.#26966
Closed
ezyang wants to merge 1 commit intogh/ezyang/390/basefrom
Closed
Fix all factory invocations in quantized to correctly propagate options.#26966ezyang wants to merge 1 commit intogh/ezyang/390/basefrom
ezyang wants to merge 1 commit intogh/ezyang/390/basefrom
Conversation
Without this, you may allocate intermediates which are non-variables when you should allocate variables. Should help with discussion in #26868. Signed-off-by: Edward Z. Yang <ezyang@fb.com> [ghstack-poisoned]
yf225
approved these changes
Sep 27, 2019
ljk53
reviewed
Sep 27, 2019
| bias_fp32 = bias_in.value(); | ||
| } else { | ||
| bias_fp32 = at::zeros(out_ch, at::kFloat); | ||
| bias_fp32 = at::zeros(out_ch, weight.options().dtype(at::kFloat)); |
Contributor
There was a problem hiding this comment.
I patched this PR but it doesn't seem to fix the error on cpp_custom_type_hack() code path...
It still fails at !is_variable() check in empty_cpu:
#0 0x00000000006e14de in at::native::empty_cpu(c10::ArrayRef<long>, c10::TensorOptions const&, c10::optional<c10::MemoryFormat>) ()
#1 0x00000000007cf8cf in at::CPUType::empty(c10::ArrayRef<long>, c10::TensorOptions const&, c10::optional<c10::MemoryFormat>) ()
#2 0x00000000007a364d in at::Tensor at::cpp_custom_type_hack::create<PackedConvWeightsQnnp>(std::unique_ptr<PackedConvWeightsQnnp, std::default_delete<PackedConvWeightsQnnp> >, c10::TensorOptions) ()
#3 0x00000000007a2347 in at::native::(anonymous namespace)::QConvPackWeightInt8::qnnpack_conv_prepack(at::Tensor, c10::optional<at::Tensor>, c10::List<long>, c10::List<long>, c10::List<long>, long) [clone .isra.280] ()
Contributor
Author
There was a problem hiding this comment.
Thanks for the quick feedback. I think this patch is a strict improvement, but I need to kill more spots.
zdevito
pushed a commit
to zdevito/ATen
that referenced
this pull request
Sep 27, 2019
…ns. (#26966) Summary: Pull Request resolved: pytorch/pytorch#26966 Without this, you may allocate intermediates which are non-variables when you should allocate variables. Should help with discussion in #26868. Signed-off-by: Edward Z. Yang <ezyang@fb.com> Test Plan: Imported from OSS Differential Revision: D17629863 Pulled By: ezyang fbshipit-source-id: 0dd9b218d3fc2dbbbbd9b1712db8ab4dac16ea22
Contributor
pdlive215
pushed a commit
to pdlive215/pytorch
that referenced
this pull request
Nov 27, 2019
…ns. (pytorch#26966) Summary: Pull Request resolved: pytorch#26966 Without this, you may allocate intermediates which are non-variables when you should allocate variables. Should help with discussion in pytorch#26868. Signed-off-by: Edward Z. Yang <ezyang@fb.com> Test Plan: Imported from OSS Differential Revision: D17629863 Pulled By: ezyang fbshipit-source-id: 0dd9b218d3fc2dbbbbd9b1712db8ab4dac16ea22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack from ghstack:
Without this, you may allocate intermediates which are non-variables
when you should allocate variables.
Should help with discussion in #26868.
Signed-off-by: Edward Z. Yang ezyang@fb.com
Differential Revision: D17629863