This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Support destructors for custom stateful ops #19607
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
samskalicky
requested review from
aaronmarkham,
anirudh2290,
eric-haibin-lin and
szha
as code owners
December 1, 2020 08:36
Hey @samskalicky , Thanks for submitting the PR
CI supported jobs: [windows-gpu, sanity, windows-cpu, centos-gpu, edge, miscellaneous, unix-cpu, website, clang, centos-cpu, unix-gpu] Note: |
lanking520
added
the
pr-awaiting-testing
PR is reviewed and waiting CI build and test
label
Dec 1, 2020
FYI @rondogency |
lanking520
added
pr-work-in-progress
PR is still work in progress
and removed
pr-awaiting-testing
PR is reviewed and waiting CI build and test
labels
Dec 1, 2020
lanking520
added
pr-awaiting-testing
PR is reviewed and waiting CI build and test
pr-work-in-progress
PR is still work in progress
and removed
pr-work-in-progress
PR is still work in progress
pr-awaiting-testing
PR is reviewed and waiting CI build and test
labels
Dec 1, 2020
awsabinasm
approved these changes
Dec 1, 2020
rondogency
approved these changes
Dec 1, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
mseth10
approved these changes
Dec 2, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
lanking520
added
pr-awaiting-testing
PR is reviewed and waiting CI build and test
pr-work-in-progress
PR is still work in progress
and removed
pr-work-in-progress
PR is still work in progress
pr-awaiting-testing
PR is reviewed and waiting CI build and test
labels
Dec 2, 2020
lanking520
added
pr-awaiting-testing
PR is reviewed and waiting CI build and test
pr-work-in-progress
PR is still work in progress
and removed
pr-work-in-progress
PR is still work in progress
pr-awaiting-testing
PR is reviewed and waiting CI build and test
labels
Dec 3, 2020
lanking520
added
pr-awaiting-testing
PR is reviewed and waiting CI build and test
pr-work-in-progress
PR is still work in progress
and removed
pr-work-in-progress
PR is still work in progress
pr-awaiting-testing
PR is reviewed and waiting CI build and test
labels
Dec 3, 2020
lanking520
added
pr-awaiting-testing
PR is reviewed and waiting CI build and test
pr-work-in-progress
PR is still work in progress
pr-awaiting-review
PR is waiting for code review
and removed
pr-work-in-progress
PR is still work in progress
pr-awaiting-testing
PR is reviewed and waiting CI build and test
labels
Dec 3, 2020
samskalicky
added
pr-awaiting-merge
Review and CI is complete. Ready to Merge
and removed
pr-awaiting-review
PR is waiting for code review
labels
Dec 3, 2020
samskalicky
added a commit
to samskalicky/incubator-mxnet
that referenced
this pull request
Dec 4, 2020
* initial commit * added warning message * added destroy function to call delete in custom library * try removing six per apache#19604 * fixed lint * fixed readability
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Support destructors for custom stateful ops
_opCallDestroyOpState
to call delete on CustomStatefulOp in custom librarycreate
API to CustomStatefulOp to create instances of CustomStatefulOp derived classes usingnew
. This API takes variadic args and passes them to the constructor of the templated class. For example:CustomStatefulOp::create<MyStatefulGemm>(count, attrs);
create
APIcreate
API to ensure they are allocated with new (sincedelete
will be called on destruction) or emit a suppressible warning message.MyStatefulTransposeRowSP
classMyStatefulTransposeCSR
class is an example where the message is emitted.Now, when MXNet calls the destructor for the CustomStatefulOpWrapper class it will subsequently
delete
the instance of the CustomStatefulOp allocated withnew
and call the inherited class's destructor