Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Sparse int64 Large tensor support #16898

Merged
merged 14 commits into from
Jan 23, 2020
Merged

Conversation

ChaiBapchya
Copy link
Contributor

@ChaiBapchya ChaiBapchya commented Nov 25, 2019

Description

Adds support to Sparse tensor creation

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
  • Code is well-documented:
  • To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

Changes

  • src/c_api/c_api.cc
  • python/mxnet/ndarray/sparse.py
  • tests/nightly/test_large_array.py

Test

python -m nose tests/nightly/test_large_array.py:test_sparse_dot
.
----------------------------------------------------------------------
Ran 1 test in 3.688s

OK

@ChaiBapchya ChaiBapchya changed the title [WIP] Sparse int64 Large tensor support Sparse int64 Large tensor support Nov 28, 2019
include/mxnet/c_api.h Outdated Show resolved Hide resolved
include/mxnet/c_api.h Outdated Show resolved Hide resolved
@eric-haibin-lin
Copy link
Member

Is there a check list of what to change for int64 support in general?

Copy link
Contributor Author

@ChaiBapchya ChaiBapchya left a comment

Choose a reason for hiding this comment

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

@ChaiBapchya
Copy link
Contributor Author

@eric-haibin-lin while I don't think there is uniform guideline for int64 support across all ops. But in most cases, switching the datatype of all the variables holding "indices" from 32bit dtype to 64bit dtype solves the issue. One still has to test that to ensure it doesn't break the functionality and supports int64.

@apeforest @access2rohit any inputs?

@access2rohit
Copy link
Contributor

@eric-haibin-lin while I don't think there is uniform guideline for int64 support across all ops. But in most cases, switching the datatype of all the variables holding "indices" from 32bit dtype to 64bit dtype solves the issue. One still has to test that to ensure it doesn't break the functionality and supports int64.

@apeforest @access2rohit any inputs?

Plus ensure that the C API being used supports int64_t for indices as well. On language binding side int64_t values need to be passed to C++ backend. For e.g. ctype.int64 should be used for passing large values else they will get truncated at the language binding interface itself.

@apeforest
Copy link
Contributor

Adding @reminisce to review the C API change for numpy operator.

@apeforest
Copy link
Contributor

One last comment. Otherwise looks good to me. Thanks!

@eric-haibin-lin
Copy link
Member

Does https://cwiki.apache.org/confluence/display/MXNET/Large+Tensor+Support correctly document the current practice/changes?

@ChaiBapchya
Copy link
Contributor Author

Does https://cwiki.apache.org/confluence/display/MXNET/Large+Tensor+Support correctly document the current practice/changes?

Yes. It enlists the 3 steps needed to extend LTS for operators (includes changes on Front-end language binding side and Back-end C++ api side). I updated the wiki. Please verify. @eric-haibin-lin

src/c_api/c_api.cc Outdated Show resolved Hide resolved
Copy link
Contributor

@apeforest apeforest left a comment

Choose a reason for hiding this comment

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

LGTM

@ChaiBapchya
Copy link
Contributor Author

@mxnet-label-bot add [pr-awaiting-merge]

@lanking520 lanking520 added the pr-awaiting-merge Review and CI is complete. Ready to Merge label Jan 23, 2020
@apeforest apeforest merged commit ba47372 into apache:master Jan 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr-awaiting-merge Review and CI is complete. Ready to Merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants