Skip to content

feature/tensorrt engine op#11001

Merged
Superjomn merged 14 commits intoPaddlePaddle:developfrom
Superjomn:feature/tensorrt_engine_op
May 30, 2018
Merged

feature/tensorrt engine op#11001
Superjomn merged 14 commits intoPaddlePaddle:developfrom
Superjomn:feature/tensorrt_engine_op

Conversation

@Superjomn
Copy link
Contributor

No description provided.

@Superjomn Superjomn force-pushed the feature/tensorrt_engine_op branch from 24fe747 to c4e29a5 Compare May 29, 2018 07:54
@Superjomn Superjomn requested review from luotao1 and panyx0718 May 29, 2018 07:55
@Superjomn Superjomn force-pushed the feature/tensorrt_engine_op branch from 7868a40 to 3f8b9db Compare May 29, 2018 10:57
@Superjomn Superjomn force-pushed the feature/tensorrt_engine_op branch from b105e87 to d62cd09 Compare May 29, 2018 23:41
@Superjomn Superjomn force-pushed the feature/tensorrt_engine_op branch from d62cd09 to e18190a Compare May 30, 2018 00:15
public:
void Compute(const framework::ExecutionContext& context) const override {
if (!engine_) {
Prepare(context);
Copy link
Contributor

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?

Copy link
Contributor Author

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*>()),
Copy link
Contributor

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*>()),
Copy link
Contributor

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 {
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@Superjomn Superjomn merged commit 211e131 into PaddlePaddle:develop May 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants