Use MlasComputeSoftmax in traditional ML ops#3892
Merged
skottmckay merged 4 commits intomasterfrom May 11, 2020
Merged
Conversation
pranavsharma
approved these changes
May 11, 2020
stevenlix
pushed a commit
that referenced
this pull request
May 12, 2020
* Use MlasSoftmax in ML ops * Refine when mlas is used based on perf testing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Use new MlasComputeSoftmax in traditional ML ops where possible.
Motivation and Context
Improve performance.
Performance testing
Testing of a range of batch sizes selected based on a) the total work values where the MLAS implementation is selected and b) roughly 32K, 64K and 128K amounts of work beyond that. Test was using LinearRegressor where Softmax is applied as a post transform, so it's only one part of the work done.
The input to softmax as a post transform in LinearRegressor is n * num targets (i.e. num targets is the number of items in each batch). The first row when batch size is less than 8 is the non-mlas version. When batch size is 8 or larger we always pick the mlas version. Average times are in nanoseconds.
3 runs for master and new of 2 seconds of execution time each. Per-run output is average time per execution in 2 second period. Final row is avg master/avg new code across runs, so 2 == 2x faster. Linux results were similar.