Skip to content

Commit d24cbac

Browse files
authored
fix: fix compilation stuck bug caused by elimination exception (#1409)
* fix: fix compilation stuck bug Signed-off-by: Bo Wang <[email protected]> * chore: apply linting Signed-off-by: Bo Wang <[email protected]> Signed-off-by: Bo Wang <[email protected]>
1 parent f6ba547 commit d24cbac

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

core/lowering/lowering.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "torch/csrc/jit/passes/lower_graph.h"
1010
#include "torch/csrc/jit/passes/lower_tuples.h"
1111
#include "torch/csrc/jit/passes/peephole.h"
12+
#include "torch/csrc/jit/passes/remove_exceptions.h"
1213
#include "torch/csrc/jit/passes/remove_mutation.h"
1314

1415
#include "core/lowering/lowering.h"
@@ -33,6 +34,7 @@ void LowerGraph(std::shared_ptr<torch::jit::Graph>& g, LowerInfo lower_info) {
3334
torch::jit::InlineFunctionalGraphs(g);
3435
torch::jit::PeepholeOptimize(g, false);
3536
torch::jit::FuseLinear(g);
37+
torch::jit::EliminateExceptions(g);
3638
if (!lower_info.disable_cse) {
3739
torch::jit::EliminateCommonSubexpression(g);
3840
}

core/lowering/passes/exception_elimination.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include "torch/csrc/jit/passes/dead_code_elimination.h"
55
#include "torch/csrc/jit/passes/guard_elimination.h"
66
#include "torch/csrc/jit/passes/peephole.h"
7-
#include "torch/csrc/jit/passes/remove_exceptions.h"
87
#include "torch/csrc/jit/runtime/graph_executor.h"
98

109
#include "core/util/prelude.h"
@@ -22,7 +21,6 @@ struct ExceptionOrPassPatternElimination {
2221

2322
void run() {
2423
findExceptionOrPassNodes(graph_->block());
25-
torch::jit::EliminateExceptions(graph_);
2624
torch::jit::EliminateDeadCode(graph_);
2725
LOG_GRAPH("Post exeception or pass elimination: " << *graph_);
2826
}

0 commit comments

Comments
 (0)