-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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/tensorrt engine op #11001
feature/tensorrt engine op #11001
Conversation
…/tensorrt_engine_op
…/tensorrt_engine_op
24fe747
to
c4e29a5
Compare
7868a40
to
3f8b9db
Compare
b105e87
to
d62cd09
Compare
d62cd09
to
e18190a
Compare
public: | ||
void Compute(const framework::ExecutionContext& context) const override { | ||
if (!engine_) { | ||
Prepare(context); |
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.
this seems not thread-safe?
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.
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*>()), |
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.
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*>()), |
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.
same here.
namespace paddle { | ||
namespace operators { | ||
|
||
class TensorRTEngineOp : public framework::OperatorWithKernel { |
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.
need a test for this op?
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.
Will create a c++ test when FC converter is merged latter.
No description provided.