Skip to content
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

[Torch, QNN] Add missing upcast to uint8 avg_pool conversion #5089

Merged
merged 2 commits into from Mar 18, 2020

Conversation

masahi
Copy link
Member

@masahi masahi commented Mar 18, 2020

Previously we were missing an upcast to int32 for avg_pool2d, fixed now. It seems avg_pool is used in inception v3, but I don't know why our accuracy is not affected by the missing upcast.

Beside the accuracy issue, without upcast it also causes a mysterious typing problem for inception v3 when compiling for AVX512. For AVX2 and other, there have been no issue.

Even with the upcast, the raw output from the new test case, quantize -> avgpool -> dequantize, has some gap with torch output. This depends on how Torch implements uint8 avg pool (probably with fp32 piggy back).

max abs diff: 0.003921509
mean abs diff: 0.0014691062 
The ratio of identical output: 0.6253720238095238

cc @anijain2305

@anijain2305 anijain2305 merged commit b64a843 into apache:master Mar 18, 2020
@anijain2305
Copy link
Contributor

Thanks @masahi This is merged

trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Apr 16, 2020
…5089)

* add missing upcast to avgpool

* add avg pool test
zhiics pushed a commit to neo-ai/tvm that referenced this pull request Apr 17, 2020
…5089)

* add missing upcast to avgpool

* add avg pool test
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.

None yet

2 participants