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

[Paddle-TRT] remove engine info from RumImpl process #50181

Merged
merged 4 commits into from
Feb 8, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions paddle/fluid/inference/tensorrt/engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,9 @@ void TensorRTEngine::FreezeNetwork() {
.updateContextMemorySize(infer_engine_->getDeviceMemorySize(),
predictor_id_per_thread);
}

GetEngineInfo();
if (use_inspector_) {
GetEngineInfo();
}
}

nvinfer1::ITensor *TensorRTEngine::DeclareInput(const std::string &name,
Expand Down Expand Up @@ -552,8 +553,9 @@ void TensorRTEngine::Deserialize(const std::string &engine_serialized_data) {
.updateContextMemorySize(infer_engine_->getDeviceMemorySize(),
predictor_id_per_thread);
}

GetEngineInfo();
if (use_inspector_) {
GetEngineInfo();
}
}

void TensorRTEngine::SetRuntimeBatch(size_t batch_size) {
Expand Down
5 changes: 0 additions & 5 deletions paddle/fluid/operators/tensorrt/tensorrt_engine_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ class TensorRTEngineOp : public framework::OperatorBase {
bool enable_int8_;
bool enable_fp16_;
bool use_calib_mode_;
bool use_inspector_;
std::string calibration_data_;
std::string engine_key_;
std::string calibration_engine_key_;
Expand Down Expand Up @@ -219,7 +218,6 @@ class TensorRTEngineOp : public framework::OperatorBase {
shape_range_info_path_ = Attr<std::string>("shape_range_info_path");
allow_build_at_runtime_ = Attr<bool>("allow_build_at_runtime");
use_static_engine_ = Attr<bool>("use_static_engine");
use_inspector_ = HasAttr("use_inspector") && Attr<bool>("use_inspector");
if (use_static_engine_) {
model_opt_cache_dir_ = Attr<std::string>("model_opt_cache_dir");
}
Expand Down Expand Up @@ -331,9 +329,6 @@ class TensorRTEngineOp : public framework::OperatorBase {
return;
}
auto *trt_engine = GetEngine(scope, dev_place);
if (use_inspector_) {
trt_engine->GetEngineInfo();
}
if (trt_engine->with_dynamic_shape()) {
// get runtime input shapes.
std::map<std::string, std::vector<int32_t>> runtime_input_shape;
Expand Down