Skip to content

Fixes bug in sspaddmm (#45113) - #45963

Closed
vfdev-5 wants to merge 8 commits into
pytorch:masterfrom
Quansight:vfdev-5/issue-45113
Closed

vfdev-5 wants to merge 8 commits into
pytorch:masterfrom
Quansight:vfdev-5/issue-45113

Conversation

@vfdev-5

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

Copy link
Copy Markdown
Contributor

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))

@vfdev-5
vfdev-5 requested a review from pearu October 7, 2020 09:15
- Fixed bug in sspaddmm by calling contiguous on indices
@vfdev-5
vfdev-5 force-pushed the vfdev-5/issue-45113 branch from 6b65d01 to bd1f4f8 Compare October 7, 2020 09:18
Comment thread test/test_sparse.py Resolved
Comment thread test/test_sparse.py Resolved
Comment thread test/test_sparse.py Resolved
Comment thread test/test_sparse.py 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

vfdev-5 commented Oct 8, 2020

Copy link
Copy Markdown
Contributor Author

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

@codecov

codecov Bot commented Oct 9, 2020 •

Copy link
Copy Markdown

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.

@pearu pearu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

Comment thread test/test_sparse.py Resolved
@dr-ci

dr-ci Bot commented Oct 11, 2020 •

Copy link
Copy Markdown

💊 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.

@ngimel ngimel left a comment

Copy link
Copy Markdown
Collaborator

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.

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

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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