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

find_splits bugfix #3244

Merged
merged 6 commits into from
Jul 9, 2024
Merged

find_splits bugfix #3244

merged 6 commits into from
Jul 9, 2024

Conversation

shivadbhavsar
Copy link
Contributor

@shivadbhavsar shivadbhavsar commented Jul 3, 2024

Solves #3218

Given a set of ops:
input: {2, 4, 4} -> slc1 {2,2,4}, slc2 {2,2,4} -> add(c1, slc1), add(c2, slc2)

Current logic assumes that the slices are always at the same input location in the binary op. This PR handles the case when graph has something like the following instead:
input: {2, 4, 4} -> slc1 {2,2,4}, slc2 {2,2,4} -> add(slc1, c1), add(c2, slc2)

In this case add is a commutative op so this simplification can still be done, so we force all the slices to be at input 0. In the case of non commutative ops, the matcher will return without performing a simplification.

@shivadbhavsar shivadbhavsar added the bugfix Fixes a bug found in the code. label Jul 3, 2024
@shivadbhavsar shivadbhavsar self-assigned this Jul 3, 2024
@migraphx-bot
Copy link
Collaborator

migraphx-bot commented Jul 3, 2024

Test Batch Rate new
aad497
Rate old
cbaa5b
Diff Compare
torchvision-resnet50 64 1,749.80 1,741.54 0.47%
torchvision-resnet50_fp16 64 4,180.17 4,066.82 2.79%
torchvision-densenet121 32 1,465.84 1,461.16 0.32%
torchvision-densenet121_fp16 32 2,548.89 2,522.45 1.05%
torchvision-inceptionv3 32 888.56 885.32 0.37%
torchvision-inceptionv3_fp16 32 1,492.13 1,478.16 0.95%
cadene-inceptionv4 16 411.80 410.28 0.37%
cadene-resnext64x4 16 419.31 417.37 0.46%
slim-mobilenet 64 4,012.59 3,986.47 0.66%
slim-nasnetalarge 64 100.98 100.58 0.40%
slim-resnet50v2 64 1,679.81 1,671.88 0.47%
bert-mrpc-onnx 8 616.53 612.70 0.63%
bert-mrpc-tf 1 275.12 277.15 -0.73%
pytorch-examples-wlang-gru 1 364.21 321.14 13.41% 🔆
pytorch-examples-wlang-lstm 1 294.68 294.00 0.23%
torchvision-resnet50_1 1 471.15 473.62 -0.52%
cadene-dpn92_1 1 246.88 246.57 0.13%
cadene-resnext101_1 1 204.30 198.25 3.05% 🔆
onnx-taau-downsample 1 206.13 205.44 0.33%
dlrm-criteoterabyte 1 22.89 22.82 0.28%
dlrm-criteoterabyte_fp16 1 43.84 42.59 2.94%
agentmodel 1 6,200.51 6,279.79 -1.26%
unet_fp16 2 34.29 34.25 0.12%
resnet50v1_fp16 1 583.96 585.19 -0.21%
resnet50v1_int8 1 567.85 571.79 -0.69%
bert_base_cased_fp16 64 646.65 642.42 0.66%
bert_large_uncased_fp16 32 198.85 197.79 0.53%
bert_large_fp16 1 116.81 116.84 -0.03%
distilgpt2_fp16 16 1,211.08 1,205.29 0.48%
yolov5s 1 301.66 299.73 0.64%
tinyllama 1 23.31 23.22 0.37%
vicuna-fastchat 1 133.74 132.49 0.94%
whisper-tiny-encoder 1 243.77 243.14 0.26%
whisper-tiny-decoder 1 256.00 255.32 0.27%

Check results before 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

@shivadbhavsar shivadbhavsar changed the title inital bugfix in find_splits find_splits bugfix Jul 4, 2024
@shivadbhavsar shivadbhavsar linked an issue Jul 4, 2024 that may be closed by this pull request
@shivadbhavsar shivadbhavsar marked this pull request as ready for review July 4, 2024 00:56
@shivadbhavsar shivadbhavsar requested a review from causten as a code owner July 4, 2024 00:56
Copy link

codecov bot commented Jul 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.21%. Comparing base (88048b8) to head (96a4469).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3244      +/-   ##
===========================================
+ Coverage    92.20%   92.21%   +0.01%     
===========================================
  Files          493      493              
  Lines        19700    19725      +25     
===========================================
+ Hits         18164    18190      +26     
+ Misses        1536     1535       -1     

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

@causten causten merged commit fbb3de7 into develop Jul 9, 2024
34 of 39 checks passed
@causten causten deleted the find_splits_fix branch July 9, 2024 16:12
TedThemistokleous pushed a commit that referenced this pull request Aug 21, 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug in find_splits pass
5 participants