8000 [JIT] add GRAPH_DEBUG for setGraphExecutorOptimize (#153549) · pytorch/pytorch@5e6e52e · GitHub
[go: up one dir, main page]

Skip to content

Commit 5e6e52e

Browse files
davidberard98pytorchmergebot
authored andcommitted
[JIT] add GRAPH_DEBUG for setGraphExecutorOptimize (#153549)
Summary: Optionally log when setGraphExecutorOptimize is called, so we can get insight into the GraphExecutor behavior. Differential Revision: D74692508 Pull Request resolved: #153549 Approved by: https://github.com/PaulZhang12, https://github.com/SamGinzburg
1 parent dda2c7c commit 5e6e52e

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

torch/csrc/jit/jit_log.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#pragma once
2+
#include <c10/util/StringUtil.h>
23
#include <torch/csrc/Export.h>
34
#include <memory>
45
#include <ostream>

torch/csrc/jit/python/update_graph_executor_opt.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
#include <torch/csrc/jit/jit_log.h>
12
#include <torch/csrc/jit/python/update_graph_executor_opt.h>
23

34
namespace torch::jit {
45

56
static thread_local bool kOptimize = true;
67
void setGraphExecutorOptimize(bool o) {
78
kOptimize = o;
9+
GRAPH_DEBUG("GraphExecutorOptimize set to ", o);
810
}
911
bool getGraphExecutorOptimize() {
1012
return kOptimize;

0 commit comments

Comments
 (0)
0