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

SparseFillEmptyRows Op #7442

Merged
merged 32 commits into from
Feb 17, 2021
Merged

SparseFillEmptyRows Op #7442

merged 32 commits into from
Feb 17, 2021

Conversation

codeislife99
Copy link
Contributor

@codeislife99 codeislife99 commented Feb 11, 2021

This PR adds SparseFillEmptyRows Op to relay and corresponding frontend code for TF framework.
TF Op Docs. This Op is only supported for CPU targets now which is what the customer models are running on. So GPU implementation is not a part of this PR and can be added later if needed.

@codeislife99 codeislife99 marked this pull request as draft February 11, 2021 02:46
@codeislife99
Copy link
Contributor Author

codeislife99 commented Feb 13, 2021

@mbrookhart @tkonolige Please review this Op. it has been completely rewritten to address the many issues in the previous PR #7126 and has also been tested with the customer model.

@codeislife99 codeislife99 marked this pull request as ready for review February 13, 2021 02:21
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.

Hi Ricky, thanks for submitting this. I've left some comments for you to address. Also, could you add more documentation and comments. Especially to the compute and shape functions. They are quite involved, so comments would help future readers of the code to understand them.

python/tvm/relay/op/_transform.py Outdated Show resolved Hide resolved
python/tvm/relay/op/transform.py Show resolved Hide resolved
python/tvm/topi/sparse_fill_empty_rows.py Show resolved Hide resolved
python/tvm/topi/sparse_fill_empty_rows.py Show resolved Hide resolved
python/tvm/topi/sparse_fill_empty_rows.py Outdated Show resolved Hide resolved
src/relay/op/tensor/transform.cc Show resolved Hide resolved
src/relay/op/tensor/transform.cc Show resolved Hide resolved
src/relay/op/tensor/transform.cc Show resolved Hide resolved
@codeislife99
Copy link
Contributor Author

@tkonolige I have addressed all your comments and added the relevant documentation/changes wherever you asked. Please re-review.

Copy link
Contributor

@mbrookhart mbrookhart left a comment

Choose a reason for hiding this comment

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

I still wouldn't say I fully understand the op, so I'm going to assume your tests cover what you need them to :D

With that caveat, the overall structure looks good to me, good work. No change requests on my side, I'll approve/merge if/when @tkonolige does.

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.

Here is some more feedback.

Also, could you add a test that uses a different dtype besides int64. I think it would be good to test int32 at least.

python/tvm/relay/op/transform.py Outdated Show resolved Hide resolved
python/tvm/relay/op/transform.py Outdated Show resolved Hide resolved
python/tvm/relay/op/transform.py Outdated Show resolved Hide resolved
python/tvm/relay/op/transform.py Show resolved Hide resolved
python/tvm/topi/sparse_fill_empty_rows.py Outdated Show resolved Hide resolved
python/tvm/topi/sparse_fill_empty_rows.py Show resolved Hide resolved
src/relay/op/tensor/transform.cc Show resolved Hide resolved
src/relay/op/tensor/transform.cc Outdated Show resolved Hide resolved
src/relay/op/tensor/transform.cc Outdated Show resolved Hide resolved
@codeislife99
Copy link
Contributor Author

@tkonolige . Addressed all your comments and added test cases for int32. Please re-review.

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 now. Thanks @codeislife99!

@masahi masahi merged commit 173f3fc into apache:main Feb 17, 2021
@codeislife99 codeislife99 deleted the SparseFillEmptyRows branch February 17, 2021 09:40
Lokiiiiii pushed a commit to Lokiiiiii/tvm that referenced this pull request Mar 2, 2021
* Initial Commit

* Fix formats

* Remove comments

* Black

* THreeops

* Add Frontend Code

* Add Default Value to feed dict

* Add Frontend Code

* New test Cases and new code to handle them

* Add Python Implementation'
'

* Remove stuff

* Remove unused imports

* Pylint

* Pylint

* PyLint Shape Func

* Make tests cpu only

* Add unsorted tests

* Add frontend code

* Row Major Sorting Only Test

* Handle Dynamic Shapes

* Add dynamic input shapes

* Dynamic Shape Tests

* Add documentation

* Dtypes

* PR Comments

* Added comments and changed naming

* Add comments

* Comments to Shape Func

* Documentation

* PR Changes

* PR Comments

* Resolve input and output dtype compat

Co-authored-by: Ubuntu <ubuntu@ip-172-31-42-251.us-east-2.compute.internal>
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request Mar 2, 2021
* Initial Commit

* Fix formats

* Remove comments

* Black

* THreeops

* Add Frontend Code

* Add Default Value to feed dict

* Add Frontend Code

* New test Cases and new code to handle them

* Add Python Implementation'
'

* Remove stuff

* Remove unused imports

* Pylint

* Pylint

* PyLint Shape Func

* Make tests cpu only

* Add unsorted tests

* Add frontend code

* Row Major Sorting Only Test

* Handle Dynamic Shapes

* Add dynamic input shapes

* Dynamic Shape Tests

* Add documentation

* Dtypes

* PR Comments

* Added comments and changed naming

* Add comments

* Comments to Shape Func

* Documentation

* PR Changes

* PR Comments

* Resolve input and output dtype compat

Co-authored-by: Ubuntu <ubuntu@ip-172-31-42-251.us-east-2.compute.internal>
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