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

Fixes to parse DynamicQuantizeLinear #2896

Merged
merged 3 commits into from
Mar 19, 2024
Merged

Conversation

TedThemistokleous
Copy link
Collaborator

@TedThemistokleous TedThemistokleous commented Mar 18, 2024

  • Remove preemptive fold at beginning of parse for inputs
  • Fix error with sub/division used for zero point
  • add proper reduce_max/min to get scales

Observed 20% increase in runs when using these likely due to removal of flatten.

Separated out from #2826 as we're not observing mismatches off 6.1 and develop anymore for uint8/int8 when dynamicquantizelinear is used

- Remove preemptive fold at beginning of parse for inputs
- Fix error with sub/division used for zero point
- add proper reduce_max/min to get scales
@TedThemistokleous TedThemistokleous added bugfix Fixes a bug found in the code. high priority A PR with high priority for review and merging. labels Mar 18, 2024
@TedThemistokleous TedThemistokleous self-assigned this Mar 18, 2024
@TedThemistokleous TedThemistokleous linked an issue Mar 18, 2024 that may be closed by this pull request
@TedThemistokleous
Copy link
Collaborator Author

@pfultz2 not seeing much of a perf boost with this relative to develop if at all. Bigger perf boost is with the other changeset when we add in the pass.

@migraphx-bot
Copy link
Collaborator

Test Batch Rate new
6dc8ef
Rate old
21b71c
Diff Compare
torchvision-resnet50 64 2,858.98 2,861.58 -0.09%
torchvision-resnet50_fp16 64 6,593.89 6,598.71 -0.07%
torchvision-densenet121 32 2,093.84 2,086.95 0.33%
torchvision-densenet121_fp16 32 3,698.50 3,699.24 -0.02%
torchvision-inceptionv3 32 1,600.71 1,604.25 -0.22%
torchvision-inceptionv3_fp16 32 2,573.69 2,573.09 0.02%
cadene-inceptionv4 16 726.86 727.24 -0.05%
cadene-resnext64x4 16 682.69 682.78 -0.01%
slim-mobilenet 64 5,934.99 5,935.93 -0.02%
slim-nasnetalarge 64 153.89 153.98 -0.06%
slim-resnet50v2 64 2,662.44 2,661.75 0.03%
bert-mrpc-onnx 8 918.26 917.95 0.03%
bert-mrpc-tf 1 429.45 423.40 1.43%
pytorch-examples-wlang-gru 1 418.46 424.32 -1.38%
pytorch-examples-wlang-lstm 1 385.86 388.88 -0.78%
torchvision-resnet50_1 1 591.21 601.98 -1.79%
cadene-dpn92_1 1 391.80 393.38 -0.40%
cadene-resnext101_1 1 331.26 331.66 -0.12%
onnx-taau-downsample 1 305.36 304.26 0.36%
dlrm-criteoterabyte 1 28.78 28.76 0.06%
dlrm-criteoterabyte_fp16 1 49.59 49.62 -0.07%
agentmodel 1 7,637.84 7,583.11 0.72%
unet_fp16 2 57.57 57.49 0.13%
resnet50v1_fp16 1 893.90 897.05 -0.35%
resnet50v1_int8 1 822.35 822.69 -0.04%
bert_base_cased_fp16 64 1,055.26 1,056.04 -0.07%
bert_large_uncased_fp16 32 311.87 311.92 -0.02%
bert_large_fp16 1 159.29 159.14 0.09%
distilgpt2_fp16 16 1,859.50 1,857.60 0.10%
yolov5s 1 480.32 476.08 0.89%
tinyllama 1 32.84 32.87 -0.09%
vicuna-fastchat 1 159.72 158.65 0.67%
whisper-tiny-encoder 1 349.13 354.42 -1.49%
whisper-tiny-decoder 1 399.73 399.05 0.17%

This build is OK for merge ✅

@migraphx-bot
Copy link
Collaborator


     ✅ bert-mrpc-onnx: PASSED: MIGraphX meets tolerance

     ✅ bert-mrpc-tf: PASSED: MIGraphX meets tolerance

     ✅ pytorch-examples-wlang-gru: PASSED: MIGraphX meets tolerance

     ✅ pytorch-examples-wlang-lstm: PASSED: MIGraphX meets tolerance

     ✅ torchvision-resnet50_1: PASSED: MIGraphX meets tolerance

     ✅ cadene-dpn92_1: PASSED: MIGraphX meets tolerance

     ✅ cadene-resnext101_1: PASSED: MIGraphX meets tolerance

     ✅ dlrm-criteoterabyte: PASSED: MIGraphX meets tolerance

     ✅ agentmodel: PASSED: MIGraphX meets tolerance

     ✅ unet: PASSED: MIGraphX meets tolerance

     ✅ resnet50v1: PASSED: MIGraphX meets tolerance

     ✅ bert_base_cased_fp16: PASSED: MIGraphX meets tolerance

🔴bert_large_uncased_fp16: FAILED: MIGraphX is not within tolerance - check verbose output


     ✅ bert_large: PASSED: MIGraphX meets tolerance

     ✅ yolov5s: PASSED: MIGraphX meets tolerance

     ✅ tinyllama: PASSED: MIGraphX meets tolerance

     ✅ vicuna-fastchat: PASSED: MIGraphX meets tolerance

     ✅ whisper-tiny-encoder: PASSED: MIGraphX meets tolerance

     ✅ whisper-tiny-decoder: PASSED: MIGraphX meets tolerance

     ✅ distilgpt2_fp16: PASSED: MIGraphX meets tolerance

Copy link

codecov bot commented Mar 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.84%. Comparing base (21b71c6) to head (6dc8ef1).
Report is 3 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #2896   +/-   ##
========================================
  Coverage    91.84%   91.84%           
========================================
  Files          478      478           
  Lines        18179    18181    +2     
========================================
+ Hits         16696    16698    +2     
  Misses        1483     1483           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@causten causten merged commit de07563 into develop Mar 19, 2024
48 checks passed
@causten causten deleted the fix_parse_dynamicquantizelinear branch March 19, 2024 14:29
causten pushed a commit that referenced this pull request Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Fixes a bug found in the code. high priority A PR with high priority for review and merging.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable ORT accuracy tests to verify int8
5 participants