Skip to content

[QNN] Fix per-channel broadcast with invalid axes#10936

Merged
masahi merged 2 commits into
apache:mainfrom
masahi:qnn-broadcast-fix
Apr 8, 2022
Merged

[QNN] Fix per-channel broadcast with invalid axes#10936
masahi merged 2 commits into
apache:mainfrom
masahi:qnn-broadcast-fix

Conversation

@masahi

@masahi masahi commented Apr 8, 2022

Copy link
Copy Markdown
Member

Per-channel quantization for broadcast ops was supported in #10718, but apparently an invalid BroadcastAttrs can be created, where the channel axis can be set to 1 even though the input shape is of rank 1. I've hit this error when working on the quantized BERT model with the latest main. The error can be reproduced by running the test (disabled on CI since it is slow)

This PR adds a workaround for cases like that, but I have a feeling that something needs to be fixed on the FQ2I side, where those invalid axes are created.

@sfvaroglu @AndrewZhaoLuo @mbrookhart @anwang2009

@masahi masahi changed the title [QNN] Fix broadcast for invalid axis [QNN] Fix per-channel broadcast with invalid axes Apr 8, 2022

@junrushao junrushao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for taking swift actions!!

@masahi masahi merged commit 8ca9b89 into apache:main Apr 8, 2022
pfk-beta pushed a commit to pfk-beta/tvm that referenced this pull request Apr 11, 2022
* [QNN] Fix broadcast for invalid axis

* broadcast -> channel
mehrdadh pushed a commit to mehrdadh/tvm that referenced this pull request Apr 11, 2022
* [QNN] Fix broadcast for invalid axis

* broadcast -> channel
altanh pushed a commit to altanh/tvm that referenced this pull request Apr 28, 2022
* [QNN] Fix broadcast for invalid axis

* broadcast -> channel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants