-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Feature/operator run place #6783
Merged
dzhwinter
merged 17 commits into
PaddlePaddle:develop
from
dzhwinter:feature/operator_run_place
Dec 24, 2017
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
fe9d8f4
"change operator interface"
dzhwinter aede284
"move devicepool to device_context"
dzhwinter ba86b7f
"fix operator test"
dzhwinter d8729c6
"fix op_registry Run interface"
dzhwinter 7e833e2
"net op passed. Need to fix nccl multi-Context"
dzhwinter 7dd973c
"add nccl group function"
dzhwinter e64102d
"add nccl group function"
dzhwinter 6d37cd7
"fix gpu count exceed 32 error"
dzhwinter b79e316
"fix recurrent op, nccl op"
dzhwinter 80ff7b3
"change the other operators interface with Place"
dzhwinter a68b216
"fix typo"
dzhwinter ff860bb
"fix pybind"
dzhwinter 9af5ddf
merge develop branch
dzhwinter 5d1ed81
"fix device in python side"
dzhwinter 6106eae
"fix pybind failed"
dzhwinter ce2e33d
"add init for test"
dzhwinter 9bd7511
"fix CI"
dzhwinter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
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.
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.
Currently, we can simply add another interface here:
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.
We hold the same believe that Operatorbase has one and only one runnable interface.
Now it's the early time that we can fix operator interface once, otherwise, we can not simply remove the second
Run
in the future.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.
The same confusing with @QiJune , for this PR, too many operators will fetch the
device_ctx
and add the following code:I knew from @dzhwinter that one Op without Kernel would fetch the
dev_ctx
fromDeviceContextPool
, and I think the suggestion from @QiJune maybe a simple way, and don't add too much repeated code in the Ops.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.
I hold a different view. @QiJune 's suggestion is a transitional approach.
DeviceContextPool contains device related resources, so I believe only the OperatorWithKernel need to touch the pool.
If we make an agreement on above, so we should not add a Run(DeviceContext) in the final solution.
In addition, most of the operators don't need to add the redundant snippet of get device from the global pool, so why this PR contains a lot
Get()
?The reason is our CopyFrom didn't different CPUDevice and GPUDevice, actually, only the GPUDevice need to get a devicecontext from the pool and do a copy. We will change it in the future.