Skip to content

Commit

Permalink
feat(//core/lowering): Adds peephole optimization pass
Browse files Browse the repository at this point in the history
Signed-off-by: Naren Dasan <naren@narendasan.com>
Signed-off-by: Naren Dasan <narens@nvidia.com>
  • Loading branch information
narendasan committed Jun 5, 2020
1 parent ca2b5f9 commit 0014b84
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/lowering/lowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
#include "torch/csrc/jit/passes/dead_code_elimination.h"
#include "torch/csrc/jit/passes/fuse_linear.h"
#include "torch/csrc/jit/passes/freeze_module.h"
#include "torch/csrc/jit/passes/guard_elimination.h"
#include "torch/csrc/jit/passes/loop_unrolling.h"
#include "torch/csrc/jit/passes/lower_graph.h"
#include "torch/csrc/jit/passes/lower_tuples.h"
#include "torch/csrc/jit/passes/peephole.h"
#include "torch/csrc/jit/passes/quantization.h"
#include "torch/csrc/jit/passes/guard_elimination.h"

#include "core/util/prelude.h"
#include "core/lowering/lowering.h"
Expand All @@ -24,6 +25,7 @@ void LowerBlock(torch::jit::Block* b) {

void LowerGraph(std::shared_ptr<torch::jit::Graph>& g) {
torch::jit::EliminateRedundantGuards(g);
torch::jit::PeepholeOptimize(g, false);
passes::EliminateExceptionOrPassPattern(g);
torch::jit::FuseLinear(g);
torch::jit::LowerAllTuples(g);
Expand Down

0 comments on commit 0014b84

Please sign in to comment.