Skip to content

Commit

Permalink
fix: Move some lowering passes to graph level logging
Browse files Browse the repository at this point in the history
Signed-off-by: Dheeraj Peri <peri.dheeraj@gmail.com>
  • Loading branch information
peri044 committed Sep 24, 2021
1 parent ef2732a commit 0266f41
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions core/lowering/passes/module_fallback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void NotateModuleForFallback(
if (n->kind() == torch::jit::prim::GetAttr) {
auto out_type = unmangle_cls_name(c10::toString(n->output(0)->type()));
if (forced_fallback_modules.find(out_type) != forced_fallback_modules.end()) {
LOG_DEBUG(
LOG_GRAPH(
"Notating module for fallback: " << n->s(c10::attr::name) << " (" << out_type << ") [owner: " << mod_name
<< " (" << cls_name << ")]");
auto uses = n->output(0)->uses();
Expand All @@ -58,7 +58,7 @@ void NotateModuleForFallback(
}

if (changed_mod) {
LOG_DEBUG("Notated graph: " << *g);
LOG_GRAPH("Notated graph: " << *g);
}

for (const auto sub_mod : mod.named_children()) {
Expand Down Expand Up @@ -106,10 +106,10 @@ void MarkNodesForFallback(std::shared_ptr<torch::jit::Graph>& g, bool delete_del
}
}

LOG_DEBUG("After marking operations for torch fallback: " << *g);
LOG_GRAPH("After marking operations for torch fallback: " << *g);
}

} // namespace passes
} // namespace lowering
} // namespace core
} // namespace trtorch
} // namespace trtorch
2 changes: 1 addition & 1 deletion core/lowering/passes/remove_nops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct NOPRemoval {
void run() {
removeNode(graph_->block(), "aten::detach");
torch::jit::EliminateDeadCode(graph_);
LOG_DEBUG("RemoveNOPs - Note: Removing operators that have no meaning in TRT");
LOG_GRAPH("RemoveNOPs - Note: Removing operators that have no meaning in TRT");
LOG_GRAPH("Post aten::detach removal: " << *graph_);
}

Expand Down
2 changes: 1 addition & 1 deletion core/lowering/passes/unpack_var.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void UnpackVar(std::shared_ptr<torch::jit::Graph>& graph) {
torch::jit::SubgraphRewriter var_rewriter;
var_rewriter.RegisterRewritePattern(var_pattern, unpacked_pattern);
var_rewriter.runOnGraph(graph);
LOG_DEBUG("Post unpack var: " << *graph);
LOG_GRAPH("Post unpack var: " << *graph);
}

} // namespace passes
Expand Down

0 comments on commit 0266f41

Please sign in to comment.