Skip to content

MLAS: tune softmax kernels for partial vectors#3906

Merged
tracysh merged 2 commits intomasterfrom
tracysh/softmax_tune
May 12, 2020
Merged

MLAS: tune softmax kernels for partial vectors#3906
tracysh merged 2 commits intomasterfrom
tracysh/softmax_tune

Conversation

@tracysh
Copy link
Contributor

@tracysh tracysh commented May 11, 2020

Description: The code paths to handle partial vectors in the softmax kernels was too slow: speed it up.

Motivation and Context
This addresses some of the slowness indicated in #3892. The paths to handle partial 256b vectors used the AVX instructions to load/store data, but these can be slower than handling the data an element at a time instead. In some microbenchmarks of MlasComputeSoftmax with D < 8, the updated sequences can be twice as fast.

There is additional performance to be had from de-virtualizing the softmax kernel, but that will be done in a different PR.

Also, clean up pooling.cpp to use the new helpers to do a vector wide max/sum reduction. The code generated by this is the same.

@tracysh tracysh requested a review from a team as a code owner May 11, 2020 21:50
Copy link
Contributor

@skottmckay skottmckay left a comment

Choose a reason for hiding this comment

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

:shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants