未验证 提交 827ac36f 编写于 作者: P pangyoki 提交者: GitHub

Use dygraph mode by default (#27443)

* default open dygraph mode

* fix CI-Mac

* fix Mac-CI other unittest file

* fix CI-Py3

* fix test_communicator_geo and test_buffer_shared_memory_reuse_pass

* add enable_static to fix CI-Py3

* add enable_static to fix CI-coverage

* delete try except
上级 0a862fd3
...@@ -276,3 +276,5 @@ from .hapi import callbacks ...@@ -276,3 +276,5 @@ from .hapi import callbacks
from .hapi import summary from .hapi import summary
import paddle.text import paddle.text
import paddle.vision import paddle.vision
disable_static()
...@@ -19,6 +19,9 @@ import argparse ...@@ -19,6 +19,9 @@ import argparse
import paddle.fluid as fluid import paddle.fluid as fluid
from paddle.fluid.framework import IrGraph from paddle.fluid.framework import IrGraph
from paddle.fluid import core from paddle.fluid import core
import paddle
paddle.enable_static()
def parse_args(): def parse_args():
......
...@@ -27,6 +27,8 @@ from paddle.fluid.framework import IrGraph ...@@ -27,6 +27,8 @@ from paddle.fluid.framework import IrGraph
from paddle.fluid.contrib.slim.quantization import Quant2Int8MkldnnPass from paddle.fluid.contrib.slim.quantization import Quant2Int8MkldnnPass
from paddle.fluid import core from paddle.fluid import core
paddle.enable_static()
logging.basicConfig(format='%(asctime)s-%(levelname)s: %(message)s') logging.basicConfig(format='%(asctime)s-%(levelname)s: %(message)s')
_logger = logging.getLogger(__name__) _logger = logging.getLogger(__name__)
_logger.setLevel(logging.INFO) _logger.setLevel(logging.INFO)
......
...@@ -25,6 +25,8 @@ from paddle.fluid.framework import IrGraph ...@@ -25,6 +25,8 @@ from paddle.fluid.framework import IrGraph
from paddle.fluid.contrib.slim.quantization import Quant2Int8MkldnnPass from paddle.fluid.contrib.slim.quantization import Quant2Int8MkldnnPass
from paddle.fluid import core from paddle.fluid import core
paddle.enable_static()
logging.basicConfig(format='%(asctime)s-%(levelname)s: %(message)s') logging.basicConfig(format='%(asctime)s-%(levelname)s: %(message)s')
_logger = logging.getLogger(__name__) _logger = logging.getLogger(__name__)
_logger.setLevel(logging.INFO) _logger.setLevel(logging.INFO)
......
...@@ -27,6 +27,8 @@ from paddle.fluid.framework import IrGraph ...@@ -27,6 +27,8 @@ from paddle.fluid.framework import IrGraph
from paddle.fluid.contrib.slim.quantization import QuantInt8MkldnnPass from paddle.fluid.contrib.slim.quantization import QuantInt8MkldnnPass
from paddle.fluid import core from paddle.fluid import core
paddle.enable_static()
logging.basicConfig(format='%(asctime)s-%(levelname)s: %(message)s') logging.basicConfig(format='%(asctime)s-%(levelname)s: %(message)s')
_logger = logging.getLogger(__name__) _logger = logging.getLogger(__name__)
_logger.setLevel(logging.INFO) _logger.setLevel(logging.INFO)
......
...@@ -27,6 +27,8 @@ from paddle.fluid.framework import IrGraph ...@@ -27,6 +27,8 @@ from paddle.fluid.framework import IrGraph
from paddle.fluid.contrib.slim.quantization import Quant2Int8MkldnnPass from paddle.fluid.contrib.slim.quantization import Quant2Int8MkldnnPass
from paddle.fluid import core from paddle.fluid import core
paddle.enable_static()
def parse_args(): def parse_args():
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
......
...@@ -22,6 +22,8 @@ import paddle.fluid as fluid ...@@ -22,6 +22,8 @@ import paddle.fluid as fluid
from paddle.fluid.framework import IrGraph from paddle.fluid.framework import IrGraph
from paddle.fluid import core from paddle.fluid import core
paddle.enable_static()
os.environ["CUDA_VISIBLE_DEVICES"] = "0" os.environ["CUDA_VISIBLE_DEVICES"] = "0"
os.environ["CPU_NUM"] = "1" os.environ["CPU_NUM"] = "1"
......
...@@ -32,6 +32,8 @@ from paddle.fluid.dygraph.nn import Pool2D ...@@ -32,6 +32,8 @@ from paddle.fluid.dygraph.nn import Pool2D
from paddle.fluid.dygraph.nn import Linear from paddle.fluid.dygraph.nn import Linear
from paddle.fluid.log_helper import get_logger from paddle.fluid.log_helper import get_logger
paddle.enable_static()
os.environ["CPU_NUM"] = "1" os.environ["CPU_NUM"] = "1"
if core.is_compiled_with_cuda(): if core.is_compiled_with_cuda():
fluid.set_flags({"FLAGS_cudnn_deterministic": True}) fluid.set_flags({"FLAGS_cudnn_deterministic": True})
......
...@@ -32,6 +32,8 @@ from paddle.fluid.dygraph.nn import Pool2D ...@@ -32,6 +32,8 @@ from paddle.fluid.dygraph.nn import Pool2D
from paddle.fluid.dygraph.nn import Linear from paddle.fluid.dygraph.nn import Linear
from paddle.fluid.log_helper import get_logger from paddle.fluid.log_helper import get_logger
paddle.enable_static()
os.environ["CPU_NUM"] = "1" os.environ["CPU_NUM"] = "1"
if core.is_compiled_with_cuda(): if core.is_compiled_with_cuda():
fluid.set_flags({"FLAGS_cudnn_deterministic": True}) fluid.set_flags({"FLAGS_cudnn_deterministic": True})
......
...@@ -25,6 +25,8 @@ import paddle.fluid as fluid ...@@ -25,6 +25,8 @@ import paddle.fluid as fluid
from paddle.dataset.common import download from paddle.dataset.common import download
from paddle.fluid.contrib.slim.quantization import PostTrainingQuantization from paddle.fluid.contrib.slim.quantization import PostTrainingQuantization
paddle.enable_static()
random.seed(0) random.seed(0)
np.random.seed(0) np.random.seed(0)
......
...@@ -26,6 +26,8 @@ import paddle.fluid as fluid ...@@ -26,6 +26,8 @@ import paddle.fluid as fluid
from paddle.dataset.common import download from paddle.dataset.common import download
from paddle.fluid.contrib.slim.quantization import PostTrainingQuantization from paddle.fluid.contrib.slim.quantization import PostTrainingQuantization
paddle.enable_static()
random.seed(0) random.seed(0)
np.random.seed(0) np.random.seed(0)
......
...@@ -15,6 +15,9 @@ ...@@ -15,6 +15,9 @@
import sys import sys
import unittest import unittest
from test_post_training_quantization_mobilenetv1 import TestPostTrainingQuantization from test_post_training_quantization_mobilenetv1 import TestPostTrainingQuantization
import paddle
paddle.enable_static()
class TestPostTrainingForResnet50(TestPostTrainingQuantization): class TestPostTrainingForResnet50(TestPostTrainingQuantization):
......
...@@ -18,6 +18,9 @@ import paddle.fluid as fluid ...@@ -18,6 +18,9 @@ import paddle.fluid as fluid
import paddle.fluid.core as core import paddle.fluid.core as core
from paddle.fluid.framework import IrGraph from paddle.fluid.framework import IrGraph
from paddle.fluid.contrib.slim.quantization import Quant2Int8MkldnnPass from paddle.fluid.contrib.slim.quantization import Quant2Int8MkldnnPass
import paddle
paddle.enable_static()
class TestQuant2Int8MkldnnPass(unittest.TestCase): class TestQuant2Int8MkldnnPass(unittest.TestCase):
......
...@@ -25,6 +25,7 @@ from paddle.fluid.contrib.slim.quantization import QuantizationTransformPass ...@@ -25,6 +25,7 @@ from paddle.fluid.contrib.slim.quantization import QuantizationTransformPass
from paddle.fluid.contrib.slim.quantization import QuantInt8MkldnnPass from paddle.fluid.contrib.slim.quantization import QuantInt8MkldnnPass
from paddle.fluid import core from paddle.fluid import core
paddle.enable_static()
os.environ["CPU_NUM"] = "1" os.environ["CPU_NUM"] = "1"
......
...@@ -27,6 +27,8 @@ from paddle.fluid.contrib.slim.quantization import TransformForMobilePass ...@@ -27,6 +27,8 @@ from paddle.fluid.contrib.slim.quantization import TransformForMobilePass
from paddle.fluid.contrib.slim.quantization import AddQuantDequantPass from paddle.fluid.contrib.slim.quantization import AddQuantDequantPass
from paddle.fluid import core from paddle.fluid import core
paddle.enable_static()
os.environ["CUDA_VISIBLE_DEVICES"] = "0" os.environ["CUDA_VISIBLE_DEVICES"] = "0"
os.environ["CPU_NUM"] = "1" os.environ["CPU_NUM"] = "1"
......
...@@ -27,6 +27,8 @@ from paddle.fluid.contrib.slim.quantization import OutScaleForInferencePass ...@@ -27,6 +27,8 @@ from paddle.fluid.contrib.slim.quantization import OutScaleForInferencePass
from paddle.fluid.contrib.slim.quantization import AddQuantDequantPass from paddle.fluid.contrib.slim.quantization import AddQuantDequantPass
from paddle.fluid import core from paddle.fluid import core
paddle.enable_static()
os.environ["CUDA_VISIBLE_DEVICES"] = "0" os.environ["CUDA_VISIBLE_DEVICES"] = "0"
os.environ["CPU_NUM"] = "1" os.environ["CPU_NUM"] = "1"
......
...@@ -29,6 +29,8 @@ from paddle.fluid.contrib.slim.quantization import AddQuantDequantPass ...@@ -29,6 +29,8 @@ from paddle.fluid.contrib.slim.quantization import AddQuantDequantPass
from paddle.fluid import core from paddle.fluid import core
from paddle.fluid.layer_helper import LayerHelper from paddle.fluid.layer_helper import LayerHelper
paddle.enable_static()
os.environ["CUDA_VISIBLE_DEVICES"] = "0" os.environ["CUDA_VISIBLE_DEVICES"] = "0"
os.environ["CPU_NUM"] = "1" os.environ["CPU_NUM"] = "1"
......
...@@ -17,6 +17,9 @@ import os ...@@ -17,6 +17,9 @@ import os
import time import time
from paddle.dataset.common import download, DATA_HOME from paddle.dataset.common import download, DATA_HOME
from paddle.fluid.contrib.slim.quantization import WeightQuantization from paddle.fluid.contrib.slim.quantization import WeightQuantization
import paddle
paddle.enable_static()
class TestWeightQuantization(unittest.TestCase): class TestWeightQuantization(unittest.TestCase):
......
...@@ -16,6 +16,9 @@ import unittest ...@@ -16,6 +16,9 @@ import unittest
import numpy as np import numpy as np
import paddle.fluid as fluid import paddle.fluid as fluid
from paddle.fluid.dygraph.base import to_variable from paddle.fluid.dygraph.base import to_variable
import paddle
paddle.enable_static()
def corr(x_1, def corr(x_1,
......
...@@ -16,6 +16,9 @@ import unittest ...@@ -16,6 +16,9 @@ import unittest
import paddle.fluid as fluid import paddle.fluid as fluid
from paddle.fluid import core from paddle.fluid import core
from paddle.fluid.contrib.mixed_precision import fp16_utils from paddle.fluid.contrib.mixed_precision import fp16_utils
import paddle
paddle.enable_static()
class AMPTest(unittest.TestCase): class AMPTest(unittest.TestCase):
......
...@@ -25,6 +25,8 @@ import os ...@@ -25,6 +25,8 @@ import os
import copy import copy
import numpy as np import numpy as np
paddle.enable_static()
def resnet_cifar10(input, depth=32): def resnet_cifar10(input, depth=32):
def conv_bn_layer(input, def conv_bn_layer(input,
......
...@@ -20,6 +20,9 @@ import paddle ...@@ -20,6 +20,9 @@ import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
from paddle.fluid.contrib.quantize.quantize_transpiler import _original_var_name from paddle.fluid.contrib.quantize.quantize_transpiler import _original_var_name
from paddle.fluid.contrib.quantize.quantize_transpiler import QuantizeTranspiler from paddle.fluid.contrib.quantize.quantize_transpiler import QuantizeTranspiler
import paddle
paddle.enable_static()
def linear_fc(num): def linear_fc(num):
......
...@@ -21,6 +21,8 @@ import paddle ...@@ -21,6 +21,8 @@ import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
import contextlib import contextlib
paddle.enable_static()
def get_places(): def get_places():
places = [fluid.CPUPlace()] places = [fluid.CPUPlace()]
......
...@@ -62,6 +62,8 @@ def run_check(): ...@@ -62,6 +62,8 @@ def run_check():
# Your Paddle Fluid works well on MUTIPLE GPU or CPU. # Your Paddle Fluid works well on MUTIPLE GPU or CPU.
# Your Paddle Fluid is installed successfully! Let's start deep Learning with Paddle Fluid now # Your Paddle Fluid is installed successfully! Let's start deep Learning with Paddle Fluid now
""" """
paddle.enable_static()
print("Running Verify Fluid Program ... ") print("Running Verify Fluid Program ... ")
device_list = [] device_list = []
...@@ -157,3 +159,5 @@ def run_check(): ...@@ -157,3 +159,5 @@ def run_check():
print( print(
"Your Paddle Fluid is installed successfully ONLY for SINGLE GPU or CPU! " "Your Paddle Fluid is installed successfully ONLY for SINGLE GPU or CPU! "
"\n Let's start deep Learning with Paddle Fluid now") "\n Let's start deep Learning with Paddle Fluid now")
paddle.disable_static()
...@@ -23,6 +23,8 @@ import math ...@@ -23,6 +23,8 @@ import math
import sys import sys
import os import os
paddle.enable_static()
def train(use_cuda, save_dirname, is_local): def train(use_cuda, save_dirname, is_local):
x = fluid.layers.data(name='x', shape=[13], dtype='float32') x = fluid.layers.data(name='x', shape=[13], dtype='float32')
......
...@@ -24,6 +24,8 @@ import unittest ...@@ -24,6 +24,8 @@ import unittest
import os import os
import numpy as np import numpy as np
paddle.enable_static()
def resnet_cifar10(input, depth=32): def resnet_cifar10(input, depth=32):
def conv_bn_layer(input, def conv_bn_layer(input,
......
...@@ -25,6 +25,8 @@ import paddle ...@@ -25,6 +25,8 @@ import paddle
import paddle.dataset.conll05 as conll05 import paddle.dataset.conll05 as conll05
import paddle.fluid as fluid import paddle.fluid as fluid
paddle.enable_static()
word_dict, verb_dict, label_dict = conll05.get_dict() word_dict, verb_dict, label_dict = conll05.get_dict()
word_dict_len = len(word_dict) word_dict_len = len(word_dict)
label_dict_len = len(label_dict) label_dict_len = len(label_dict)
......
...@@ -24,6 +24,8 @@ from paddle.fluid.executor import Executor ...@@ -24,6 +24,8 @@ from paddle.fluid.executor import Executor
import unittest import unittest
import os import os
paddle.enable_static()
dict_size = 30000 dict_size = 30000
source_dict_dim = target_dict_dim = dict_size source_dict_dim = target_dict_dim = dict_size
hidden_dim = 32 hidden_dim = 32
......
...@@ -26,6 +26,8 @@ import paddle ...@@ -26,6 +26,8 @@ import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
from paddle.fluid.layers.device import get_places from paddle.fluid.layers.device import get_places
paddle.enable_static()
BATCH_SIZE = 64 BATCH_SIZE = 64
......
...@@ -26,6 +26,8 @@ import paddle.fluid.nets as nets ...@@ -26,6 +26,8 @@ import paddle.fluid.nets as nets
from paddle.fluid.executor import Executor from paddle.fluid.executor import Executor
from paddle.fluid.optimizer import SGDOptimizer from paddle.fluid.optimizer import SGDOptimizer
paddle.enable_static()
IS_SPARSE = True IS_SPARSE = True
USE_GPU = False USE_GPU = False
BATCH_SIZE = 256 BATCH_SIZE = 256
......
...@@ -25,6 +25,9 @@ import math ...@@ -25,6 +25,9 @@ import math
import sys import sys
import unittest import unittest
from paddle.fluid.executor import Executor from paddle.fluid.executor import Executor
import paddle
paddle.enable_static()
dict_size = 30000 dict_size = 30000
source_dict_dim = target_dict_dim = dict_size source_dict_dim = target_dict_dim = dict_size
......
...@@ -23,6 +23,8 @@ import numpy as np ...@@ -23,6 +23,8 @@ import numpy as np
import math import math
import sys import sys
paddle.enable_static()
def train(use_cuda, is_sparse, is_parallel, save_dirname, is_local=True): def train(use_cuda, is_sparse, is_parallel, save_dirname, is_local=True):
PASS_NUM = 100 PASS_NUM = 100
......
...@@ -21,6 +21,8 @@ import contextlib ...@@ -21,6 +21,8 @@ import contextlib
import paddle import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
paddle.enable_static()
file_dir = os.path.dirname(os.path.abspath(__file__)) file_dir = os.path.dirname(os.path.abspath(__file__))
fluid.load_op_library(os.path.join(file_dir, 'librelu2_op.so')) fluid.load_op_library(os.path.join(file_dir, 'librelu2_op.so'))
......
...@@ -29,6 +29,8 @@ from paddle.fluid.contrib.decoder.beam_search_decoder import * ...@@ -29,6 +29,8 @@ from paddle.fluid.contrib.decoder.beam_search_decoder import *
import unittest import unittest
import os import os
paddle.enable_static()
dict_size = 30000 dict_size = 30000
source_dict_dim = target_dict_dim = dict_size source_dict_dim = target_dict_dim = dict_size
src_dict, trg_dict = paddle.dataset.wmt14.get_dict(dict_size) src_dict, trg_dict = paddle.dataset.wmt14.get_dict(dict_size)
......
...@@ -16,6 +16,9 @@ from __future__ import print_function ...@@ -16,6 +16,9 @@ from __future__ import print_function
import paddle.fluid as fluid import paddle.fluid as fluid
import unittest import unittest
import paddle
paddle.enable_static()
class TestDataFeeder(unittest.TestCase): class TestDataFeeder(unittest.TestCase):
......
...@@ -24,6 +24,9 @@ import numpy as np ...@@ -24,6 +24,9 @@ import numpy as np
from unittests.test_imperative_base import new_program_scope from unittests.test_imperative_base import new_program_scope
from paddle.fluid.dygraph import base from paddle.fluid.dygraph import base
from paddle.fluid import core from paddle.fluid import core
import paddle
paddle.enable_static()
class LayerTest(unittest.TestCase): class LayerTest(unittest.TestCase):
......
...@@ -22,6 +22,7 @@ BATCH_SIZE = 128 ...@@ -22,6 +22,7 @@ BATCH_SIZE = 128
CLIP_MAX = 2e-6 CLIP_MAX = 2e-6
CLIP_MIN = -1e-6 CLIP_MIN = -1e-6
paddle.enable_static()
prog = fluid.framework.Program() prog = fluid.framework.Program()
with fluid.program_guard(main_program=prog): with fluid.program_guard(main_program=prog):
......
...@@ -28,6 +28,8 @@ from paddle.fluid.layers.control_flow import ConditionalBlock ...@@ -28,6 +28,8 @@ from paddle.fluid.layers.control_flow import ConditionalBlock
import unittest import unittest
import numpy as np import numpy as np
paddle.enable_static()
class TestMNISTIfElseOp(unittest.TestCase): class TestMNISTIfElseOp(unittest.TestCase):
# FIXME: https://github.com/PaddlePaddle/Paddle/issues/12245#issuecomment-406462379 # FIXME: https://github.com/PaddlePaddle/Paddle/issues/12245#issuecomment-406462379
......
...@@ -21,6 +21,9 @@ import numpy as np ...@@ -21,6 +21,9 @@ import numpy as np
import paddle.fluid.layers as layers import paddle.fluid.layers as layers
import paddle.fluid.framework as framework import paddle.fluid.framework as framework
import paddle.fluid as fluid import paddle.fluid as fluid
import paddle
paddle.enable_static()
class TestPythonOperatorOverride(unittest.TestCase): class TestPythonOperatorOverride(unittest.TestCase):
......
...@@ -19,6 +19,9 @@ import os ...@@ -19,6 +19,9 @@ import os
import paddle.fluid.core as core import paddle.fluid.core as core
import paddle.fluid as fluid import paddle.fluid as fluid
from paddle.distributed.fleet.base.private_helper_function import wait_server_ready from paddle.distributed.fleet.base.private_helper_function import wait_server_ready
import paddle
paddle.enable_static()
class TestCCommInitOp(unittest.TestCase): class TestCCommInitOp(unittest.TestCase):
......
...@@ -28,6 +28,8 @@ import paddle ...@@ -28,6 +28,8 @@ import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
import paddle.compat as cpt import paddle.compat as cpt
paddle.enable_static()
np.random.seed(0) np.random.seed(0)
......
...@@ -35,6 +35,8 @@ import paddle.fluid.layers as layers ...@@ -35,6 +35,8 @@ import paddle.fluid.layers as layers
from functools import reduce from functools import reduce
from test_collective_api_base import TestCollectiveAPIRunnerBase, runtime_main from test_collective_api_base import TestCollectiveAPIRunnerBase, runtime_main
paddle.enable_static()
class TestCollectiveAllgatherAPI(TestCollectiveAPIRunnerBase): class TestCollectiveAllgatherAPI(TestCollectiveAPIRunnerBase):
def __init__(self): def __init__(self):
......
...@@ -34,6 +34,8 @@ import paddle.fluid.layers as layers ...@@ -34,6 +34,8 @@ import paddle.fluid.layers as layers
from functools import reduce from functools import reduce
from test_collective_base import TestCollectiveRunnerBase, runtime_main from test_collective_base import TestCollectiveRunnerBase, runtime_main
paddle.enable_static()
class TestCollectiveAllGather(TestCollectiveRunnerBase): class TestCollectiveAllGather(TestCollectiveRunnerBase):
def __init__(self): def __init__(self):
......
...@@ -35,6 +35,8 @@ import paddle.fluid.layers as layers ...@@ -35,6 +35,8 @@ import paddle.fluid.layers as layers
from functools import reduce from functools import reduce
from test_collective_api_base import TestCollectiveAPIRunnerBase, runtime_main from test_collective_api_base import TestCollectiveAPIRunnerBase, runtime_main
paddle.enable_static()
class TestCollectiveAllreduceAPI(TestCollectiveAPIRunnerBase): class TestCollectiveAllreduceAPI(TestCollectiveAPIRunnerBase):
def __init__(self): def __init__(self):
......
...@@ -35,6 +35,8 @@ import paddle.fluid.layers as layers ...@@ -35,6 +35,8 @@ import paddle.fluid.layers as layers
from functools import reduce from functools import reduce
from test_collective_base import TestCollectiveRunnerBase, runtime_main from test_collective_base import TestCollectiveRunnerBase, runtime_main
paddle.enable_static()
class TestCollectiveAllreduce(TestCollectiveRunnerBase): class TestCollectiveAllreduce(TestCollectiveRunnerBase):
def __init__(self): def __init__(self):
......
...@@ -35,6 +35,8 @@ import paddle.fluid.layers as layers ...@@ -35,6 +35,8 @@ import paddle.fluid.layers as layers
from functools import reduce from functools import reduce
from test_collective_api_base import TestCollectiveAPIRunnerBase, runtime_main from test_collective_api_base import TestCollectiveAPIRunnerBase, runtime_main
paddle.enable_static()
class TestCollectiveBarrierAPI(TestCollectiveAPIRunnerBase): class TestCollectiveBarrierAPI(TestCollectiveAPIRunnerBase):
def __init__(self): def __init__(self):
......
...@@ -35,6 +35,8 @@ import paddle.fluid.layers as layers ...@@ -35,6 +35,8 @@ import paddle.fluid.layers as layers
from functools import reduce from functools import reduce
from test_collective_api_base import TestCollectiveAPIRunnerBase, runtime_main from test_collective_api_base import TestCollectiveAPIRunnerBase, runtime_main
paddle.enable_static()
class TestCollectiveBroadcastAPI(TestCollectiveAPIRunnerBase): class TestCollectiveBroadcastAPI(TestCollectiveAPIRunnerBase):
def __init__(self): def __init__(self):
......
...@@ -35,6 +35,8 @@ import paddle.fluid.layers as layers ...@@ -35,6 +35,8 @@ import paddle.fluid.layers as layers
from functools import reduce from functools import reduce
from test_collective_base import TestCollectiveRunnerBase, runtime_main from test_collective_base import TestCollectiveRunnerBase, runtime_main
paddle.enable_static()
class TestCollectiveBroadcast(TestCollectiveRunnerBase): class TestCollectiveBroadcast(TestCollectiveRunnerBase):
def __init__(self): def __init__(self):
......
...@@ -35,6 +35,8 @@ import paddle.fluid.layers as layers ...@@ -35,6 +35,8 @@ import paddle.fluid.layers as layers
from functools import reduce from functools import reduce
from test_collective_api_base import TestCollectiveAPIRunnerBase, runtime_main from test_collective_api_base import TestCollectiveAPIRunnerBase, runtime_main
paddle.enable_static()
class TestCollectiveReduceAPI(TestCollectiveAPIRunnerBase): class TestCollectiveReduceAPI(TestCollectiveAPIRunnerBase):
def __init__(self): def __init__(self):
......
...@@ -35,6 +35,8 @@ import paddle.fluid.layers as layers ...@@ -35,6 +35,8 @@ import paddle.fluid.layers as layers
from functools import reduce from functools import reduce
from test_collective_base import TestCollectiveRunnerBase, runtime_main from test_collective_base import TestCollectiveRunnerBase, runtime_main
paddle.enable_static()
class TestCollectiveReduce(TestCollectiveRunnerBase): class TestCollectiveReduce(TestCollectiveRunnerBase):
def __init__(self): def __init__(self):
......
...@@ -35,6 +35,8 @@ import paddle.fluid.layers as layers ...@@ -35,6 +35,8 @@ import paddle.fluid.layers as layers
from functools import reduce from functools import reduce
from test_collective_base import TestCollectiveRunnerBase, runtime_main from test_collective_base import TestCollectiveRunnerBase, runtime_main
paddle.enable_static()
class TestCollectiveReduce(TestCollectiveRunnerBase): class TestCollectiveReduce(TestCollectiveRunnerBase):
def __init__(self): def __init__(self):
......
...@@ -34,6 +34,8 @@ import paddle.fluid.layers as layers ...@@ -34,6 +34,8 @@ import paddle.fluid.layers as layers
from functools import reduce from functools import reduce
from test_collective_base import TestCollectiveRunnerBase, runtime_main from test_collective_base import TestCollectiveRunnerBase, runtime_main
paddle.enable_static()
class TestCollectiveReduceScatter(TestCollectiveRunnerBase): class TestCollectiveReduceScatter(TestCollectiveRunnerBase):
def __init__(self): def __init__(self):
......
...@@ -35,6 +35,8 @@ import paddle.fluid.layers as layers ...@@ -35,6 +35,8 @@ import paddle.fluid.layers as layers
from functools import reduce from functools import reduce
from test_collective_base import TestCollectiveRunnerBase, runtime_main from test_collective_base import TestCollectiveRunnerBase, runtime_main
paddle.enable_static()
class TestCollectiveReduceScatter(TestCollectiveRunnerBase): class TestCollectiveReduceScatter(TestCollectiveRunnerBase):
def __init__(self): def __init__(self):
......
...@@ -35,6 +35,8 @@ import paddle.fluid.layers as layers ...@@ -35,6 +35,8 @@ import paddle.fluid.layers as layers
from functools import reduce from functools import reduce
from test_collective_api_base import TestCollectiveAPIRunnerBase, runtime_main from test_collective_api_base import TestCollectiveAPIRunnerBase, runtime_main
paddle.enable_static()
class TestCollectiveScatterAPI(TestCollectiveAPIRunnerBase): class TestCollectiveScatterAPI(TestCollectiveAPIRunnerBase):
def __init__(self): def __init__(self):
......
...@@ -35,6 +35,8 @@ import paddle.fluid.layers as layers ...@@ -35,6 +35,8 @@ import paddle.fluid.layers as layers
from functools import reduce from functools import reduce
from test_collective_base import TestCollectiveRunnerBase, runtime_main from test_collective_base import TestCollectiveRunnerBase, runtime_main
paddle.enable_static()
class TestCollectiveScatter(TestCollectiveRunnerBase): class TestCollectiveScatter(TestCollectiveRunnerBase):
def __init__(self): def __init__(self):
......
...@@ -30,6 +30,8 @@ import signal ...@@ -30,6 +30,8 @@ import signal
from functools import reduce from functools import reduce
from test_dist_base import TestDistRunnerBase, runtime_main from test_dist_base import TestDistRunnerBase, runtime_main
paddle.enable_static()
DTYPE = "float32" DTYPE = "float32"
paddle.dataset.mnist.fetch() paddle.dataset.mnist.fetch()
......
...@@ -30,6 +30,8 @@ import ctr_dataset_reader ...@@ -30,6 +30,8 @@ import ctr_dataset_reader
from test_dist_fleet_base import runtime_main, FleetDistRunnerBase from test_dist_fleet_base import runtime_main, FleetDistRunnerBase
from paddle.distributed.fleet.base.util_factory import fleet_util from paddle.distributed.fleet.base.util_factory import fleet_util
paddle.enable_static()
# Fix seed for test # Fix seed for test
fluid.default_startup_program().random_seed = 1 fluid.default_startup_program().random_seed = 1
fluid.default_main_program().random_seed = 1 fluid.default_main_program().random_seed = 1
......
...@@ -31,6 +31,8 @@ from test_dist_fleet_heter_base import runtime_main, FleetDistHeterRunnerBase ...@@ -31,6 +31,8 @@ from test_dist_fleet_heter_base import runtime_main, FleetDistHeterRunnerBase
from dist_fleet_ctr import TestDistCTR2x2, fake_ctr_reader from dist_fleet_ctr import TestDistCTR2x2, fake_ctr_reader
from paddle.distributed.fleet.base.util_factory import fleet_util from paddle.distributed.fleet.base.util_factory import fleet_util
paddle.enable_static()
# Fix seed for test # Fix seed for test
fluid.default_startup_program().random_seed = 1 fluid.default_startup_program().random_seed = 1
fluid.default_main_program().random_seed = 1 fluid.default_main_program().random_seed = 1
......
...@@ -34,6 +34,8 @@ from functools import reduce ...@@ -34,6 +34,8 @@ from functools import reduce
from test_dist_fleet_base import runtime_main, FleetDistRunnerBase from test_dist_fleet_base import runtime_main, FleetDistRunnerBase
from paddle.distributed.fleet.base.util_factory import fleet_util from paddle.distributed.fleet.base.util_factory import fleet_util
paddle.enable_static()
DTYPE = "int64" DTYPE = "int64"
DATA_URL = 'http://paddle-dist-ce-data.bj.bcebos.com/simnet.train.1000' DATA_URL = 'http://paddle-dist-ce-data.bj.bcebos.com/simnet.train.1000'
DATA_MD5 = '24e49366eb0611c552667989de2f57d5' DATA_MD5 = '24e49366eb0611c552667989de2f57d5'
......
...@@ -31,6 +31,8 @@ from functools import reduce ...@@ -31,6 +31,8 @@ from functools import reduce
from test_dist_base import TestDistRunnerBase, runtime_main from test_dist_base import TestDistRunnerBase, runtime_main
from paddle.fluid.incubate.fleet.collective import fleet, DistributedStrategy from paddle.fluid.incubate.fleet.collective import fleet, DistributedStrategy
paddle.enable_static()
DTYPE = "float32" DTYPE = "float32"
paddle.dataset.mnist.fetch() paddle.dataset.mnist.fetch()
......
...@@ -30,6 +30,8 @@ import sys ...@@ -30,6 +30,8 @@ import sys
import signal import signal
from test_dist_base import TestDistRunnerBase, runtime_main from test_dist_base import TestDistRunnerBase, runtime_main
paddle.enable_static()
# Fix seed for test # Fix seed for test
fluid.default_startup_program().random_seed = 1 fluid.default_startup_program().random_seed = 1
fluid.default_main_program().random_seed = 1 fluid.default_main_program().random_seed = 1
......
...@@ -17,12 +17,14 @@ import random ...@@ -17,12 +17,14 @@ import random
import time import time
import unittest import unittest
import paddle
import paddle.fluid as fluid import paddle.fluid as fluid
from paddle.fluid.dygraph import ProgramTranslator from paddle.fluid.dygraph import ProgramTranslator
from paddle.fluid.dygraph import to_variable from paddle.fluid.dygraph import to_variable
from yolov3 import cfg, YOLOv3 from yolov3 import cfg, YOLOv3
paddle.enable_static()
random.seed(0) random.seed(0)
np.random.seed(0) np.random.seed(0)
......
...@@ -15,9 +15,12 @@ ...@@ -15,9 +15,12 @@
from __future__ import print_function from __future__ import print_function
import unittest import unittest
import numpy as np import numpy as np
import paddle
from test_collective_base import TestDistBase from test_collective_base import TestDistBase
paddle.enable_static()
class TestAllGatherOp(TestDistBase): class TestAllGatherOp(TestDistBase):
def _setup_config(self): def _setup_config(self):
......
...@@ -15,9 +15,12 @@ ...@@ -15,9 +15,12 @@
from __future__ import print_function from __future__ import print_function
import unittest import unittest
import numpy as np import numpy as np
import paddle
from test_collective_base import TestDistBase from test_collective_base import TestDistBase
paddle.enable_static()
class TestAllReduceOp(TestDistBase): class TestAllReduceOp(TestDistBase):
def _setup_config(self): def _setup_config(self):
......
...@@ -31,6 +31,7 @@ from paddle.io import Dataset, BatchSampler, DataLoader ...@@ -31,6 +31,7 @@ from paddle.io import Dataset, BatchSampler, DataLoader
from paddle.fluid.tests.unittests.auto_checkpoint_utils import AutoCheckpointBase, get_logger from paddle.fluid.tests.unittests.auto_checkpoint_utils import AutoCheckpointBase, get_logger
paddle.enable_static()
logger = get_logger() logger = get_logger()
......
...@@ -32,6 +32,7 @@ from paddle.io import Dataset, BatchSampler, DataLoader ...@@ -32,6 +32,7 @@ from paddle.io import Dataset, BatchSampler, DataLoader
from paddle.fluid.tests.unittests.auto_checkpoint_utils import AutoCheckpointBase, get_logger from paddle.fluid.tests.unittests.auto_checkpoint_utils import AutoCheckpointBase, get_logger
from paddle.fluid.tests.unittests.test_auto_checkpoint import AutoCheckPointACLBase from paddle.fluid.tests.unittests.test_auto_checkpoint import AutoCheckPointACLBase
paddle.enable_static()
logger = get_logger() logger = get_logger()
......
...@@ -32,6 +32,7 @@ from paddle.io import Dataset, BatchSampler, DataLoader ...@@ -32,6 +32,7 @@ from paddle.io import Dataset, BatchSampler, DataLoader
from paddle.fluid.tests.unittests.auto_checkpoint_utils import AutoCheckpointBase, get_logger from paddle.fluid.tests.unittests.auto_checkpoint_utils import AutoCheckpointBase, get_logger
from paddle.fluid.tests.unittests.test_auto_checkpoint import AutoCheckPointACLBase from paddle.fluid.tests.unittests.test_auto_checkpoint import AutoCheckPointACLBase
paddle.enable_static()
logger = get_logger() logger = get_logger()
......
...@@ -32,6 +32,7 @@ from paddle.io import Dataset, BatchSampler, DataLoader ...@@ -32,6 +32,7 @@ from paddle.io import Dataset, BatchSampler, DataLoader
from paddle.fluid.tests.unittests.auto_checkpoint_utils import AutoCheckpointBase, get_logger from paddle.fluid.tests.unittests.auto_checkpoint_utils import AutoCheckpointBase, get_logger
from paddle.fluid.tests.unittests.test_auto_checkpoint import AutoCheckPointACLBase from paddle.fluid.tests.unittests.test_auto_checkpoint import AutoCheckPointACLBase
paddle.enable_static()
logger = get_logger() logger = get_logger()
......
...@@ -32,6 +32,7 @@ from paddle.io import Dataset, BatchSampler, DataLoader ...@@ -32,6 +32,7 @@ from paddle.io import Dataset, BatchSampler, DataLoader
from paddle.fluid.tests.unittests.auto_checkpoint_utils import AutoCheckpointBase, get_logger from paddle.fluid.tests.unittests.auto_checkpoint_utils import AutoCheckpointBase, get_logger
from paddle.fluid.tests.unittests.test_auto_checkpoint import AutoCheckPointACLBase from paddle.fluid.tests.unittests.test_auto_checkpoint import AutoCheckPointACLBase
paddle.enable_static()
logger = get_logger() logger = get_logger()
......
...@@ -32,6 +32,7 @@ from paddle.io import Dataset, BatchSampler, DataLoader ...@@ -32,6 +32,7 @@ from paddle.io import Dataset, BatchSampler, DataLoader
from paddle.fluid.tests.unittests.auto_checkpoint_utils import AutoCheckpointBase, get_logger from paddle.fluid.tests.unittests.auto_checkpoint_utils import AutoCheckpointBase, get_logger
from paddle.fluid.tests.unittests.test_auto_checkpoint import AutoCheckPointACLBase from paddle.fluid.tests.unittests.test_auto_checkpoint import AutoCheckPointACLBase
paddle.enable_static()
logger = get_logger() logger = get_logger()
......
...@@ -15,9 +15,12 @@ ...@@ -15,9 +15,12 @@
from __future__ import print_function from __future__ import print_function
import unittest import unittest
import numpy as np import numpy as np
import paddle
from test_collective_base import TestDistBase from test_collective_base import TestDistBase
paddle.enable_static()
class TestCBroadcastOp(TestDistBase): class TestCBroadcastOp(TestDistBase):
def _setup_config(self): def _setup_config(self):
......
...@@ -36,6 +36,7 @@ class InplaceTestBase(unittest.TestCase): ...@@ -36,6 +36,7 @@ class InplaceTestBase(unittest.TestCase):
self.fuse_all_optimizer_ops = False self.fuse_all_optimizer_ops = False
def setUp(self): def setUp(self):
paddle.enable_static()
self.initParameter() self.initParameter()
if self.use_cuda and fluid.core.is_compiled_with_cuda(): if self.use_cuda and fluid.core.is_compiled_with_cuda():
self.device_count = fluid.core.get_cuda_device_count() self.device_count = fluid.core.get_cuda_device_count()
......
...@@ -15,9 +15,12 @@ ...@@ -15,9 +15,12 @@
from __future__ import print_function from __future__ import print_function
import unittest import unittest
import numpy as np import numpy as np
import paddle
from test_collective_api_base import TestDistBase from test_collective_api_base import TestDistBase
paddle.enable_static()
class TestCollectiveAllgatherAPI(TestDistBase): class TestCollectiveAllgatherAPI(TestDistBase):
def _setup_config(self): def _setup_config(self):
......
...@@ -15,9 +15,12 @@ ...@@ -15,9 +15,12 @@
from __future__ import print_function from __future__ import print_function
import unittest import unittest
import numpy as np import numpy as np
import paddle
from test_collective_api_base import TestDistBase from test_collective_api_base import TestDistBase
paddle.enable_static()
class TestCollectiveAllreduceAPI(TestDistBase): class TestCollectiveAllreduceAPI(TestDistBase):
def _setup_config(self): def _setup_config(self):
......
...@@ -15,9 +15,12 @@ ...@@ -15,9 +15,12 @@
from __future__ import print_function from __future__ import print_function
import unittest import unittest
import numpy as np import numpy as np
import paddle
from test_collective_api_base import TestDistBase from test_collective_api_base import TestDistBase
paddle.enable_static()
class TestCollectiveBarrierAPI(TestDistBase): class TestCollectiveBarrierAPI(TestDistBase):
def _setup_config(self): def _setup_config(self):
......
...@@ -15,9 +15,12 @@ ...@@ -15,9 +15,12 @@
from __future__ import print_function from __future__ import print_function
import unittest import unittest
import numpy as np import numpy as np
import paddle
from test_collective_api_base import TestDistBase from test_collective_api_base import TestDistBase
paddle.enable_static()
class TestCollectiveBroadcastAPI(TestDistBase): class TestCollectiveBroadcastAPI(TestDistBase):
def _setup_config(self): def _setup_config(self):
......
...@@ -15,9 +15,12 @@ ...@@ -15,9 +15,12 @@
from __future__ import print_function from __future__ import print_function
import unittest import unittest
import numpy as np import numpy as np
import paddle
from test_collective_base import TestDistBase from test_collective_base import TestDistBase
paddle.enable_static()
class TestCReduceOp(TestDistBase): class TestCReduceOp(TestDistBase):
def _setup_config(self): def _setup_config(self):
......
...@@ -15,9 +15,12 @@ ...@@ -15,9 +15,12 @@
from __future__ import print_function from __future__ import print_function
import unittest import unittest
import numpy as np import numpy as np
import paddle
from test_collective_api_base import TestDistBase from test_collective_api_base import TestDistBase
paddle.enable_static()
class TestCollectiveReduceAPI(TestDistBase): class TestCollectiveReduceAPI(TestDistBase):
def _setup_config(self): def _setup_config(self):
......
...@@ -15,9 +15,12 @@ ...@@ -15,9 +15,12 @@
from __future__ import print_function from __future__ import print_function
import unittest import unittest
import numpy as np import numpy as np
import paddle
from test_collective_base import TestDistBase from test_collective_base import TestDistBase
paddle.enable_static()
class TestCScatterOp(TestDistBase): class TestCScatterOp(TestDistBase):
def _setup_config(self): def _setup_config(self):
......
...@@ -15,9 +15,12 @@ ...@@ -15,9 +15,12 @@
from __future__ import print_function from __future__ import print_function
import unittest import unittest
import numpy as np import numpy as np
import paddle
from test_collective_api_base import TestDistBase from test_collective_api_base import TestDistBase
paddle.enable_static()
class TestCollectiveScatterAPI(TestDistBase): class TestCollectiveScatterAPI(TestDistBase):
def _setup_config(self): def _setup_config(self):
......
...@@ -28,6 +28,8 @@ import paddle.fluid as fluid ...@@ -28,6 +28,8 @@ import paddle.fluid as fluid
import paddle.distributed.fleet.base.role_maker as role_maker import paddle.distributed.fleet.base.role_maker as role_maker
import paddle.distributed.fleet as fleet import paddle.distributed.fleet as fleet
paddle.enable_static()
class TestCommunicatorGeoEnd2End(unittest.TestCase): class TestCommunicatorGeoEnd2End(unittest.TestCase):
def net(self): def net(self):
...@@ -140,6 +142,7 @@ import paddle.distributed.fleet as fleet ...@@ -140,6 +142,7 @@ import paddle.distributed.fleet as fleet
from test_communicator_geo import TestCommunicatorGeoEnd2End from test_communicator_geo import TestCommunicatorGeoEnd2End
paddle.enable_static()
class RunServer(TestCommunicatorGeoEnd2End): class RunServer(TestCommunicatorGeoEnd2End):
def runTest(self): def runTest(self):
......
...@@ -29,6 +29,8 @@ import paddle.fluid.incubate.fleet.base.role_maker as role_maker ...@@ -29,6 +29,8 @@ import paddle.fluid.incubate.fleet.base.role_maker as role_maker
from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler import fleet from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler import fleet
from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler.distributed_strategy import StrategyFactory from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler.distributed_strategy import StrategyFactory
paddle.enable_static()
class TestCommunicatorHalfAsyncEnd2End(unittest.TestCase): class TestCommunicatorHalfAsyncEnd2End(unittest.TestCase):
def net(self): def net(self):
...@@ -120,6 +122,7 @@ from test_communicator_half_async import TestCommunicatorHalfAsyncEnd2End ...@@ -120,6 +122,7 @@ from test_communicator_half_async import TestCommunicatorHalfAsyncEnd2End
from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler import fleet from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler import fleet
from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler.distributed_strategy import StrategyFactory from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler.distributed_strategy import StrategyFactory
paddle.enable_static()
class RunServer(TestCommunicatorHalfAsyncEnd2End): class RunServer(TestCommunicatorHalfAsyncEnd2End):
def runTest(self): def runTest(self):
......
...@@ -15,6 +15,9 @@ ...@@ -15,6 +15,9 @@
from __future__ import print_function from __future__ import print_function
import unittest import unittest
from test_dist_base import TestDistBase from test_dist_base import TestDistBase
import paddle
paddle.enable_static()
class TestDistMnistNCCL2(TestDistBase): class TestDistMnistNCCL2(TestDistBase):
......
...@@ -19,6 +19,8 @@ import unittest ...@@ -19,6 +19,8 @@ import unittest
import paddle import paddle
import paddle.distributed.fleet.base.role_maker as role_maker import paddle.distributed.fleet.base.role_maker as role_maker
paddle.enable_static()
class TestFleetGradientMergeMetaOptimizer(unittest.TestCase): class TestFleetGradientMergeMetaOptimizer(unittest.TestCase):
def setUp(self): def setUp(self):
......
...@@ -18,6 +18,8 @@ import os ...@@ -18,6 +18,8 @@ import os
import paddle.distributed.fleet.base.role_maker as role_maker import paddle.distributed.fleet.base.role_maker as role_maker
import time import time
paddle.enable_static()
class TestFleetGradientMergeMetaOptimizer(unittest.TestCase): class TestFleetGradientMergeMetaOptimizer(unittest.TestCase):
def setUp(self): def setUp(self):
......
...@@ -18,6 +18,8 @@ import os ...@@ -18,6 +18,8 @@ import os
import paddle.distributed.fleet.base.role_maker as role_maker import paddle.distributed.fleet.base.role_maker as role_maker
import time import time
paddle.enable_static()
class TestFleetGradientMergeMetaOptimizer(unittest.TestCase): class TestFleetGradientMergeMetaOptimizer(unittest.TestCase):
def setUp(self): def setUp(self):
......
...@@ -18,6 +18,8 @@ import os ...@@ -18,6 +18,8 @@ import os
import paddle.distributed.fleet.base.role_maker as role_maker import paddle.distributed.fleet.base.role_maker as role_maker
import time import time
paddle.enable_static()
class TestFleetGradientMergeMetaOptimizer(unittest.TestCase): class TestFleetGradientMergeMetaOptimizer(unittest.TestCase):
def setUp(self): def setUp(self):
......
...@@ -18,6 +18,8 @@ import os ...@@ -18,6 +18,8 @@ import os
import paddle.distributed.fleet.base.role_maker as role_maker import paddle.distributed.fleet.base.role_maker as role_maker
import time import time
paddle.enable_static()
class TestFleetGradientMergeMetaOptimizer(unittest.TestCase): class TestFleetGradientMergeMetaOptimizer(unittest.TestCase):
def setUp(self): def setUp(self):
......
...@@ -19,6 +19,8 @@ import paddle.distributed.fleet as fleet ...@@ -19,6 +19,8 @@ import paddle.distributed.fleet as fleet
import paddle.distributed.fleet.base.role_maker as role_maker import paddle.distributed.fleet.base.role_maker as role_maker
import time import time
paddle.enable_static()
class TestFleetGradientMergeMetaOptimizer(unittest.TestCase): class TestFleetGradientMergeMetaOptimizer(unittest.TestCase):
def setUp(self): def setUp(self):
......
...@@ -22,6 +22,9 @@ from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler import f ...@@ -22,6 +22,9 @@ from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler import f
from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler.distributed_strategy import StrategyFactory from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler.distributed_strategy import StrategyFactory
from test_dist_fleet_base import TestFleetBase from test_dist_fleet_base import TestFleetBase
from dist_fleet_simnet_bow import train_network from dist_fleet_simnet_bow import train_network
import paddle
paddle.enable_static()
class TestDistGeoCtr_2x2(TestFleetBase): class TestDistGeoCtr_2x2(TestFleetBase):
......
...@@ -18,6 +18,9 @@ import os ...@@ -18,6 +18,9 @@ import os
import unittest import unittest
import tempfile import tempfile
from test_dist_fleet_heter_base import TestFleetHeterBase from test_dist_fleet_heter_base import TestFleetHeterBase
import paddle
paddle.enable_static()
class TestDistHeterDatasetAsync2x2(TestFleetHeterBase): class TestDistHeterDatasetAsync2x2(TestFleetHeterBase):
......
...@@ -21,6 +21,9 @@ import paddle.fluid as fluid ...@@ -21,6 +21,9 @@ import paddle.fluid as fluid
import paddle.distributed.fleet.base.role_maker as role_maker import paddle.distributed.fleet.base.role_maker as role_maker
from paddle.distributed.fleet.base.util_factory import fleet_util from paddle.distributed.fleet.base.util_factory import fleet_util
from paddle.distributed.fleet import fleet from paddle.distributed.fleet import fleet
import paddle
paddle.enable_static()
class TestDistFleetHeterProgram(unittest.TestCase): class TestDistFleetHeterProgram(unittest.TestCase):
......
...@@ -19,6 +19,9 @@ import paddle.fluid as fluid ...@@ -19,6 +19,9 @@ import paddle.fluid as fluid
import paddle.fluid.incubate.fleet.base.role_maker as role_maker import paddle.fluid.incubate.fleet.base.role_maker as role_maker
from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler import fleet from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler import fleet
from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler.distributed_strategy import StrategyFactory from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler.distributed_strategy import StrategyFactory
import paddle
paddle.enable_static()
# For Net # For Net
base_lr = 0.2 base_lr = 0.2
......
...@@ -24,6 +24,8 @@ import paddle.fluid as fluid ...@@ -24,6 +24,8 @@ import paddle.fluid as fluid
import paddle.distributed.fleet.base.role_maker as role_maker import paddle.distributed.fleet.base.role_maker as role_maker
import paddle.distributed.fleet as fleet import paddle.distributed.fleet as fleet
paddle.enable_static()
# For Net # For Net
base_lr = 0.2 base_lr = 0.2
emb_lr = base_lr * 3 emb_lr = base_lr * 3
......
...@@ -19,6 +19,9 @@ import paddle.fluid as fluid ...@@ -19,6 +19,9 @@ import paddle.fluid as fluid
import paddle.fluid.incubate.fleet.base.role_maker as role_maker import paddle.fluid.incubate.fleet.base.role_maker as role_maker
from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler import fleet from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler import fleet
from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler.distributed_strategy import StrategyFactory from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler.distributed_strategy import StrategyFactory
import paddle
paddle.enable_static()
# For Net # For Net
base_lr = 0.2 base_lr = 0.2
......
...@@ -19,6 +19,9 @@ import paddle.fluid as fluid ...@@ -19,6 +19,9 @@ import paddle.fluid as fluid
import paddle.fluid.incubate.fleet.base.role_maker as role_maker import paddle.fluid.incubate.fleet.base.role_maker as role_maker
from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler import fleet from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler import fleet
from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler.distributed_strategy import StrategyFactory from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler.distributed_strategy import StrategyFactory
import paddle
paddle.enable_static()
# For Net # For Net
base_lr = 0.2 base_lr = 0.2
......
...@@ -19,6 +19,9 @@ import paddle.fluid as fluid ...@@ -19,6 +19,9 @@ import paddle.fluid as fluid
import paddle.fluid.incubate.fleet.base.role_maker as role_maker import paddle.fluid.incubate.fleet.base.role_maker as role_maker
from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler import fleet from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler import fleet
from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler.distributed_strategy import StrategyFactory from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler.distributed_strategy import StrategyFactory
import paddle
paddle.enable_static()
# For Net # For Net
base_lr = 0.2 base_lr = 0.2
......
...@@ -18,6 +18,9 @@ import os ...@@ -18,6 +18,9 @@ import os
import unittest import unittest
import tempfile import tempfile
from test_dist_fleet_base import TestFleetBase from test_dist_fleet_base import TestFleetBase
import paddle
paddle.enable_static()
class TestDistSimnetASync2x2(TestFleetBase): class TestDistSimnetASync2x2(TestFleetBase):
......
...@@ -15,6 +15,9 @@ ...@@ -15,6 +15,9 @@
from __future__ import print_function from __future__ import print_function
import unittest import unittest
from test_dist_base import TestDistBase from test_dist_base import TestDistBase
import paddle
paddle.enable_static()
class TestDistMnistNCCL2BackWardDeps(TestDistBase): class TestDistMnistNCCL2BackWardDeps(TestDistBase):
......
...@@ -16,6 +16,9 @@ from __future__ import print_function ...@@ -16,6 +16,9 @@ from __future__ import print_function
import unittest import unittest
from test_dist_base import TestDistBase from test_dist_base import TestDistBase
import os import os
import paddle
paddle.enable_static()
flag_name = os.path.splitext(__file__)[0] flag_name = os.path.splitext(__file__)[0]
......
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册