From 171da2ce78ce241729722a617cc4d3a80097a39f Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Thu, 25 Nov 2021 10:06:59 +0800 Subject: [PATCH] [new-exec] skip compiled program (#37512) * skip compiled program * fix ut --- python/paddle/fluid/executor.py | 13 +++++++------ .../interpreter/test_standalone_executor.py | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/python/paddle/fluid/executor.py b/python/paddle/fluid/executor.py index 7865428d194..3f2aebfa4ca 100644 --- a/python/paddle/fluid/executor.py +++ b/python/paddle/fluid/executor.py @@ -1332,13 +1332,14 @@ class Executor(object): def _can_use_interpreter_core(program, place): compiled = isinstance(program, compiler.CompiledProgram) - # NOTE(zhiqiu): only single card compiled program is supported + # NOTE(zhiqiu): do not support compiled program now if compiled: - if program._is_data_parallel and len( - program._get_places(place, program._places)) == 1: - return True - else: - return False + return False + # if program._is_data_parallel and len( + # program._get_places(place, program._places)) == 1: + # return True + # else: + # return False else: assert isinstance(program, Program) return True diff --git a/python/paddle/fluid/tests/unittests/interpreter/test_standalone_executor.py b/python/paddle/fluid/tests/unittests/interpreter/test_standalone_executor.py index 9641d082418..23dee7338ae 100644 --- a/python/paddle/fluid/tests/unittests/interpreter/test_standalone_executor.py +++ b/python/paddle/fluid/tests/unittests/interpreter/test_standalone_executor.py @@ -261,7 +261,7 @@ class SwitchExecutorInterfaceWithFeed(unittest.TestCase): def test_compiled_program(self): data = np.ones([2, 2], dtype="float32") - feed = {"a": data, 'fake_input': data} + feed = {"a": data} res = self.run_new_executor(feed, use_compiled=True) gt = self.run_raw_executor(feed, use_compiled=True) -- GitLab