feature/tensorrt engine op#11001
Merged
Superjomn merged 14 commits intoPaddlePaddle:developfrom May 30, 2018
Merged
Conversation
…/tensorrt_engine_op
…/tensorrt_engine_op
24fe747 to
c4e29a5
Compare
7868a40 to
3f8b9db
Compare
b105e87 to
d62cd09
Compare
d62cd09 to
e18190a
Compare
panyx0718
reviewed
May 30, 2018
| public: | ||
| void Compute(const framework::ExecutionContext& context) const override { | ||
| if (!engine_) { | ||
| Prepare(context); |
Contributor
There was a problem hiding this comment.
this seems not thread-safe?
Contributor
Author
There was a problem hiding this comment.
This op should be called by single thread scenario
| PADDLE_ENFORCE_NOT_NULL(v, "no variable called %s", x); | ||
| auto& t = v->Get<framework::LoDTensor>(); | ||
| if (platform::is_cpu_place(t.place())) { | ||
| engine_->SetInputFromCPU(x, static_cast<const void*>(t.data<void*>()), |
Contributor
There was a problem hiding this comment.
t.data will return void*?
| engine_->SetInputFromCPU(x, static_cast<const void*>(t.data<void*>()), | ||
| t.memory_size()); | ||
| } else { | ||
| engine_->SetInputFromGPU(x, static_cast<const void*>(t.data<void*>()), |
| namespace paddle { | ||
| namespace operators { | ||
|
|
||
| class TensorRTEngineOp : public framework::OperatorWithKernel { |
Contributor
There was a problem hiding this comment.
need a test for this op?
Contributor
Author
There was a problem hiding this comment.
Will create a c++ test when FC converter is merged latter.
panyx0718
approved these changes
May 30, 2018
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.