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

create simplify_dyn_ops pass and add variable slice optimization #2161

Merged
merged 16 commits into from
Sep 24, 2023

Conversation

CharlieL7
Copy link
Collaborator

  • New compiler pass that simplifies dynamic shapes related operators to their static versions if possible
  • Will normally be used after a split_single_dyn_dim pass

@CharlieL7 CharlieL7 self-assigned this Sep 7, 2023
@migraphx-bot
Copy link
Collaborator

migraphx-bot commented Sep 7, 2023

Test Batch Rate new
37f878
Rate old
c2e01b
Diff Compare
torchvision-resnet50 64 2,284.07 2,284.87 -0.04%
torchvision-resnet50_fp16 64 5,369.26 5,357.62 0.22%
torchvision-densenet121 32 1,828.67 1,829.81 -0.06%
torchvision-densenet121_fp16 32 3,392.74 3,378.73 0.41%
torchvision-inceptionv3 32 1,338.84 1,335.78 0.23%
torchvision-inceptionv3_fp16 32 2,584.27 2,585.25 -0.04%
cadene-inceptionv4 16 682.32 679.39 0.43%
cadene-resnext64x4 16 590.32 590.19 0.02%
slim-mobilenet 64 7,211.76 7,216.76 -0.07%
slim-nasnetalarge 64 237.11 236.57 0.23%
slim-resnet50v2 64 2,530.75 2,530.71 0.00%
bert-mrpc-onnx 8 721.51 721.25 0.04%
bert-mrpc-tf 1 388.44 391.28 -0.73%
pytorch-examples-wlang-gru 1 304.83 303.90 0.31%
pytorch-examples-wlang-lstm 1 315.39 311.77 1.16%
torchvision-resnet50_1 1 561.17 555.70 0.98%
torchvision-inceptionv3_1 1 305.77 306.97 -0.39%
cadene-dpn92_1 1 346.26 351.70 -1.55%
cadene-resnext101_1 1 221.04 220.52 0.24%
slim-vgg16_1 1 224.28 224.37 -0.04%
slim-mobilenet_1 1 1,488.38 1,468.80 1.33%
slim-inceptionv4_1 1 220.24 221.26 -0.46%
onnx-taau-downsample 1 322.84 322.42 0.13%
dlrm-criteoterabyte 1 21.70 21.67 0.13%
dlrm-criteoterabyte_fp16 1 40.53 40.54 -0.03%
agentmodel 1 5,767.54 5,779.11 -0.20%
unet_fp16 2 55.15 55.07 0.15%

This build is OK for merge ✅

@migraphx-bot
Copy link
Collaborator


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

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

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

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

    :white_check_mark:torchvision-resnet50_1: PASSED: MIGraphX meets tolerance

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


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


    :white_check_mark:cadene-resnext101_1: PASSED: MIGraphX meets tolerance

    :white_check_mark:slim-vgg16_1: PASSED: MIGraphX meets tolerance

    :white_check_mark:slim-mobilenet_1: PASSED: MIGraphX meets tolerance

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


    :white_check_mark:dlrm-criteoterabyte: PASSED: MIGraphX meets tolerance

    :white_check_mark:agentmodel: PASSED: MIGraphX meets tolerance

    :white_check_mark:unet: PASSED: MIGraphX meets tolerance

@codecov
Copy link

codecov bot commented Sep 8, 2023

Codecov Report

Merging #2161 (5a31122) into develop (800d19c) will increase coverage by 0.02%.
Report is 1 commits behind head on develop.
The diff coverage is 100.00%.

❗ Current head 5a31122 differs from pull request most recent head f79f412. Consider uploading reports for the commit f79f412 to get more accurate results

@@             Coverage Diff             @@
##           develop    #2161      +/-   ##
===========================================
+ Coverage    91.51%   91.53%   +0.02%     
===========================================
  Files          427      429       +2     
  Lines        15972    16011      +39     
===========================================
+ Hits         14616    14655      +39     
  Misses        1356     1356              
Files Changed Coverage Δ
src/split_single_dyn_dim.cpp 92.59% <ø> (-1.44%) ⬇️
src/include/migraphx/simplify_dyn_ops.hpp 100.00% <100.00%> (ø)
src/simplify_dyn_ops.cpp 100.00% <100.00%> (ø)

@CharlieL7 CharlieL7 marked this pull request as ready for review September 8, 2023 21:10
@TedThemistokleous TedThemistokleous added enhancement New feature or request roadmap Tasks to finish for a release labels Sep 14, 2023
@CharlieL7 CharlieL7 linked an issue Sep 14, 2023 that may be closed by this pull request
Copy link
Collaborator

@TedThemistokleous TedThemistokleous left a comment

Choose a reason for hiding this comment

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

ORT failure seems to be unrelated to your changes right now. Overall just answer some Q's I have

src/simplify_dyn_ops.cpp Outdated Show resolved Hide resolved
src/simplify_dyn_ops.cpp Outdated Show resolved Hide resolved
@causten causten merged commit c54167c into develop Sep 24, 2023
14 of 15 checks passed
@causten causten deleted the simplify_dyn_ops_slice branch September 24, 2023 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request roadmap Tasks to finish for a release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add/update simplify_dynamic_ops pass update for variable input slice
5 participants