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
bugfix in BinaryBroadcastLayout + unit test #6513
Merged
Merged
Conversation
This file contains 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
An attempt to fix an issue which appeared when ConverLayout pass runs on quantized binary operations like qnn.add: def before(): x = relay.var("x", shape=(2, 2)) y = relay.var("y", shape=(1, 2)) return relay.Function( [x, y], relay.qnn.op.add( x, y, lhs_scale=relay.const(0.0156863, "float32"), lhs_zero_point=relay.const(127, "int32"), rhs_scale=relay.const(0.0117647, "float32"), rhs_zero_point=relay.const(85, "int32"), output_scale=relay.const(0.0235294, "float32"), output_zero_point=relay.const(128, "int32"), ), ) The issue manifested itself as [bt] (2) ./src/tvm/build/libtvm.so(tvm::relay::qnn::QnnBinaryBroadcastLayout(tvm::Attrs const&, tvm::runtime::Array<tvm::tir::Layout, void> const&, tvm::runtime::Array<tvm::tir::Layout, void> const&, tvm::runtime::Array<tvm::Type, void> const&)+0xa9) [0x7fadc080d949] [bt] (1) ./src/tvm/build/libtvm.so(tvm::runtime::Array<tvm::tir::Layout, void>::operator[](long) const+0xb6) [0x7fadc0382996] [bt] (0) ./src/tvm/build/libtvm.so(+0xb50c12) [0x7fadc037cc12] File "/workspace/include/tvm/runtime/container.h", line 681 IndexError: Check failed: 0 <= i && i < p->size_: indexing 1 on an array of size 1
cc @anijain2305 |
anijain2305
approved these changes
Sep 21, 2020
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.
Thanks for finding and fixing the bug! LGTM.
TusharKanekiDey
pushed a commit
to TusharKanekiDey/tvm
that referenced
this pull request
Oct 13, 2020
An attempt to fix an issue which appeared when ConverLayout pass runs on quantized binary operations like qnn.add: def before(): x = relay.var("x", shape=(2, 2)) y = relay.var("y", shape=(1, 2)) return relay.Function( [x, y], relay.qnn.op.add( x, y, lhs_scale=relay.const(0.0156863, "float32"), lhs_zero_point=relay.const(127, "int32"), rhs_scale=relay.const(0.0117647, "float32"), rhs_zero_point=relay.const(85, "int32"), output_scale=relay.const(0.0235294, "float32"), output_zero_point=relay.const(128, "int32"), ), ) The issue manifested itself as [bt] (2) ./src/tvm/build/libtvm.so(tvm::relay::qnn::QnnBinaryBroadcastLayout(tvm::Attrs const&, tvm::runtime::Array<tvm::tir::Layout, void> const&, tvm::runtime::Array<tvm::tir::Layout, void> const&, tvm::runtime::Array<tvm::Type, void> const&)+0xa9) [0x7fadc080d949] [bt] (1) ./src/tvm/build/libtvm.so(tvm::runtime::Array<tvm::tir::Layout, void>::operator[](long) const+0xb6) [0x7fadc0382996] [bt] (0) ./src/tvm/build/libtvm.so(+0xb50c12) [0x7fadc037cc12] File "/workspace/include/tvm/runtime/container.h", line 681 IndexError: Check failed: 0 <= i && i < p->size_: indexing 1 on an array of size 1
TusharKanekiDey
pushed a commit
to TusharKanekiDey/tvm
that referenced
this pull request
Oct 14, 2020
An attempt to fix an issue which appeared when ConverLayout pass runs on quantized binary operations like qnn.add: def before(): x = relay.var("x", shape=(2, 2)) y = relay.var("y", shape=(1, 2)) return relay.Function( [x, y], relay.qnn.op.add( x, y, lhs_scale=relay.const(0.0156863, "float32"), lhs_zero_point=relay.const(127, "int32"), rhs_scale=relay.const(0.0117647, "float32"), rhs_zero_point=relay.const(85, "int32"), output_scale=relay.const(0.0235294, "float32"), output_zero_point=relay.const(128, "int32"), ), ) The issue manifested itself as [bt] (2) ./src/tvm/build/libtvm.so(tvm::relay::qnn::QnnBinaryBroadcastLayout(tvm::Attrs const&, tvm::runtime::Array<tvm::tir::Layout, void> const&, tvm::runtime::Array<tvm::tir::Layout, void> const&, tvm::runtime::Array<tvm::Type, void> const&)+0xa9) [0x7fadc080d949] [bt] (1) ./src/tvm/build/libtvm.so(tvm::runtime::Array<tvm::tir::Layout, void>::operator[](long) const+0xb6) [0x7fadc0382996] [bt] (0) ./src/tvm/build/libtvm.so(+0xb50c12) [0x7fadc037cc12] File "/workspace/include/tvm/runtime/container.h", line 681 IndexError: Check failed: 0 <= i && i < p->size_: indexing 1 on an array of size 1
TusharKanekiDey
pushed a commit
to TusharKanekiDey/tvm
that referenced
this pull request
Oct 15, 2020
An attempt to fix an issue which appeared when ConverLayout pass runs on quantized binary operations like qnn.add: def before(): x = relay.var("x", shape=(2, 2)) y = relay.var("y", shape=(1, 2)) return relay.Function( [x, y], relay.qnn.op.add( x, y, lhs_scale=relay.const(0.0156863, "float32"), lhs_zero_point=relay.const(127, "int32"), rhs_scale=relay.const(0.0117647, "float32"), rhs_zero_point=relay.const(85, "int32"), output_scale=relay.const(0.0235294, "float32"), output_zero_point=relay.const(128, "int32"), ), ) The issue manifested itself as [bt] (2) ./src/tvm/build/libtvm.so(tvm::relay::qnn::QnnBinaryBroadcastLayout(tvm::Attrs const&, tvm::runtime::Array<tvm::tir::Layout, void> const&, tvm::runtime::Array<tvm::tir::Layout, void> const&, tvm::runtime::Array<tvm::Type, void> const&)+0xa9) [0x7fadc080d949] [bt] (1) ./src/tvm/build/libtvm.so(tvm::runtime::Array<tvm::tir::Layout, void>::operator[](long) const+0xb6) [0x7fadc0382996] [bt] (0) ./src/tvm/build/libtvm.so(+0xb50c12) [0x7fadc037cc12] File "/workspace/include/tvm/runtime/container.h", line 681 IndexError: Check failed: 0 <= i && i < p->size_: indexing 1 on an array of size 1
TusharKanekiDey
pushed a commit
to TusharKanekiDey/tvm
that referenced
this pull request
Oct 16, 2020
An attempt to fix an issue which appeared when ConverLayout pass runs on quantized binary operations like qnn.add: def before(): x = relay.var("x", shape=(2, 2)) y = relay.var("y", shape=(1, 2)) return relay.Function( [x, y], relay.qnn.op.add( x, y, lhs_scale=relay.const(0.0156863, "float32"), lhs_zero_point=relay.const(127, "int32"), rhs_scale=relay.const(0.0117647, "float32"), rhs_zero_point=relay.const(85, "int32"), output_scale=relay.const(0.0235294, "float32"), output_zero_point=relay.const(128, "int32"), ), ) The issue manifested itself as [bt] (2) ./src/tvm/build/libtvm.so(tvm::relay::qnn::QnnBinaryBroadcastLayout(tvm::Attrs const&, tvm::runtime::Array<tvm::tir::Layout, void> const&, tvm::runtime::Array<tvm::tir::Layout, void> const&, tvm::runtime::Array<tvm::Type, void> const&)+0xa9) [0x7fadc080d949] [bt] (1) ./src/tvm/build/libtvm.so(tvm::runtime::Array<tvm::tir::Layout, void>::operator[](long) const+0xb6) [0x7fadc0382996] [bt] (0) ./src/tvm/build/libtvm.so(+0xb50c12) [0x7fadc037cc12] File "/workspace/include/tvm/runtime/container.h", line 681 IndexError: Check failed: 0 <= i && i < p->size_: indexing 1 on an array of size 1
trevor-m
pushed a commit
to neo-ai/tvm
that referenced
this pull request
Oct 19, 2020
An attempt to fix an issue which appeared when ConverLayout pass runs on quantized binary operations like qnn.add: def before(): x = relay.var("x", shape=(2, 2)) y = relay.var("y", shape=(1, 2)) return relay.Function( [x, y], relay.qnn.op.add( x, y, lhs_scale=relay.const(0.0156863, "float32"), lhs_zero_point=relay.const(127, "int32"), rhs_scale=relay.const(0.0117647, "float32"), rhs_zero_point=relay.const(85, "int32"), output_scale=relay.const(0.0235294, "float32"), output_zero_point=relay.const(128, "int32"), ), ) The issue manifested itself as [bt] (2) ./src/tvm/build/libtvm.so(tvm::relay::qnn::QnnBinaryBroadcastLayout(tvm::Attrs const&, tvm::runtime::Array<tvm::tir::Layout, void> const&, tvm::runtime::Array<tvm::tir::Layout, void> const&, tvm::runtime::Array<tvm::Type, void> const&)+0xa9) [0x7fadc080d949] [bt] (1) ./src/tvm/build/libtvm.so(tvm::runtime::Array<tvm::tir::Layout, void>::operator[](long) const+0xb6) [0x7fadc0382996] [bt] (0) ./src/tvm/build/libtvm.so(+0xb50c12) [0x7fadc037cc12] File "/workspace/include/tvm/runtime/container.h", line 681 IndexError: Check failed: 0 <= i && i < p->size_: indexing 1 on an array of size 1
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.
An attempt to fix an issue which appeared when ConverLayout pass
runs on quantized binary operations like qnn.add:
def before():
x = relay.var("x", shape=(2, 2))
y = relay.var("y", shape=(1, 2))
return relay.Function(
[x, y],
relay.qnn.op.add(
x,
y,
lhs_scale=relay.const(0.0156863, "float32"),
lhs_zero_point=relay.const(127, "int32"),
rhs_scale=relay.const(0.0117647, "float32"),
rhs_zero_point=relay.const(85, "int32"),
output_scale=relay.const(0.0235294, "float32"),
output_zero_point=relay.const(128, "int32"),
),
)
The issue manifested itself as
[bt] (2) ./src/tvm/build/libtvm.so(tvm::relay::qnn::QnnBinaryBroadcastLayout(tvm::Attrs const&, tvm::runtime::Array<tvm::tir::Layout, void> const&, tvm::runtime::Array<tvm::tir::Layout, void> const&, tvm::runtime::Array<tvm::Type, void> const&)+0xa9) [0x7fadc080d949]
[bt] (1) ./src/tvm/build/libtvm.so(tvm::runtime::Array<tvm::tir::Layout, void>::operator const+0xb6) [0x7fadc0382996]
[bt] (0) ./src/tvm/build/libtvm.so(+0xb50c12) [0x7fadc037cc12]
File "/workspace/include/tvm/runtime/container.h", line 681
IndexError: Check failed: 0 <= i && i < p->size_: indexing 1 on an array of size 1
Thanks for contributing to TVM! Please refer to guideline https://tvm.apache.org/docs/contribute/ for useful information and tips. After the pull request is submitted, please request code reviews from Reviewers by @ them in the pull request thread.