Skip to content
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

refine EngineIOConverter, and use io_convert in test_trt_activation_op #10495

Merged
merged 7 commits into from
May 15, 2018
Merged

refine EngineIOConverter, and use io_convert in test_trt_activation_op #10495

merged 7 commits into from
May 15, 2018

Conversation

luotao1
Copy link
Contributor

@luotao1 luotao1 commented May 8, 2018

  1. change EngineInputConverter to EngineIOConverter, which has two function: ConvertInput(LoDTensor->ITensor) and ConvertOutput(ITensor -> LoDTensor)
  2. improve the unit-test test_io_converter.cc
  3. use EngineIOConverter in unit-test test_activation_op.cc
  4. remove duplicated cudaMemcpyAsync in SetInputFromCPU

@luotao1 luotao1 added the 预测 原名Inference,包含Capi预测问题等 label May 8, 2018
@luotao1 luotao1 added this to To do in Inference on Engine via automation May 8, 2018
@luotao1 luotao1 requested a review from Superjomn May 8, 2018 11:21
cudaMemcpyHostToHost, *stream_));

PADDLE_ENFORCE_EQ(0, cudaMemcpyAsync(out, in.data<float>(), size,
cudaMemcpyHostToHost, *stream_));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not DeiveceToDevice?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

*/
class EngineInputConverter {
class EngineIOConverter {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add comments about how to register a convter from fluid to TRT or from TRT to fluid.

For example, a converter for a special Op called x that from fluid to TRT will register as Fluid(x)->TRT.

Or a special Layer in TRT called y that convert output from TRT to fluid will register as TRT(y)->Fluid.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add some comments at first.

@Superjomn Superjomn moved this from To do to Done in Inference on Engine May 10, 2018
@Superjomn Superjomn moved this from Done to In progress in Inference on Engine May 10, 2018
Copy link
Contributor

@Superjomn Superjomn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -26,7 +27,7 @@ namespace paddle {
namespace inference {
namespace tensorrt {

void Compare(float input, float expect) {
void Compare(const std::string op_type, float input, float expect) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const string&

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will correct in next PR.

@luotao1 luotao1 merged commit 6cbe597 into PaddlePaddle:develop May 15, 2018
Inference on Engine automation moved this from In progress to Done May 15, 2018
@luotao1 luotao1 deleted the refine_relu_test branch May 15, 2018 05:53
@Xreki Xreki added this to Integrate TensorRT in Inference Framework May 21, 2018
@luotao1 luotao1 mentioned this pull request May 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
预测 原名Inference,包含Capi预测问题等
Projects
Inference Framework
Integrate TensorRT
Development

Successfully merging this pull request may close these issues.

None yet

2 participants