ZhennanQin opened a new pull request #14785: Improve cached_op performance for 
static mode
URL: https://github.com/apache/incubator-mxnet/pull/14785
 
 
   ## Description ##
   
   @pengzhao-intel @TaoLv @xinyu-intel @junrushao1994 
   When gluon model hybridize with `static_shape=True, static_alloc=True`, 
cached_op with static mode will be used. For this situation, we should try to 
cache operator state for better performance. This PR is to enable this feature 
to speed up gluon inference speed, especially for small batch sizes.
   
   Below data is collected on SKX-8180 28 cores, **SKX GLUON INT8 OPT** shows 
the performance change from this PR, base is **SKX GLUON INT8**. 
   
   GLUON ResNet50 V1(10 cores for rec decoder) | SKX GLUON FP32 | SKX GLUON 
INT8 | SKX GLUON INT8 OPT
   -- | -- | -- | --
   Throughput(img/sec, bs=1) | 64.6 | 11.89 | 144.53
   Throughput(img/sec, bs=2) | 79.74 | 23.1 | 226.04
   Throughput(img/sec, bs=4) | 111.9 | 43.45 | 302.4
   Throughput(img/sec, bs=8) | 134.86 | 78.72 | 347.6
   Throughput(img/sec, bs=16) | 143.52 | 129.09 | 362.93
   Throughput(img/sec, bs=32) | 146.63 | 197.63 | 381.2
   Throughput(img/sec, bs=64) | 153.89 | 261.33 | 380.79
   Throughput(img/sec, bs=128) | 156.82 | 326.23 | 408.38
   Accuracy(5000 imgs) | 77.21%93.55% | 76.86%/93.46 | 76.86%/93.46
   
   GLUON MobileNet1.0(10 cores for rec decoder) | SKX GLUON FP32 | SKX GLUON 
INT8 | SKX GLUON INT8 OPT
   -- | -- | -- | --
   Throughput(img/sec, bs=1) | 166.23 | 38.77 | 281.28
   Throughput(img/sec, bs=2) | 238.79 | 75.81 | 518.52
   Throughput(img/sec, bs=4) | 333.2 | 143.83 | 987.63
   Throughput(img/sec, bs=8) | 397.46 | 262.47 | 1245.85
   Throughput(img/sec, bs=16) | 425.35 | 425.63 | 1332.25
   Throughput(img/sec, bs=32) | 451.89 | 653.8 | 1474.7
   Throughput(img/sec, bs=64) | 471.77 | 897.99 | 1528.63
   Throughput(img/sec, bs=128) | 468.67 | 1125.75 | 1557.16
   Accuracy(5000 imgs) | 73.28%/91.22% | 72.85%/90.99% | 72.85%/90.99%
   
   
   ## Checklist ##
   ### Essentials ###
   Please feel free to remove inapplicable items for your PR.
   - [ ] The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to 
the relevant [JIRA issue](https://issues.apache.org/jira/projects/MXNET/issues) 
created (except PRs with tiny changes)
   - [ ] Changes are complete (i.e. I finished coding on this PR)
   - [ ] All changes have test coverage:
   - Unit tests are added for small changes to verify correctness (e.g. adding 
a new operator)
   - Nightly tests are added for complicated/long-running ones (e.g. changing 
distributed kvstore)
   - Build tests will be added for build configuration changes (e.g. adding a 
new build option with NCCL)
   - [ ] Code is well-documented: 
   - For user-facing API changes, API doc string has been updated. 
   - For new C++ functions in header files, their functionalities and arguments 
are documented. 
   - For new examples, README.md is added to explain the what the example does, 
the source of the dataset, expected performance on test set and reference to 
the original paper if applicable
   - Check the API doc at 
http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
   - [ ] To the my best knowledge, examples are either not affected by this 
change, or have been fixed to be compatible with this change
   
   ### Changes ###
   - [ ] Feature1, tests, (and when applicable, API doc)
   - [ ] Feature2, tests, (and when applicable, API doc)
   
   ## Comments ##
   - If this change is a backward incompatible change, why must this change be 
made.
   - Interesting edge cases to note here
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to