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

[Numpy] FFI for cumsum and add #17747

Merged
merged 5 commits into from
Mar 5, 2020
Merged

[Numpy] FFI for cumsum and add #17747

merged 5 commits into from
Mar 5, 2020

Conversation

hzfan
Copy link
Contributor

@hzfan hzfan commented Mar 3, 2020

Description

Use new ffi for cumsum and add for better speed. Also two changes to the new ffi infra:

  • Enable out for new ffi.
  • Support op with no parameters, like add

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant JIRA issue created (except PRs with tiny changes)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
  • Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
  • Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
  • Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
  • Code is well-documented:
  • For user-facing API changes, API doc string has been updated.
  • For new C++ functions in header files, their functionalities and arguments are documented.
  • For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
  • Check the API doc at https://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
  • To the best of my knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

Changes

  • Feature1, tests, (and when applicable, API doc)
  • Feature2, tests, (and when applicable, API doc)

Comments

  • If this change is a backward incompatible change, why must this change be made.
  • Interesting edge cases to note here

@haojin2 @reminisce

OBJECT_HANDLE = 7
STR = 8
BYTES = 9
PYARG = 10
Copy link
Member

Choose a reason for hiding this comment

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

what's this type code for?

Copy link
Contributor Author

@hzfan hzfan Mar 3, 2020

Choose a reason for hiding this comment

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

Basically it designates a python argument to be returned. For example, PythonArg(2) says the 2nd python argument should be returned.

It is introduced for out. If parameter out is not None, then out should serve as the return value. Note that we should not return the NDArray* specified by out, as it creates another NDArrayBase in frontend, and thus one NDArray* in backend gets destructed twice by two frontend NDArrayBase

@haojin2 haojin2 added the Numpy label Mar 3, 2020
Copy link
Contributor

@haojin2 haojin2 left a comment

Choose a reason for hiding this comment

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

LGTM

@haojin2 haojin2 merged commit 938b35b into apache:master Mar 5, 2020
MoisesHer pushed a commit to MoisesHer/incubator-mxnet that referenced this pull request Apr 10, 2020
* FFI cumsum

* Dispatch ufunc

* Add PythonArg

* Remove unused data type

* Seperate op_utils and utils
anirudh2290 pushed a commit to anirudh2290/mxnet that referenced this pull request May 29, 2020
* FFI cumsum

* Dispatch ufunc

* Add PythonArg

* Remove unused data type

* Seperate op_utils and utils
sxjscience pushed a commit to sxjscience/mxnet that referenced this pull request Jul 1, 2020
* FFI cumsum

* Dispatch ufunc

* Add PythonArg

* Remove unused data type

* Seperate op_utils and utils
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants