-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Faster sparse_dense on GPUs #6580
Conversation
This new sparse_dense requires a padded matrix, so a new op `sparse_dense_padded` has been added. AlterOpLayout should transform `sparse_dense` to `sparse_dense_padded` when possible on the gpu.
74cf118
to
b563b1c
Compare
@tkonolige : Thanks for the PR! The data looks quite impressive 👍 |
@ANSHUMAN87 Right now TVM does not do any testing for performance regressions. The hard part in setting up performance testing is that is varies from run to run and machine to machine. |
@tkonolige : I understand your concern clearly. However it was just a thought. Even if run to run or machine to machine difference, the relative reference would be same. But may be we don't have to do as part of this PR :) |
Have you considered your syntax errors? |
@vinx13 @antinucleon @Laurawly @jwfromm @ajtulloch I think this is ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @tkonolige !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@tkonolige @tqchen This commits fails in the master branch. see the CI: https://github.com/apache/incubator-tvm/commits/master It introduces a flaky test that blocks two of my PRs. |
#6658 has resolved the issue i think. |
@merrymercy I think that was the diagnostics |
* Faster sparse_dense on GPUs. This new sparse_dense requires a padded matrix, so a new op `sparse_dense_padded` has been added. AlterOpLayout should transform `sparse_dense` to `sparse_dense_padded` when possible on the gpu. * formatting * more formatting * Check that alteroplayout is definedbefore using it * check if FTVMAlterOpLayout exists before using it * formatting * restore message passing * Fix sparse_dense and sparse_dense_padded docs * Fix old sparse_dense, autotvm and sparse_dense dont play well together * Remove unused imports * clarify warp count in cuda_transpose * Document multidimensional access * Warn users not to use sparse_dense_padded * rename nn.sparse_dense_padded to nn.internal.sparse_dense_padded
* Faster sparse_dense on GPUs. This new sparse_dense requires a padded matrix, so a new op `sparse_dense_padded` has been added. AlterOpLayout should transform `sparse_dense` to `sparse_dense_padded` when possible on the gpu. * formatting * more formatting * Check that alteroplayout is definedbefore using it * check if FTVMAlterOpLayout exists before using it * formatting * restore message passing * Fix sparse_dense and sparse_dense_padded docs * Fix old sparse_dense, autotvm and sparse_dense dont play well together * Remove unused imports * clarify warp count in cuda_transpose * Document multidimensional access * Warn users not to use sparse_dense_padded * rename nn.sparse_dense_padded to nn.internal.sparse_dense_padded
* Faster sparse_dense on GPUs. This new sparse_dense requires a padded matrix, so a new op `sparse_dense_padded` has been added. AlterOpLayout should transform `sparse_dense` to `sparse_dense_padded` when possible on the gpu. * formatting * more formatting * Check that alteroplayout is definedbefore using it * check if FTVMAlterOpLayout exists before using it * formatting * restore message passing * Fix sparse_dense and sparse_dense_padded docs * Fix old sparse_dense, autotvm and sparse_dense dont play well together * Remove unused imports * clarify warp count in cuda_transpose * Document multidimensional access * Warn users not to use sparse_dense_padded * rename nn.sparse_dense_padded to nn.internal.sparse_dense_padded
* Faster sparse_dense on GPUs. This new sparse_dense requires a padded matrix, so a new op `sparse_dense_padded` has been added. AlterOpLayout should transform `sparse_dense` to `sparse_dense_padded` when possible on the gpu. * formatting * more formatting * Check that alteroplayout is definedbefore using it * check if FTVMAlterOpLayout exists before using it * formatting * restore message passing * Fix sparse_dense and sparse_dense_padded docs * Fix old sparse_dense, autotvm and sparse_dense dont play well together * Remove unused imports * clarify warp count in cuda_transpose * Document multidimensional access * Warn users not to use sparse_dense_padded * rename nn.sparse_dense_padded to nn.internal.sparse_dense_padded
* Faster sparse_dense on GPUs. This new sparse_dense requires a padded matrix, so a new op `sparse_dense_padded` has been added. AlterOpLayout should transform `sparse_dense` to `sparse_dense_padded` when possible on the gpu. * formatting * more formatting * Check that alteroplayout is definedbefore using it * check if FTVMAlterOpLayout exists before using it * formatting * restore message passing * Fix sparse_dense and sparse_dense_padded docs * Fix old sparse_dense, autotvm and sparse_dense dont play well together * Remove unused imports * clarify warp count in cuda_transpose * Document multidimensional access * Warn users not to use sparse_dense_padded * rename nn.sparse_dense_padded to nn.internal.sparse_dense_padded
* Faster sparse_dense on GPUs. This new sparse_dense requires a padded matrix, so a new op `sparse_dense_padded` has been added. AlterOpLayout should transform `sparse_dense` to `sparse_dense_padded` when possible on the gpu. * formatting * more formatting * Check that alteroplayout is definedbefore using it * check if FTVMAlterOpLayout exists before using it * formatting * restore message passing * Fix sparse_dense and sparse_dense_padded docs * Fix old sparse_dense, autotvm and sparse_dense dont play well together * Remove unused imports * clarify warp count in cuda_transpose * Document multidimensional access * Warn users not to use sparse_dense_padded * rename nn.sparse_dense_padded to nn.internal.sparse_dense_padded
I've written a faster sparse_dense for GPUs using tir. This sparse_dense requires a padded matrix, so I've added a new op sparse_dense_padded. AlterOpLayout should transform sparse_dense to sparse_dense_padded when using a gpu.
This new sparse_dense improves prunebert performance from 155.41ms mean to 7.75ms mean. In general, this implementation is faster than cublas dense on matrices with density < 0.05 and is often faster than cusparse for machine learning workloads.