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

Fixes bug in sspaddmm (#45113) #45963

Closed
wants to merge 8 commits into from

Conversation

vfdev-5
Copy link
Collaborator

@vfdev-5 vfdev-5 commented Oct 7, 2020

Fixes #45113

Description:

  • Fixed bug in sspaddmm by calling contiguous on indices.
  • Added tests

We have to make indices contiguous as we use indices.data_ptr in _to_csr which assumes row-contiguous storage:

LongTensor indices = sparse._indices();
Tensor values = sparse._values();
LongTensor csr = _to_csr(indices.data_ptr<int64_t>(), dim_i, nnz);

Part 1 of fixing this is probably to document sspaddmm. Part 2 may be to rewrite it using other ops. (#45113 (comment))

- Fixed bug in sspaddmm by calling contiguous on indices
test/test_sparse.py Outdated Show resolved Hide resolved
test/test_sparse.py Show resolved Hide resolved
test/test_sparse.py Show resolved Hide resolved
test/test_sparse.py Outdated Show resolved Hide resolved
@ngimel ngimel added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Oct 8, 2020
@vfdev-5
Copy link
Collaborator Author

vfdev-5 commented Oct 8, 2020

@ngimel thanks for the review. I rework the tests as you suggested.

@codecov
Copy link

codecov bot commented Oct 9, 2020

Codecov Report

Merging #45963 into master will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #45963   +/-   ##
=======================================
  Coverage   68.20%   68.20%           
=======================================
  Files         410      410           
  Lines       53453    53453           
=======================================
+ Hits        36457    36458    +1     
+ Misses      16996    16995    -1     
Impacted Files Coverage Δ
torch/testing/_internal/expecttest.py 78.57% <0.00%> (+1.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3883cdb...ba5fdfc. Read the comment docs.

Copy link
Collaborator

@pearu pearu left a comment

Choose a reason for hiding this comment

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

LGTM

test/test_sparse.py Outdated Show resolved Hide resolved
@dr-ci
Copy link

dr-ci bot commented Oct 11, 2020

💊 CI failures summary and remediations

As of commit ba5fdfc (more details on the Dr. CI page):


💚 💚 Looks good so far! There are no failures yet. 💚 💚


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group.

See how this bot performed.

This comment has been revised 3 times.

Copy link
Collaborator

@ngimel ngimel left a comment

Choose a reason for hiding this comment

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

Lint failure is real, otherwise looks good.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@ngimel has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@ngimel merged this pull request in dc7cd97.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Merged open source triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sspaddmm yields inconsistent results
5 participants