Skip to content
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

[Relay][Frontend] SparseTensorDenseMatMul support for Tensorflow #6685

Merged
merged 4 commits into from
Nov 4, 2020

Conversation

ANSHUMAN87
Copy link
Contributor

SparseTensorDenseMatMul support added for Tensorflow frontend.

@ANSHUMAN87
Copy link
Contributor Author

@FrozenGene , @siju-samuel , @kevinthesun : please help review. Thanks!

@ANSHUMAN87
Copy link
Contributor Author

Looks like Tensorflow version in CI is older, may be we need to bump it!!!

@jroesch
Copy link
Member

jroesch commented Oct 16, 2020

cc @tkonolige

python/tvm/relay/frontend/tensorflow.py Outdated Show resolved Hide resolved
python/tvm/relay/frontend/tensorflow.py Outdated Show resolved Hide resolved
tests/python/frontend/tensorflow/test_forward.py Outdated Show resolved Hide resolved
tests/python/frontend/tensorflow/test_forward.py Outdated Show resolved Hide resolved

# Create Numpy sparse Tensor(CSR)
weight_sp = sparse.csr_matrix(
(values_tensor, (rows, cols)), shape=tuple(dense_shape_tensor.tolist())
Copy link
Contributor

Choose a reason for hiding this comment

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

If you swap rows and columns here you can avoid the sparse transpose below. This probably isn't much of a performance hit except for large matrices.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I totally agree with your comment, but as this PR is just an initial PR, i feel lets keep the code as it is, it provides better readability in terms of steps involved, later on, once all features are merged, we can work together to optimize it 🙂
Please let me know, in case you think otherwise!

@ANSHUMAN87
Copy link
Contributor Author

Gentle ping @tkonolige , @siju-samuel , Thanks!

Copy link
Contributor

@tkonolige tkonolige left a comment

Choose a reason for hiding this comment

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

Look pretty good to me. Just one change I think should be done.

What is the current review policy on TODO's in the code? Are they supposed to be tagged with a username?

python/tvm/relay/frontend/tensorflow.py Outdated Show resolved Hide resolved
python/tvm/topi/cuda/sparse.py Show resolved Hide resolved
@ANSHUMAN87
Copy link
Contributor Author

Look pretty good to me. Just one change I think should be done.

What is the current review policy on TODO's in the code? Are they supposed to be tagged with a username?

I am already working on it. Will tag with my id here!

@ANSHUMAN87
Copy link
Contributor Author

@tkonolige : I think all your comments are addressed now! Please check and approve. Thanks!

Copy link
Contributor

@tkonolige tkonolige left a comment

Choose a reason for hiding this comment

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

Looks good to me. (I'm not an official reviewer, so you'll need someone else to approve it).

Copy link
Member

@siju-samuel siju-samuel left a comment

Choose a reason for hiding this comment

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

LGTM.

@siju-samuel siju-samuel merged commit 0c02780 into apache:main Nov 4, 2020
@siju-samuel
Copy link
Member

Thanks @ANSHUMAN87 @tkonolige This PR is merged.
@ANSHUMAN87 please follow up the TODOs..

trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Dec 2, 2020
…che#6685)

* [Relay][Frontend] SparseTensorDenseMatMul support for Tensorflow

* Lint error resolved

* [1] Review comments handled

* [2] Review comments handled
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Dec 4, 2020
…che#6685)

* [Relay][Frontend] SparseTensorDenseMatMul support for Tensorflow

* Lint error resolved

* [1] Review comments handled

* [2] Review comments handled
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request Dec 4, 2020
…che#6685)

* [Relay][Frontend] SparseTensorDenseMatMul support for Tensorflow

* Lint error resolved

* [1] Review comments handled

* [2] Review comments handled
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.

4 participants