提交 c918788b 编写于 作者: Y Yiqun Liu 提交者: Tao Luo

Disable fusion_group pass for windows and mac. We will do some experiments on Linux first. (#21310)

* Disable fusion_group pass for windows and mac. We will do some experiments on Linux first.
test=develop

* Print the subgraph when check failed.
test=develop
上级 69dd5152
......@@ -6,7 +6,9 @@ file(APPEND ${pass_file} "\#include \"paddle/fluid/framework/ir/pass.h\"\n")
add_subdirectory(fuse_optimizer_ops_pass)
add_subdirectory(memory_optimize_pass)
add_subdirectory(multi_devices_graph_pass)
add_subdirectory(fusion_group)
if(NOT APPLE AND NOT WIN32)
add_subdirectory(fusion_group)
endif()
# Usage: pass_library(target inference) will append to paddle_inference_pass.h
unset(INFER_IR_PASSES CACHE) # clear the global variable
......
cc_library(code_generator SRCS operation.cc code_generator.cc code_generator_helper.cc DEPS graph)
if(NOT APPLE AND NOT WIN32)
if(WITH_GPU)
if(WITH_GPU)
cc_test(test_code_generator SRCS code_generator_tester.cc DEPS code_generator device_code lod_tensor graph_viz_pass)
endif()
endif()
cc_library(fusion_group_pass
......
......@@ -20,6 +20,7 @@ limitations under the License. */
#include <vector>
#include "paddle/fluid/framework/ir/fusion_group/operation.h"
#include "paddle/fluid/framework/ir/node.h"
#include "paddle/fluid/framework/ir/pass_tester_helper.h"
namespace paddle {
namespace framework {
......@@ -170,6 +171,11 @@ struct SubGraph {
}
}
if (from > to) {
LOG(INFO) << "subgraph: {\n" << DebugString(Nodes()) << "}\n";
LOG(INFO) << "sorted nodes: {\n"
<< DebugString(sorted_nodes) << "}\n";
}
PADDLE_ENFORCE_LE(from, to, "Range [%d, %d] is invalid.", from, to);
sorted_nodes.insert(sorted_nodes.begin() + to, n);
sorted_vars[n->Name()] = n;
......@@ -225,6 +231,9 @@ struct SubGraph {
}
}
if (found_connected_ops) {
if (from > to) {
LOG(INFO) << "subgraph: {\n" << DebugString(Nodes()) << "}\n";
}
PADDLE_ENFORCE_LE(from, to, "Range [%d, %d] is invalid.", from, to);
sorted_ops.insert(sorted_ops.begin() + to, op_n);
erased_ops.insert(op_n);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册