Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion paddle/fluid/framework/ir/graph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ PHI_DEFINE_EXPORTED_bool(convert_all_blocks,
true,
"Convert all blocks in program into SSAgraphs");

PHI_DEFINE_EXPORTED_bool(all_blocks_convert_trt,
PHI_DEFINE_EXPORTED_bool(convert_all_blocks_trt,
false,
"Convert all blocks'Ops into TensorRT Ops");

Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/framework/ir/graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ limitations under the License. */
#include "paddle/utils/any.h"

PD_DECLARE_bool(convert_all_blocks);
PD_DECLARE_bool(all_blocks_convert_trt);
PD_DECLARE_bool(convert_all_blocks_trt);

namespace paddle {
namespace framework {
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/framework/ir/graph_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ limitations under the License. */
#endif
#include "paddle/common/flags.h"
PD_DECLARE_bool(convert_all_blocks);
PD_DECLARE_bool(all_blocks_convert_trt);
PD_DECLARE_bool(convert_all_blocks_trt);
PHI_DEFINE_EXPORTED_string(print_sub_graph_dir,
"",
"FLAGS_print_sub_graph_dir is used "
Expand Down
12 changes: 6 additions & 6 deletions paddle/fluid/framework/ir/pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -131,19 +131,19 @@ Graph *Pass::Apply(Graph *graph) const {
std::vector<std::string> subgraph_passes;
bool use_xpu = Has("use_xpu") && Get<bool>("use_xpu");
bool use_tensorrt = Has("use_tensorrt") && Get<bool>("use_tensorrt");
bool all_blocks_convert = false;
bool convert_all_blocks = false;
if (use_xpu) {
subgraph_passes = xpu_support_subgraph_passes;
all_blocks_convert = FLAGS_convert_all_blocks;
convert_all_blocks = FLAGS_convert_all_blocks;
} else if (use_tensorrt) {
subgraph_passes = trt_support_subgraph_passes;
all_blocks_convert =
FLAGS_all_blocks_convert_trt && FLAGS_convert_all_blocks;
convert_all_blocks =
FLAGS_convert_all_blocks_trt && FLAGS_convert_all_blocks;
} else {
subgraph_passes = gpu_support_subgraph_passes;
all_blocks_convert = FLAGS_convert_all_blocks;
convert_all_blocks = FLAGS_convert_all_blocks;
}
if (all_blocks_convert && graph->IsMainGraph() &&
if (convert_all_blocks && graph->IsMainGraph() &&
(std::count(subgraph_passes.begin(), subgraph_passes.end(), Type()) ||
std::count(support_subgraph_generate_passes.begin(),
support_subgraph_generate_passes.end(),
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/framework/ir/set_subgraph_edge_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace paddle::framework::ir {

// Delete dequantize_linear_op, then dequantize weight
void SetSubgraphEdge::ApplyImpl(Graph *graph) const {
if (!(FLAGS_all_blocks_convert_trt && FLAGS_convert_all_blocks)) {
if (!(FLAGS_convert_all_blocks_trt && FLAGS_convert_all_blocks)) {
VLOG(3) << "Running set_subgraph_edge_pass need set environment variables: "
"export FLAGS_convert_all_blocks = true";
return;
Expand Down
Loading