[JIT] Switch executor from Simple to Legacy. (#41017)

* properly skip legacy tests regardless of the default executor (#40381)

Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/40381

Differential Revision: D22173938

Pulled By: Krovatkin

fbshipit-source-id: 305fc4484977e828cc4cee6e053a1e1ab9f0d6c7

* [JIT] Switch executor from Simple to Legacy.

This is done for 1.6 only in order to recover performance regressions
caused by the Legacy->Simple switch that was done in 1.5. On master we
still plan to use Simple executor and fix the performance issues in 1.7
without falling back to the Legacy executor.

Co-authored-by: Nikolay Korovaiko <korovaikon@gmail.com>
This commit is contained in:
Mikhail Zolotukhin 2020-07-06 21:35:02 -07:00 committed by GitHub
parent 01e9562313
commit 11b70b0041
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

View File

@ -9,6 +9,15 @@ import torch.nn as nn
import torch.nn.functional as F
from torch.testing import FileCheck
# these needs to be set before `common_utils`
# infers `GRAPH_EXECUTOR`.
# this file **requires** these settings
# and setting them after `GRAPH_EXECUTOR` is
# inferred erroneously runs or skips
# some tests
torch._C._jit_set_profiling_executor(True)
torch._C._jit_set_profiling_mode(True)
from torch.testing._internal.common_utils import run_tests, IS_SANDCASTLE, ProfilingMode, GRAPH_EXECUTOR, \
enable_profiling_mode_for_profiling_tests, skipIfRocm
from torch.testing._internal.jit_utils import JitTestCase, _inline_everything, \
@ -22,9 +31,6 @@ from test_jit import backward_graph, all_backward_graphs, get_lstm_inputs, get_m
from te_utils import CudaCodeGenExecuted
torch._C._jit_set_profiling_executor(True)
torch._C._jit_set_profiling_mode(True)
FUSION_GROUP = 'tensorexpr::Group'
def strip_profiling_nodes(nodes):

View File

@ -39,7 +39,7 @@ namespace jit {
static std::atomic<bool> executor_mode{true};
static std::atomic<bool> profiling_mode{false};
#else
static std::atomic<bool> executor_mode{true};
static std::atomic<bool> executor_mode{false};
static std::atomic<bool> profiling_mode{false};
#endif