This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
fix dot(csr.T, dns)=dns can't be called on cpu and gpu #11087
Merged
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
This PR is to fix a bug that cause the implement code of dot(csr.T, dns)=dns can't be called on CPU and GPU. This is 10 times faster than before when test dot(csr.T, dns)=dns with density=0.0001.
The reason for this bug is the function of DotForwardInferStorageType in dot-ink.h haven't map this situation that input stype=[csr, default], output stype=[default] and transpose_a=True to the implement of dot(csr.T, dns)=dns
Details
The following code can reproduce this bug.
Here is the log info. It tells the storage types of dot(csr.T, dns)=dns would fallback, and then the actually running code is dot(dns,dns)=dns
speed up after fixing the bug
The benchmark script is here https://github.com/XiaotaoChen/incubator-mxnet/blob/Mytest/example/sparse/temp_test/testBug.py
@pengzhao-intel @TaoLv