From bf3161bdb129922cd6fee75630983d5ed89f9895 Mon Sep 17 00:00:00 2001 From: Pei Yang Date: Tue, 22 Jun 2021 10:41:34 +0800 Subject: [PATCH] fix emb_eltwise_ln gpu_id bug (#33701) (#33706) --- paddle/fluid/inference/api/analysis_config.cc | 1 - paddle/fluid/inference/api/analysis_predictor.cc | 4 ++-- paddle/fluid/inference/api/paddle_analysis_config.h | 2 +- .../tensorrt/plugin/emb_eltwise_layernorm_plugin.cu | 2 +- .../inference/tests/api/trt_dynamic_shape_ernie_test.cc | 5 ----- 5 files changed, 4 insertions(+), 10 deletions(-) diff --git a/paddle/fluid/inference/api/analysis_config.cc b/paddle/fluid/inference/api/analysis_config.cc index 853c1ac1da8..b5ca0ef5924 100644 --- a/paddle/fluid/inference/api/analysis_config.cc +++ b/paddle/fluid/inference/api/analysis_config.cc @@ -421,7 +421,6 @@ void AnalysisConfig::Update() { pass_builder()->AppendPass(pass); } } - LOG(INFO) << "use_dlnne_:" << use_dlnne_ << std::endl; if (use_dlnne_) { pass_builder()->ClearPasses(); for (const auto &pass : kDlnneSubgraphPasses) { diff --git a/paddle/fluid/inference/api/analysis_predictor.cc b/paddle/fluid/inference/api/analysis_predictor.cc index 215174c12ce..b205d553c99 100644 --- a/paddle/fluid/inference/api/analysis_predictor.cc +++ b/paddle/fluid/inference/api/analysis_predictor.cc @@ -152,8 +152,8 @@ bool AnalysisPredictor::Init( : platform::ProfilerState::kCPU; platform::EnableProfiler(tracking_device); } else { - LOG(INFO) << "Profiler is deactivated, and no profiling report will be " - "generated."; + VLOG(2) << "Profiler is deactivated, and no profiling report will be " + "generated."; } // no matter with or without MKLDNN diff --git a/paddle/fluid/inference/api/paddle_analysis_config.h b/paddle/fluid/inference/api/paddle_analysis_config.h index 2bbd4bb837a..f9e4869934a 100644 --- a/paddle/fluid/inference/api/paddle_analysis_config.h +++ b/paddle/fluid/inference/api/paddle_analysis_config.h @@ -294,7 +294,7 @@ struct PD_INFER_DECL AnalysisConfig { /// workspace. /// \param max_batch_size The maximum batch size of this prediction task, /// better set as small as possible for less performance loss. - /// \param min_subgrpah_size The minimum TensorRT subgraph size needed, if a + /// \param min_subgraph_size The minimum TensorRT subgraph size needed, if a /// subgraph is smaller than this, it will not be transferred to TensorRT /// engine. /// \param precision The precision used in TensorRT. diff --git a/paddle/fluid/inference/tensorrt/plugin/emb_eltwise_layernorm_plugin.cu b/paddle/fluid/inference/tensorrt/plugin/emb_eltwise_layernorm_plugin.cu index 6d3872aaeb8..c873b1fc310 100644 --- a/paddle/fluid/inference/tensorrt/plugin/emb_eltwise_layernorm_plugin.cu +++ b/paddle/fluid/inference/tensorrt/plugin/emb_eltwise_layernorm_plugin.cu @@ -134,7 +134,7 @@ int EmbEltwiseLayernormPluginDynamicImpl::enqueue( int batch = id_dims.d[0]; int seq_len = id_dims.d[1]; int input_num = embs_.size(); - + cudaGetDevice(&device_id_); auto in_ptr_gpu_d = in_ptr_tensor_.mutable_data(platform::CUDAPlace(device_id_)); auto emb_ptr_gpu_d = diff --git a/paddle/fluid/inference/tests/api/trt_dynamic_shape_ernie_test.cc b/paddle/fluid/inference/tests/api/trt_dynamic_shape_ernie_test.cc index 45dff9f4c37..a45b78f05e7 100644 --- a/paddle/fluid/inference/tests/api/trt_dynamic_shape_ernie_test.cc +++ b/paddle/fluid/inference/tests/api/trt_dynamic_shape_ernie_test.cc @@ -29,11 +29,6 @@ void run(const AnalysisConfig& config, std::vector* out_data) { int run_batch = 1; const int run_seq_len = 128; - std::vector tmp_input; - std::vector tmp_four_input; - tmp_input.reserve(run_batch * run_seq_len); - tmp_four_input.reserve(run_batch * run_seq_len); - int64_t i0[run_seq_len] = { 1, 3558, 4, 75, 491, 89, 340, 313, 93, 4, 255, 10, 75, 321, 4095, 1902, 4, 134, 49, 75, 311, 14, 44, 178, 543, 15, 12043, 2, -- GitLab