Skip to content

Commit c6d290d

Browse files
authored
Merge pull request #183 from NVIDIA/functionalization
feat(//core/lowering): Add functionalization pass to replace inplace operators
2 parents 2299351 + 90a9ed6 commit c6d290d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

core/lowering/lowering.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "torch/csrc/jit/passes/dead_code_elimination.h"
33
#include "torch/csrc/jit/passes/fuse_linear.h"
44
#include "torch/csrc/jit/passes/freeze_module.h"
5+
#include "torch/csrc/jit/passes/create_functional_graphs.h"
56
#include "torch/csrc/jit/passes/guard_elimination.h"
67
#include "torch/csrc/jit/passes/loop_unrolling.h"
78
#include "torch/csrc/jit/passes/lower_graph.h"
@@ -24,6 +25,10 @@ void LowerBlock(torch::jit::Block* b) {
2425

2526
void LowerGraph(std::shared_ptr<torch::jit::Graph>& g) {
2627
torch::jit::EliminateRedundantGuards(g);
28+
torch::jit::RemoveListMutation(g);
29+
torch::jit::RemoveTensorMutation(g);
30+
torch::jit::CreateFunctionalGraphs(g);
31+
torch::jit::InlineFunctionalGraphs(g);
2732
torch::jit::PeepholeOptimize(g, false);
2833
passes::EliminateExceptionOrPassPattern(g);
2934
torch::jit::FuseLinear(g);

0 commit comments

Comments
 (0)