From 0266f419478d458f6ee895a0ee0327cc08510038 Mon Sep 17 00:00:00 2001 From: Dheeraj Peri Date: Fri, 24 Sep 2021 12:20:21 -0700 Subject: [PATCH] fix: Move some lowering passes to graph level logging Signed-off-by: Dheeraj Peri --- core/lowering/passes/module_fallback.cpp | 8 ++++---- core/lowering/passes/remove_nops.cpp | 2 +- core/lowering/passes/unpack_var.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/lowering/passes/module_fallback.cpp b/core/lowering/passes/module_fallback.cpp index 9061130f4e..99b2578dec 100644 --- a/core/lowering/passes/module_fallback.cpp +++ b/core/lowering/passes/module_fallback.cpp @@ -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(); @@ -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()) { @@ -106,10 +106,10 @@ void MarkNodesForFallback(std::shared_ptr& 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 \ No newline at end of file +} // namespace trtorch diff --git a/core/lowering/passes/remove_nops.cpp b/core/lowering/passes/remove_nops.cpp index fd23593586..13aed2aefc 100644 --- a/core/lowering/passes/remove_nops.cpp +++ b/core/lowering/passes/remove_nops.cpp @@ -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_); } diff --git a/core/lowering/passes/unpack_var.cpp b/core/lowering/passes/unpack_var.cpp index 8a5c21cf0b..1202fd9c25 100644 --- a/core/lowering/passes/unpack_var.cpp +++ b/core/lowering/passes/unpack_var.cpp @@ -42,7 +42,7 @@ void UnpackVar(std::shared_ptr& 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