diff --git a/python/paddle/fluid/tests/unittests/collective/collective_allgather_api.py b/python/paddle/fluid/tests/unittests/collective/collective_allgather_api.py index 4821ff2e1ffbd455bddca8c530a5d6468f9d12bc..a69e6c59e0edc3de31f3b00d37f00c369c04de4f 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_allgather_api.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_allgather_api.py @@ -12,26 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse import os import sys -import signal -import time -import socket -from contextlib import closing -from six import string_types -import math import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -import paddle.fluid.unique_name as nameGen -from paddle.fluid import core -import unittest import pickle -from multiprocessing import Process import paddle.fluid.layers as layers -from functools import reduce import test_collective_api_base as test_base paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective/collective_allgather_api_dygraph.py b/python/paddle/fluid/tests/unittests/collective/collective_allgather_api_dygraph.py index 2491297a7e1c34356d2358d5ea3dcef2b7482ce1..11fe3e4c0259a11c672d199017600d00013246b2 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_allgather_api_dygraph.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_allgather_api_dygraph.py @@ -14,7 +14,6 @@ import paddle import paddle.fluid as fluid -import unittest import test_collective_api_base as test_base diff --git a/python/paddle/fluid/tests/unittests/collective/collective_allreduce_api.py b/python/paddle/fluid/tests/unittests/collective/collective_allreduce_api.py index 8a178f052673c21fa15106b865258cd88c10d950..9c86afc5f4b0a4fa05e8980aac17198050376f0c 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_allreduce_api.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_allreduce_api.py @@ -12,25 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse -import os -import sys -import signal -import time -import socket -from contextlib import closing -from six import string_types -import math import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -import paddle.fluid.unique_name as nameGen -from paddle.fluid import core -import unittest -from multiprocessing import Process import paddle.fluid.layers as layers -from functools import reduce from test_collective_api_base import TestCollectiveAPIRunnerBase, runtime_main paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective/collective_allreduce_api_dygraph.py b/python/paddle/fluid/tests/unittests/collective/collective_allreduce_api_dygraph.py index 933e9e9838ed4b439f798bec7d40fef3ed715c43..44446bd84a1646399230fbb4022ae669e9f198b4 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_allreduce_api_dygraph.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_allreduce_api_dygraph.py @@ -14,7 +14,6 @@ import paddle import paddle.fluid as fluid -import unittest import test_collective_api_base as test_base diff --git a/python/paddle/fluid/tests/unittests/collective/collective_allreduce_new_group_api.py b/python/paddle/fluid/tests/unittests/collective/collective_allreduce_new_group_api.py index e3c476c838aaa256c42a532419e565e59efc74a0..5eb983c890583cd62ebeda678555a58406b164e8 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_allreduce_new_group_api.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_allreduce_new_group_api.py @@ -12,25 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse -import os -import sys -import signal -import time -import socket -from contextlib import closing -from six import string_types -import math import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -import paddle.fluid.unique_name as nameGen -from paddle.fluid import core -import unittest -from multiprocessing import Process import paddle.fluid.layers as layers -from functools import reduce from test_collective_api_base import TestCollectiveAPIRunnerBase, runtime_main paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective/collective_allreduce_op.py b/python/paddle/fluid/tests/unittests/collective/collective_allreduce_op.py index 4ac28943d9b90ff789623ff973542776456c85f1..a88b73ce04aacf533ad0a16b55fdb5faf82ae003 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_allreduce_op.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_allreduce_op.py @@ -12,25 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse -import os -import sys -import signal -import time -import socket -from contextlib import closing -from six import string_types -import math import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -import paddle.fluid.unique_name as nameGen from paddle.fluid import core -import unittest -from multiprocessing import Process import paddle.fluid.layers as layers -from functools import reduce from test_collective_base import TestCollectiveRunnerBase, runtime_main paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective/collective_allreduce_op_wait.py b/python/paddle/fluid/tests/unittests/collective/collective_allreduce_op_wait.py index f8bfa41c41cda9848a5bc1e2c7dc9ed956ae82b6..10b867df69ac9c7eedc79a0fef136151df638274 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_allreduce_op_wait.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_allreduce_op_wait.py @@ -12,25 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse -import os -import sys -import signal -import time -import socket -from contextlib import closing -from six import string_types -import math import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -import paddle.fluid.unique_name as nameGen from paddle.fluid import core -import unittest -from multiprocessing import Process import paddle.fluid.layers as layers -from functools import reduce from test_collective_base import TestCollectiveRunnerBase, runtime_main paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective/collective_alltoall_api.py b/python/paddle/fluid/tests/unittests/collective/collective_alltoall_api.py index ec9b70a5f6057722cac208ebae5f1bff08a25ffe..57fbc69429a9ab2c45d44909adecee6a2c049df5 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_alltoall_api.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_alltoall_api.py @@ -12,25 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse -import os -import sys -import signal -import time -import socket -from contextlib import closing -from six import string_types -import math import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -import paddle.fluid.unique_name as nameGen -from paddle.fluid import core -import unittest -from multiprocessing import Process import paddle.fluid.layers as layers -from functools import reduce from test_collective_api_base import TestCollectiveAPIRunnerBase, runtime_main paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective/collective_alltoall_api_dygraph.py b/python/paddle/fluid/tests/unittests/collective/collective_alltoall_api_dygraph.py index c8078dd47ff63e03485667d38553f12f764b4417..e0589072ab2ad4ccf913b06618093f0faddc00be 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_alltoall_api_dygraph.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_alltoall_api_dygraph.py @@ -12,25 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse -import os -import sys -import signal -import time -import socket -from contextlib import closing -from six import string_types -import math import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -import paddle.fluid.unique_name as nameGen -from paddle.fluid import core -import unittest -from multiprocessing import Process -import paddle.fluid.layers as layers -from functools import reduce from test_collective_api_base import TestCollectiveAPIRunnerBase, runtime_main diff --git a/python/paddle/fluid/tests/unittests/collective/collective_alltoall_single.py b/python/paddle/fluid/tests/unittests/collective/collective_alltoall_single.py index 1f5311e2e83b7f0a00ab3599aaf11938e64c5fb3..e0e0fc74d3767079bd1c4b8323a350742c85f80c 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_alltoall_single.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_alltoall_single.py @@ -16,11 +16,7 @@ import unittest import paddle import numpy as np -import random import paddle.distributed as dist -import paddle.fluid as fluid -import paddle.distributed.fleet as fleet -from paddle import framework class TestCollectiveAllToAllSingle(unittest.TestCase): diff --git a/python/paddle/fluid/tests/unittests/collective/collective_barrier_api.py b/python/paddle/fluid/tests/unittests/collective/collective_barrier_api.py index f7313d56bba75065b3966c0e455026c1631b6470..43fcca0155b3ff9ae66eeb53d001d204a00dbfa1 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_barrier_api.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_barrier_api.py @@ -12,25 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse -import os -import sys -import signal -import time -import socket -from contextlib import closing -from six import string_types -import math import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -import paddle.fluid.unique_name as nameGen -from paddle.fluid import core -import unittest -from multiprocessing import Process -import paddle.fluid.layers as layers -from functools import reduce from test_collective_api_base import TestCollectiveAPIRunnerBase, runtime_main paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective/collective_batch_isend_irecv.py b/python/paddle/fluid/tests/unittests/collective/collective_batch_isend_irecv.py index 5550ac9c454c25c68db390482308de03a6492f0a..2226d302291ca3a57592fbd513d07dc7f938ac54 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_batch_isend_irecv.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_batch_isend_irecv.py @@ -16,11 +16,7 @@ import unittest import paddle import numpy as np -import random import paddle.distributed as dist -import paddle.fluid as fluid -import paddle.distributed.fleet as fleet -from paddle import framework class TestCollectiveBatchIsendIrecv(unittest.TestCase): diff --git a/python/paddle/fluid/tests/unittests/collective/collective_broadcast_api.py b/python/paddle/fluid/tests/unittests/collective/collective_broadcast_api.py index 4ac5ab6038cc5f09a00c8971ed4fef0b086b157c..0a14a53660955098e6e20e11b71daa1c5dfbe9d8 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_broadcast_api.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_broadcast_api.py @@ -12,25 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse -import os -import sys -import signal -import time -import socket -from contextlib import closing -from six import string_types -import math import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -import paddle.fluid.unique_name as nameGen -from paddle.fluid import core -import unittest -from multiprocessing import Process import paddle.fluid.layers as layers -from functools import reduce from test_collective_api_base import TestCollectiveAPIRunnerBase, runtime_main paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective/collective_broadcast_api_dygraph.py b/python/paddle/fluid/tests/unittests/collective/collective_broadcast_api_dygraph.py index 7357af66935491e9312a7cfc3eed11c60e88f577..acb1b4a5866c84dbba42ab2df420747f842e3f28 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_broadcast_api_dygraph.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_broadcast_api_dygraph.py @@ -14,7 +14,6 @@ import paddle import paddle.fluid as fluid -import unittest import test_collective_api_base as test_base diff --git a/python/paddle/fluid/tests/unittests/collective/collective_broadcast_op.py b/python/paddle/fluid/tests/unittests/collective/collective_broadcast_op.py index eb10c4a7e0aed8f961cc7323adb35debbae968d3..ff99792c9428af6a1c1488d084fec091beb32461 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_broadcast_op.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_broadcast_op.py @@ -12,25 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse -import os -import sys -import signal -import time -import socket -from contextlib import closing -from six import string_types -import math import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -import paddle.fluid.unique_name as nameGen from paddle.fluid import core -import unittest -from multiprocessing import Process import paddle.fluid.layers as layers -from functools import reduce from test_collective_base import TestCollectiveRunnerBase, runtime_main paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective/collective_concat_op.py b/python/paddle/fluid/tests/unittests/collective/collective_concat_op.py index 62e61449d37e6cf5e130167a7c4639797dc0627a..34d49aeb284d3b3909059cb2834f9731f9c0d6c6 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_concat_op.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_concat_op.py @@ -12,24 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse -import os -import sys -import signal -import time -from contextlib import closing -from six import string_types -import math import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -import paddle.fluid.unique_name as nameGen from paddle.fluid import core -import unittest -from multiprocessing import Process import paddle.fluid.layers as layers -from functools import reduce from test_collective_base import TestCollectiveRunnerBase, runtime_main paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective/collective_global_gather.py b/python/paddle/fluid/tests/unittests/collective/collective_global_gather.py index 52daf6296914cae807c95d2c50c08ce4d400571d..4403e06681b644ebac348fef8dc0cccacadf8d71 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_global_gather.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_global_gather.py @@ -17,8 +17,6 @@ import os import sys import paddle import paddle.fluid as fluid -import unittest -import paddle.fluid.layers as layers from test_collective_api_base import TestCollectiveAPIRunnerBase, runtime_main import pickle from paddle.fluid.framework import _enable_legacy_dygraph diff --git a/python/paddle/fluid/tests/unittests/collective/collective_global_gather_dygraph.py b/python/paddle/fluid/tests/unittests/collective/collective_global_gather_dygraph.py index bf01a7b9998f43e73b4817edf266639167bda2a2..acba43268f2d4d85e9cd28bae38a92de2b7e8c19 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_global_gather_dygraph.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_global_gather_dygraph.py @@ -14,11 +14,8 @@ import numpy as np import os -import sys import paddle import paddle.fluid as fluid -import unittest -import paddle.fluid.layers as layers from test_collective_api_base import TestCollectiveAPIRunnerBase, runtime_main import paddle.distributed.utils.moe_utils as moe_utils diff --git a/python/paddle/fluid/tests/unittests/collective/collective_global_scatter.py b/python/paddle/fluid/tests/unittests/collective/collective_global_scatter.py index 90a206428029a7d2d947c572b719a81334a3cac2..a7103d3c641866e9464ba662d0a503244776796a 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_global_scatter.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_global_scatter.py @@ -17,8 +17,6 @@ import os import sys import paddle import paddle.fluid as fluid -import unittest -import paddle.fluid.layers as layers from test_collective_api_base import TestCollectiveAPIRunnerBase, runtime_main import pickle import paddle.distributed.utils.moe_utils as moe_utils diff --git a/python/paddle/fluid/tests/unittests/collective/collective_global_scatter_dygraph.py b/python/paddle/fluid/tests/unittests/collective/collective_global_scatter_dygraph.py index 6695ee391f4e25eb8038547fa156a5efce11a4b0..b90905d5d397e707ae1df459ed5b06c8366e5398 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_global_scatter_dygraph.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_global_scatter_dygraph.py @@ -14,11 +14,8 @@ import numpy as np import os -import sys import paddle import paddle.fluid as fluid -import unittest -import paddle.fluid.layers as layers from test_collective_api_base import TestCollectiveAPIRunnerBase, runtime_main import paddle.distributed.utils.moe_utils as moe_utils diff --git a/python/paddle/fluid/tests/unittests/collective/collective_identity_op.py b/python/paddle/fluid/tests/unittests/collective/collective_identity_op.py index 960ee36c4eb5baf6eb323d7836310286e5f87acd..0486ea616421a09ad6aa825e9000f342825ef795 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_identity_op.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_identity_op.py @@ -12,24 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse -import os -import sys -import signal -import time -from contextlib import closing -from six import string_types -import math import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -import paddle.fluid.unique_name as nameGen from paddle.fluid import core -import unittest -from multiprocessing import Process import paddle.fluid.layers as layers -from functools import reduce from test_collective_base import TestCollectiveRunnerBase, runtime_main paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective/collective_isend_irecv_api_dygraph.py b/python/paddle/fluid/tests/unittests/collective/collective_isend_irecv_api_dygraph.py index 0a034b6e629d029efddead7de8c81dc9baac5584..5434706234535c0ced2188e3c3fa1c19856316d0 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_isend_irecv_api_dygraph.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_isend_irecv_api_dygraph.py @@ -14,7 +14,6 @@ import paddle import paddle.fluid as fluid -import unittest import test_collective_api_base as test_base diff --git a/python/paddle/fluid/tests/unittests/collective/collective_reduce_api.py b/python/paddle/fluid/tests/unittests/collective/collective_reduce_api.py index df3f269303423e674c888f4853ad26053126dd20..83f4e3458624ae9ba03fb2520ca01ad190e60985 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_reduce_api.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_reduce_api.py @@ -12,25 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse -import os -import sys -import signal -import time -import socket -from contextlib import closing -from six import string_types -import math import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -import paddle.fluid.unique_name as nameGen -from paddle.fluid import core -import unittest -from multiprocessing import Process import paddle.fluid.layers as layers -from functools import reduce from test_collective_api_base import TestCollectiveAPIRunnerBase, runtime_main paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective/collective_reduce_api_dygraph.py b/python/paddle/fluid/tests/unittests/collective/collective_reduce_api_dygraph.py index c2489bbcfcfa62204a31b2acc8eae0ec5da8963b..5525bd8fa4aab50517d68a238d130b184567b5f3 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_reduce_api_dygraph.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_reduce_api_dygraph.py @@ -14,7 +14,6 @@ import paddle import paddle.fluid as fluid -import unittest import test_collective_api_base as test_base diff --git a/python/paddle/fluid/tests/unittests/collective/collective_reduce_op.py b/python/paddle/fluid/tests/unittests/collective/collective_reduce_op.py index 436591be1187401123259eacd74860a977d6c802..d30b845098ce51c36ae2c20f63d7d5888cddec89 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_reduce_op.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_reduce_op.py @@ -12,25 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse -import os -import sys -import signal -import time -import socket -from contextlib import closing -from six import string_types -import math import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -import paddle.fluid.unique_name as nameGen from paddle.fluid import core -import unittest -from multiprocessing import Process import paddle.fluid.layers as layers -from functools import reduce from test_collective_base import TestCollectiveRunnerBase, runtime_main paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective/collective_reduce_op_calc_stream.py b/python/paddle/fluid/tests/unittests/collective/collective_reduce_op_calc_stream.py index 98b7ecb8aeb5b2fc3ff373ad862aebdcca37fe98..ab3fe725df849ba7cf37e8cad8a66b08b0f02232 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_reduce_op_calc_stream.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_reduce_op_calc_stream.py @@ -12,25 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse -import os -import sys -import signal -import time -import socket -from contextlib import closing -from six import string_types -import math import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -import paddle.fluid.unique_name as nameGen from paddle.fluid import core -import unittest -from multiprocessing import Process import paddle.fluid.layers as layers -from functools import reduce from test_collective_base import TestCollectiveRunnerBase, runtime_main paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective/collective_reduce_scatter.py b/python/paddle/fluid/tests/unittests/collective/collective_reduce_scatter.py index 5ece0b65657126aa73330c94d1c43e8024cf11cb..d7c67e60a46ab404a3249a41b6512a1450e3a110 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_reduce_scatter.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_reduce_scatter.py @@ -16,11 +16,7 @@ import unittest import paddle import numpy as np -import random import paddle.distributed as dist -import paddle.fluid as fluid -import paddle.distributed.fleet as fleet -from paddle import framework class TestCollectiveReduceScatter(unittest.TestCase): diff --git a/python/paddle/fluid/tests/unittests/collective/collective_reduce_scatter_api_dygraph.py b/python/paddle/fluid/tests/unittests/collective/collective_reduce_scatter_api_dygraph.py index c5c07fe307a7569efb041c3a23fa091d782c95ac..19777260b6e89019caee2054a5b091a2e651d033 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_reduce_scatter_api_dygraph.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_reduce_scatter_api_dygraph.py @@ -14,7 +14,6 @@ import paddle import paddle.fluid as fluid -import unittest import test_collective_api_base as test_base diff --git a/python/paddle/fluid/tests/unittests/collective/collective_scatter_api.py b/python/paddle/fluid/tests/unittests/collective/collective_scatter_api.py index 863bcdac7f7d501a82acaa5d9234ba57225dcf73..f198ae467d560ed68d78160fc5790abfaa395f6a 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_scatter_api.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_scatter_api.py @@ -12,25 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse -import os -import sys -import signal -import time -import socket -from contextlib import closing -from six import string_types -import math import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -import paddle.fluid.unique_name as nameGen -from paddle.fluid import core -import unittest -from multiprocessing import Process import paddle.fluid.layers as layers -from functools import reduce from test_collective_api_base import TestCollectiveAPIRunnerBase, runtime_main paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective/collective_scatter_api_dygraph.py b/python/paddle/fluid/tests/unittests/collective/collective_scatter_api_dygraph.py index 5647a4c5b925515538f440cc233f107221c03907..fa65928967bdf288751fab1a9f829fc86bf77134 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_scatter_api_dygraph.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_scatter_api_dygraph.py @@ -14,7 +14,6 @@ import paddle import paddle.fluid as fluid -import unittest import test_collective_api_base as test_base diff --git a/python/paddle/fluid/tests/unittests/collective/collective_scatter_op.py b/python/paddle/fluid/tests/unittests/collective/collective_scatter_op.py index 790e858cf83c3dce2a5fdcb064d7b36652d78e04..4a8a1acfe5f8cfb456dc8aae34f3e80b5f1dfc08 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_scatter_op.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_scatter_op.py @@ -12,25 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse -import os -import sys -import signal -import time -import socket -from contextlib import closing -from six import string_types -import math import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -import paddle.fluid.unique_name as nameGen from paddle.fluid import core -import unittest -from multiprocessing import Process import paddle.fluid.layers as layers -from functools import reduce from test_collective_base import TestCollectiveRunnerBase, runtime_main paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective/collective_sendrecv_api.py b/python/paddle/fluid/tests/unittests/collective/collective_sendrecv_api.py index 5cbb2a125f5dbc367e6fdc0ea40cc0e3f27f9e32..d22080e8cdf535da71bb799887411fd95ca85a79 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_sendrecv_api.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_sendrecv_api.py @@ -12,25 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse -import os -import sys -import signal -import time -import socket -from contextlib import closing -from six import string_types -import math import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -import paddle.fluid.unique_name as nameGen -from paddle.fluid import core -import unittest -from multiprocessing import Process import paddle.fluid.layers as layers -from functools import reduce from test_collective_api_base import TestCollectiveAPIRunnerBase, runtime_main paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective/collective_sendrecv_api_dygraph.py b/python/paddle/fluid/tests/unittests/collective/collective_sendrecv_api_dygraph.py index 16e36716370f1053ccb3f7bd0c6d453b9ab09d2f..ac8ffde7a48b380a29f8a1218b4ed30058377f9a 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_sendrecv_api_dygraph.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_sendrecv_api_dygraph.py @@ -12,25 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse -import os -import sys -import signal -import time -import socket -from contextlib import closing -from six import string_types -import math import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -import paddle.fluid.unique_name as nameGen -from paddle.fluid import core -import unittest -from multiprocessing import Process -import paddle.fluid.layers as layers -from functools import reduce from test_collective_api_base import TestCollectiveAPIRunnerBase, runtime_main diff --git a/python/paddle/fluid/tests/unittests/collective/collective_sendrecv_op.py b/python/paddle/fluid/tests/unittests/collective/collective_sendrecv_op.py index f889bca82bff7cc762cb5e117d2d8f6dfdcd5d04..6324e619f9ea53afa56b8933380a0cee368eed18 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_sendrecv_op.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_sendrecv_op.py @@ -12,25 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse -import os -import sys -import signal -import time -import socket -from contextlib import closing -from six import string_types -import math import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -import paddle.fluid.unique_name as nameGen -from paddle.fluid import core -import unittest -from multiprocessing import Process import paddle.fluid.layers as layers -from functools import reduce from test_collective_base import TestCollectiveRunnerBase, runtime_main paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective/collective_sendrecv_op_array.py b/python/paddle/fluid/tests/unittests/collective/collective_sendrecv_op_array.py index 383dc02cb89891b896b58c5461f685f21271013b..ec12db6f5be04bd3ec939d879ca64e402bd34031 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_sendrecv_op_array.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_sendrecv_op_array.py @@ -13,24 +13,9 @@ # limitations under the License. import numpy as np -import argparse -import os -import sys -import signal -import time -import socket -from contextlib import closing -from six import string_types -import math import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -import paddle.fluid.unique_name as nameGen -from paddle.fluid import core -import unittest -from multiprocessing import Process import paddle.fluid.layers as layers -from functools import reduce from test_collective_base import TestCollectiveRunnerBase, runtime_main paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective/collective_sendrecv_op_dynamic_shape.py b/python/paddle/fluid/tests/unittests/collective/collective_sendrecv_op_dynamic_shape.py index 7ade8867585ab125049d0bdd0f8a141983d8feca..da6ef74c11460b5560d5f42bb57a7c770181e349 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_sendrecv_op_dynamic_shape.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_sendrecv_op_dynamic_shape.py @@ -12,25 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse -import os -import sys -import signal -import time -import socket -from contextlib import closing -from six import string_types -import math import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -import paddle.fluid.unique_name as nameGen -from paddle.fluid import core -import unittest -from multiprocessing import Process import paddle.fluid.layers as layers -from functools import reduce from test_collective_base import TestCollectiveRunnerBase, runtime_main paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective/collective_split_op.py b/python/paddle/fluid/tests/unittests/collective/collective_split_op.py index cd27fe0548b6fedbec4f0c83375e1888bab3cf4a..2e71ccf304939533cb77cd57c9976d0cc2c71377 100644 --- a/python/paddle/fluid/tests/unittests/collective/collective_split_op.py +++ b/python/paddle/fluid/tests/unittests/collective/collective_split_op.py @@ -12,24 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse -import os -import sys -import signal -import time -from contextlib import closing -from six import string_types -import math import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -import paddle.fluid.unique_name as nameGen from paddle.fluid import core -import unittest -from multiprocessing import Process import paddle.fluid.layers as layers -from functools import reduce from test_collective_base import TestCollectiveRunnerBase, runtime_main paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective/column_parallel_linear_api.py b/python/paddle/fluid/tests/unittests/collective/column_parallel_linear_api.py index ba836c388d0aff3c631e2d5f9cffbaefad780a83..5f6178dbfd65204bc2ced4e7b37cc937fd294605 100644 --- a/python/paddle/fluid/tests/unittests/collective/column_parallel_linear_api.py +++ b/python/paddle/fluid/tests/unittests/collective/column_parallel_linear_api.py @@ -13,26 +13,9 @@ # limitations under the License. import numpy as np -import argparse -import os -import sys -import signal -import time -import socket -from contextlib import closing -from six import string_types -import math import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -import paddle.fluid.unique_name as nameGen -from paddle.fluid import core import paddle.distributed.fleet as fleet -from paddle.fluid.incubate.fleet.base import role_maker -import unittest -from multiprocessing import Process -import paddle.fluid.layers as layers -from functools import reduce from test_collective_api_base import TestCollectiveAPIRunnerBase, runtime_main paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective/communication_stream_allreduce_api_dygraph.py b/python/paddle/fluid/tests/unittests/collective/communication_stream_allreduce_api_dygraph.py index 92ef3365d5198e587e836cd4c07f6cc94dee2241..abf455203517d86a181b58cc95c7c0e0c10e293d 100644 --- a/python/paddle/fluid/tests/unittests/collective/communication_stream_allreduce_api_dygraph.py +++ b/python/paddle/fluid/tests/unittests/collective/communication_stream_allreduce_api_dygraph.py @@ -15,9 +15,7 @@ import os import numpy as np import paddle -import paddle.fluid as fluid import paddle.distributed as dist -import test_communication_api_base as test_base import test_collective_api_base as test_collective_base diff --git a/python/paddle/fluid/tests/unittests/collective/communication_stream_sendrecv_api_dygraph.py b/python/paddle/fluid/tests/unittests/collective/communication_stream_sendrecv_api_dygraph.py index 175e24c3d0d86131ad009b784e6fa4036fa8f56a..a666e6cfe0a3e65880cfce9639a6e46dd2437aca 100644 --- a/python/paddle/fluid/tests/unittests/collective/communication_stream_sendrecv_api_dygraph.py +++ b/python/paddle/fluid/tests/unittests/collective/communication_stream_sendrecv_api_dygraph.py @@ -16,9 +16,7 @@ import os import numpy as np import paddle import paddle.distributed as dist -import paddle.fluid as fluid import test_collective_api_base as test_collective_base -import test_communication_api_base as test_base class StreamSendRecvTestCase(): diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/auto_parallel_parallelizer.py b/python/paddle/fluid/tests/unittests/collective/fleet/auto_parallel_parallelizer.py index 600a3c82c8fd19b1f0416d92b5aec10840d3413d..185e2c23fed953d0090922c3e1b1d73d5bf86ff5 100755 --- a/python/paddle/fluid/tests/unittests/collective/fleet/auto_parallel_parallelizer.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/auto_parallel_parallelizer.py @@ -22,7 +22,6 @@ import paddle.utils as utils from paddle.fluid import layers from paddle.distributed import fleet from paddle.distributed.fleet import auto -from paddle.distributed.auto_parallel.utils import print_program_with_dist_attr import paddle.fluid.core as core paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/c_comm_init_op.py b/python/paddle/fluid/tests/unittests/collective/fleet/c_comm_init_op.py index 718af4f7aa88f56edf49ec169b039e191202a3b0..4c981156ebb74b86efc0942e58c0f1b13b3b3ac9 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/c_comm_init_op.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/c_comm_init_op.py @@ -14,7 +14,6 @@ import unittest import os -import paddle.fluid.core as core import paddle.fluid as fluid from paddle.distributed.fleet.base.private_helper_function import wait_server_ready import paddle diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_api.py b/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_api.py index 35be51213607b555b6a428a29b7d720e3603ccf9..bac023a8e7d95d621512a31a52c0049f10f31e27 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_api.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_api.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import time import shutil import tempfile import numpy as np @@ -21,7 +20,6 @@ import paddle import paddle.fluid as fluid from paddle.fluid.dygraph.nn import Linear from paddle.distributed import fleet -from paddle.fluid.dygraph import nn from paddle.fluid.framework import _test_eager_guard from paddle.distributed.sharding import group_sharded_parallel, save_group_sharded_model diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_api_eager.py b/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_api_eager.py index 5de9b5ecea084b8ccc19ccf2a0938dfce573f97b..f733fa1c6def6440c971386fcdfb003063bbc7da 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_api_eager.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_api_eager.py @@ -12,16 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -import time -import shutil import tempfile import numpy as np import paddle import paddle.fluid as fluid from paddle.fluid.dygraph.nn import Linear -from paddle.distributed import fleet -from paddle.fluid.dygraph import nn from paddle.fluid.framework import _test_eager_guard from paddle.distributed.sharding import group_sharded_parallel, save_group_sharded_model diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage2.py b/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage2.py index f4cc451c40a78745221096e5f08742ad083c87ff..40767d6fa86fcd6c97466b746d75730d79bff390 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage2.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage2.py @@ -17,15 +17,10 @@ import os import shutil import numpy as np -import argparse import tempfile -import ast -import time import paddle import paddle.fluid as fluid from paddle.fluid.dygraph.nn import Linear -from paddle.distributed import fleet -from paddle.fluid.dygraph import nn from paddle.fluid.framework import _test_eager_guard from paddle.distributed.fleet.meta_parallel.sharding.group_sharded_optimizer_stage2 import GroupShardedOptimizerStage2 diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage2_comm_overlap.py b/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage2_comm_overlap.py index 7208372b6c08544d53e67a32c7b7baef7272eed2..883874c9cd2f99aa50ea24b9c3787f5f5f647aad 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage2_comm_overlap.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage2_comm_overlap.py @@ -17,15 +17,10 @@ import os import shutil import numpy as np -import argparse import tempfile -import ast -import time import paddle import paddle.fluid as fluid from paddle.fluid.dygraph.nn import Linear -from paddle.distributed import fleet -from paddle.fluid.dygraph import nn from paddle.fluid.framework import _test_eager_guard from paddle.distributed.fleet.meta_parallel.sharding.group_sharded_optimizer_stage2 import GroupShardedOptimizerStage2 diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage2_offload.py b/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage2_offload.py index 060b856505f638f4405f859a9be6fae7c057691d..3420114d3f9bebff5176114d9b6c159115e955c9 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage2_offload.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage2_offload.py @@ -15,14 +15,7 @@ # limitations under the License. import numpy as np -import argparse -import ast -import time import paddle -import paddle.fluid as fluid -from paddle.fluid.dygraph.nn import Linear -from paddle.distributed import fleet -from paddle.fluid.dygraph import nn from paddle.fluid.framework import _test_eager_guard from paddle.distributed.fleet.meta_parallel.sharding.group_sharded_optimizer_stage2 import GroupShardedOptimizerStage2 diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage3.py b/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage3.py index 31b56cdfb8c7dce45539ff44904e9de87f0f92c7..fe629541376d21261ed8449fccbecfed2071dc0a 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage3.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage3.py @@ -18,14 +18,9 @@ import os import shutil import tempfile import numpy as np -import argparse -import ast -import time import paddle import paddle.fluid as fluid from paddle.fluid.dygraph.nn import Linear -from paddle.distributed import fleet -from paddle.fluid.dygraph import nn from paddle.fluid.framework import _test_eager_guard from paddle.distributed.fleet.meta_parallel.sharding.group_sharded_optimizer_stage2 import GroupShardedOptimizerStage2 diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage3_offload.py b/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage3_offload.py index da84fb67ca9c68d9e7066165ea65d77a1608905d..2c586b56946f29612d3cc6d198146eb011f4335c 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage3_offload.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage3_offload.py @@ -15,14 +15,9 @@ # limitations under the License. import numpy as np -import argparse -import ast -import time import paddle import paddle.fluid as fluid from paddle.fluid.dygraph.nn import Linear -from paddle.distributed import fleet -from paddle.fluid.dygraph import nn from paddle.fluid.framework import _test_eager_guard from paddle.distributed.fleet.meta_parallel.sharding.group_sharded_stage3 import GroupShardedStage3 diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_optimizer_stage2.py b/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_optimizer_stage2.py index 22d001c7c4633859a712a48bbc09add1cff2bf80..2f5a73830d7067f297975b8c7192b7c693d2e823 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_optimizer_stage2.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_optimizer_stage2.py @@ -14,11 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os import numpy as np -import argparse -import ast -import time import paddle import paddle.fluid as fluid from paddle.fluid.dygraph.nn import Linear diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_stage2.py b/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_stage2.py index 756b1bfb6074d44ffa415ac7ec0709b6399953fa..a025030af2d6cf8f0e214a61f8f74b1a33b7af45 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_stage2.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_stage2.py @@ -17,15 +17,11 @@ import os import shutil import numpy as np -import argparse import tempfile -import ast -import time import paddle import paddle.fluid as fluid from paddle.fluid.dygraph.nn import Linear from paddle.distributed import fleet -from paddle.fluid.dygraph import nn from paddle.fluid.framework import _test_eager_guard from paddle.distributed.fleet.meta_optimizers.dygraph_optimizer.sharding_optimizer_stage2 import ShardingOptimizerStage2 diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_stage2_offload.py b/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_stage2_offload.py index 1acdce548d580f42caba8dd10f04cf7dc8d3c249..7469591c9ed5ba24d01b36bf5ea7888b57ec5375 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_stage2_offload.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_stage2_offload.py @@ -15,14 +15,8 @@ # limitations under the License. import numpy as np -import argparse -import ast -import time import paddle -import paddle.fluid as fluid -from paddle.fluid.dygraph.nn import Linear from paddle.distributed import fleet -from paddle.fluid.dygraph import nn from paddle.fluid.framework import _test_eager_guard from paddle.distributed.fleet.meta_optimizers.dygraph_optimizer.sharding_optimizer_stage2 import ShardingOptimizerStage2 diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_stage3.py b/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_stage3.py index c48e7a36424cce81c53f0aca9973cb51b89aa893..4e9bc7a1cace6093ec1ea7b95323391bc87ea0ce 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_stage3.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_stage3.py @@ -18,14 +18,10 @@ import os import shutil import tempfile import numpy as np -import argparse -import ast -import time import paddle import paddle.fluid as fluid from paddle.fluid.dygraph.nn import Linear from paddle.distributed import fleet -from paddle.fluid.dygraph import nn from paddle.fluid.framework import _test_eager_guard from paddle.distributed.fleet.meta_optimizers.dygraph_optimizer.sharding_optimizer_stage2 import ShardingOptimizerStage2 diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_stage3_offload.py b/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_stage3_offload.py index 19c0c91c20df87a0c979694bd10c8cb427475a7e..d56ec33694b074d73c1d67c0c10c14b521b9cea4 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_stage3_offload.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_stage3_offload.py @@ -15,14 +15,10 @@ # limitations under the License. import numpy as np -import argparse -import ast -import time import paddle import paddle.fluid as fluid from paddle.fluid.dygraph.nn import Linear from paddle.distributed import fleet -from paddle.fluid.dygraph import nn from paddle.fluid.framework import _test_eager_guard from paddle.distributed.fleet.meta_parallel.sharding.sharding_stage3 import ShardingStage3 diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_communicate_group.py b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_communicate_group.py index d84ad27e2636d238d5dba282fdb88f34736e4364..0e81b08a7ebd78743e28bafd7da44f6facd5ba88 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_communicate_group.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_communicate_group.py @@ -13,7 +13,6 @@ # limitations under the License. import numpy as np -import os import paddle from paddle.distributed import fleet diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_inference_helper.py b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_inference_helper.py index c6d37d2c53cc5633da3e3a3d7159c673eeb48f2d..da9823184512f5a267e1e8a674a6f037e13844c8 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_inference_helper.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_inference_helper.py @@ -17,12 +17,8 @@ import unittest import os import paddle import numpy as np -import random import paddle.fluid.layers as layers -import paddle.distributed as dist -import paddle.fluid as fluid import paddle.distributed.fleet as fleet -from paddle import framework from paddle.distributed.fleet.utils.hybrid_parallel_inference import HybridParallelInferenceHelper paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_amp.py b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_amp.py index 3101012feb3440a39d10215bdf5e3b574dac7b80..4906a1c86cac5285b3438c77019fc2ee8a8acb8f 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_amp.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_amp.py @@ -13,7 +13,6 @@ # limitations under the License. import paddle -import numpy as np from hybrid_parallel_mp_model import TestDistMPTraning import paddle.distributed.fleet as fleet import unittest diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_clip_grad.py b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_clip_grad.py index d490db2864fc29e388a155b744b67a669c93c6d0..c9bff4a261d20bbe27a864363f7a2d62d92068fc 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_clip_grad.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_clip_grad.py @@ -13,10 +13,8 @@ # limitations under the License. import paddle -import numpy as np from hybrid_parallel_mp_model import TestDistMPTraning import unittest -import logging #log = logging.getLogger("HybridParallel") #log.setLevel(logging.WARNING) diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_fp16.py b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_fp16.py index ef8b2c5a6a925d76fb8a64ef84899fc0b4b20def..611e85ed4a8f548c510234ebdbd1ff12edc7fb99 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_fp16.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_fp16.py @@ -13,7 +13,6 @@ # limitations under the License. import paddle -import numpy as np from hybrid_parallel_mp_model import TestDistMPTraning import paddle.distributed.fleet as fleet import unittest diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_layers.py b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_layers.py index 8629f36882a89fe5d522d747770e9567ae8e6967..5f20209da4af8779ed3c8f3750a0ac40df3b2f98 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_layers.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_layers.py @@ -20,7 +20,6 @@ import random import paddle.distributed as dist import paddle.fluid as fluid import paddle.distributed.fleet as fleet -from paddle import framework def set_random_seed(seed): diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_model.py b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_model.py index 797ae874250cd9519db8ba1774435e094babb695..707bd95a4902e09a607021040ca667b56d1bf8fc 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_model.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_model.py @@ -18,7 +18,6 @@ import random import paddle.distributed as dist import paddle.fluid as fluid import paddle.distributed.fleet as fleet -from paddle.io import DataLoader, Dataset import unittest diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_random.py b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_random.py index 982d25dec125e4ebd94b68a55f42edc7c9af74ef..f779b3298b8dcadbbf7d846adafe260e6bb99497 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_random.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_random.py @@ -16,10 +16,7 @@ import unittest import paddle import numpy as np -import paddle.distributed as dist -import paddle.fluid as fluid import paddle.distributed.fleet as fleet -import random class TestDistTraning(unittest.TestCase): diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_pp_layer_with_virtual_stage.py b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_pp_layer_with_virtual_stage.py index 137dde6891a708511608014e1e3f24e585b994ed..73807abdc18c8b429a2a92831dd0349312c85203 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_pp_layer_with_virtual_stage.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_pp_layer_with_virtual_stage.py @@ -13,8 +13,6 @@ # limitations under the License. import unittest -import numpy as np -import os import paddle from paddle.distributed import fleet import paddle.nn as nn diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_pp_save_load.py b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_pp_save_load.py index a3d8314d343cc5904bf8bfb714e8e5de1eed53ef..5d52093a86f20778b314bdd638f137f27f21e4d2 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_pp_save_load.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_pp_save_load.py @@ -15,7 +15,6 @@ import unittest import paddle import numpy as np -import random import os import shutil import tempfile diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_pp_save_load_with_virtual_stage.py b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_pp_save_load_with_virtual_stage.py index 1fdc8502684688ef6bc97cba1f697e57ec20141b..f71e2511a2023f9a67d7be7d044dffff55978ff8 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_pp_save_load_with_virtual_stage.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_pp_save_load_with_virtual_stage.py @@ -15,7 +15,6 @@ import unittest import paddle import numpy as np -import random import os import shutil import tempfile diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_qat.py b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_qat.py index e3904ac6d7237cd640d040e116f71e965262bbd9..03e357993493f44928c34eb487d013ae9e6eb96c 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_qat.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_qat.py @@ -12,18 +12,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os import paddle import numpy as np import random import paddle.distributed as dist import paddle.fluid as fluid import paddle.distributed.fleet as fleet -from paddle.io import DataLoader, Dataset import unittest import paddle.nn as nn from paddle.fluid.contrib.slim.quantization import ImperativeQuantAware -from paddle.distributed.utils.launch_utils import find_free_ports, watch_local_trainers, get_cluster, TrainerProc +from paddle.distributed.utils.launch_utils import find_free_ports, get_cluster def set_random_seed(seed, dp_id, rank_id): diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_sharding_model.py b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_sharding_model.py index 0c61a7a559a1789d7de9b705da409a56f17c6eea..96a7825dc801cf290cdf85df2fa7cf7e0096603e 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_sharding_model.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_sharding_model.py @@ -18,7 +18,6 @@ import random import paddle.distributed as dist import paddle.fluid as fluid import paddle.distributed.fleet as fleet -from paddle.io import DataLoader, Dataset from paddle.distributed.fleet.meta_optimizers.dygraph_optimizer.dygraph_sharding_optimizer import DygraphShardingOptimizer import unittest diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_shared_weight.py b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_shared_weight.py index 7b5503d67594f25ebe7475b640a43d946c8f9170..1696b966d7c52d76d86d151cd414478703397682 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_shared_weight.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_shared_weight.py @@ -19,7 +19,6 @@ import random import paddle import paddle.distributed as dist import paddle.distributed.fleet as fleet -from paddle.fluid.dygraph.container import Sequential from paddle.distributed.fleet.meta_parallel import PipelineLayer from paddle.fluid.dygraph.layers import Layer import paddle.nn as nn diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/new_group.py b/python/paddle/fluid/tests/unittests/collective/fleet/new_group.py index 28a2568f8e594c36e58110024bb386c86edd25fd..b6e537681b21354765f24fb987aad2f376c832b8 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/new_group.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/new_group.py @@ -13,7 +13,6 @@ # limitations under the License. import numpy as np -import os import paddle diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/parallel_class_center_sample.py b/python/paddle/fluid/tests/unittests/collective/fleet/parallel_class_center_sample.py index 489a5050dd6ff2ed9c75655d54750ece97bc0129..ef7f54409872a3e5e6364561850322d5334c4c1e 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/parallel_class_center_sample.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/parallel_class_center_sample.py @@ -18,9 +18,7 @@ import paddle import numpy as np import random import paddle.distributed as dist -import paddle.fluid as fluid import paddle.distributed.fleet as fleet -from paddle import framework def set_random_seed(seed): diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_control_flow_different.py b/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_control_flow_different.py index 39ebd7ead36f0a0db89df66dba063f1323f6bc10..24a29f2a71149769b27418b281cf67b53e24f2e4 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_control_flow_different.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_control_flow_different.py @@ -13,7 +13,6 @@ # limitations under the License. import numpy as np -import paddle.distributed as dist import paddle import paddle.fluid as fluid diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_control_flow_same.py b/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_control_flow_same.py index faef02bd6c7e6f27b500730f66a1ede64fb99a9b..8b9aaf5294369d877400d2e58685634ea65200f3 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_control_flow_same.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_control_flow_same.py @@ -12,15 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import contextlib -import unittest import numpy as np import paddle import paddle.fluid as fluid -import paddle.fluid.dygraph as dygraph -from paddle.fluid import core -from paddle.fluid.optimizer import SGDOptimizer from paddle.fluid.dygraph.nn import Linear from paddle.fluid.dygraph.base import to_variable diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_no_sync.py b/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_no_sync.py index 17f8a0d8d9099d27fc21e60644a98738825c4032..b00639202a684e2a6b3d3e02a42e24493ba76759 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_no_sync.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_no_sync.py @@ -13,21 +13,13 @@ # limitations under the License. import os -import contextlib -import unittest import numpy as np -import six -import pickle import random import paddle import paddle.fluid as fluid import paddle.distributed as dist -import paddle.fluid.dygraph as dygraph -from paddle.fluid.dygraph.parallel import ParallelEnv -from paddle.fluid import core from paddle.fluid.dygraph.nn import Linear -from paddle.fluid.framework import _test_eager_guard from test_dist_base import print_to_err, print_to_out, runtime_main, TestParallelDyGraphRunnerBase seed = 90 diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_no_sync_control_flow.py b/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_no_sync_control_flow.py index d7938ae680e8a0e96029bb55fb29aa98b83870d8..afbb4cf01229b233270de1fea95d677b2076cb2b 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_no_sync_control_flow.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_no_sync_control_flow.py @@ -12,19 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os -import contextlib -import unittest import numpy as np -import six -import pickle -import random import paddle import paddle.fluid as fluid -import paddle.distributed as dist -import paddle.fluid.dygraph as dygraph -from paddle.fluid import core from paddle.fluid.dygraph.nn import Linear from test_dist_base import runtime_main from parallel_dygraph_no_sync import TestNoSync diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_no_sync_unused_params.py b/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_no_sync_unused_params.py index d4572017fb0bbf087c2255f9ca622ffe46a1347b..bd8e598baf165435f565a4bf010233d1db0af357 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_no_sync_unused_params.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_no_sync_unused_params.py @@ -12,19 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os -import contextlib -import unittest import numpy as np -import six -import pickle -import random import paddle import paddle.fluid as fluid -import paddle.distributed as dist -import paddle.fluid.dygraph as dygraph -from paddle.fluid import core from paddle.fluid.dygraph.nn import Linear from test_dist_base import runtime_main from parallel_dygraph_no_sync import TestNoSync diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_se_resnext.py b/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_se_resnext.py index b05755dcedde8e75d69e5779e85b1adad286c5af..09878cec229748e7ac4e89a7a3484dfd6fdf4c4b 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_se_resnext.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_se_resnext.py @@ -12,22 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os -import contextlib -import unittest import numpy as np -import six -import pickle -import sys import paddle import paddle.fluid as fluid -import paddle.fluid.dygraph as dygraph -from paddle.fluid import core -from paddle.fluid.optimizer import SGDOptimizer -from paddle.fluid.dygraph.nn import Conv2D, Pool2D, Linear, BatchNorm +from paddle.fluid.dygraph.nn import Conv2D, Linear, Pool2D from paddle.fluid.dygraph.base import to_variable -from paddle.fluid.layer_helper import LayerHelper import math from test_dist_base import runtime_main, TestParallelDyGraphRunnerBase diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_sync_batch_norm.py b/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_sync_batch_norm.py index 0989518fb5b164a54eef032eb8b687a6e8c967e7..6d1f100252ca445f8da07b24e013bac56827df54 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_sync_batch_norm.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_sync_batch_norm.py @@ -12,19 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os -import contextlib -import unittest import numpy as np -import six -import pickle import paddle import paddle.fluid as fluid -import paddle.fluid.dygraph as dygraph -from paddle.fluid import core -from paddle.fluid.optimizer import SGDOptimizer -from paddle.nn import Conv2D, Linear, SyncBatchNorm +from paddle.nn import Conv2D, SyncBatchNorm from paddle.fluid.dygraph.base import to_variable from test_dist_base import runtime_main, TestParallelDyGraphRunnerBase diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/parallel_margin_cross_entropy.py b/python/paddle/fluid/tests/unittests/collective/fleet/parallel_margin_cross_entropy.py index e900158b5067cd58f57012bd8bd88121a348cfff..9d852785f6db0c52c6dc22162ef28859d9243e64 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/parallel_margin_cross_entropy.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/parallel_margin_cross_entropy.py @@ -18,9 +18,7 @@ import paddle import numpy as np import random import paddle.distributed as dist -import paddle.fluid as fluid import paddle.distributed.fleet as fleet -from paddle import framework def set_random_seed(seed): diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/pipeline_mnist.py b/python/paddle/fluid/tests/unittests/collective/fleet/pipeline_mnist.py index d3fcf5abf3418dab140e8a9452a2c5eaa70969fe..bd4e761a7a1d4d13adbfd9532db52afa2579f5b5 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/pipeline_mnist.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/pipeline_mnist.py @@ -12,19 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse -import time -import math - import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -from paddle.fluid import core -import unittest -from multiprocessing import Process -import os -import signal from functools import reduce from test_dist_base import TestDistRunnerBase, runtime_main import paddle.distributed.fleet as fleet diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/pipeline_mnist_multi_device.py b/python/paddle/fluid/tests/unittests/collective/fleet/pipeline_mnist_multi_device.py index 6d2d0c2281e001df476376a1a20ad917cce07f87..1933b55f023a83d86a8b5cddeb8741780e5703f5 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/pipeline_mnist_multi_device.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/pipeline_mnist_multi_device.py @@ -12,19 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse -import time -import math - import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -from paddle.fluid import core -import unittest -from multiprocessing import Process -import os -import signal from functools import reduce from test_dist_base import TestDistRunnerBase, runtime_main import paddle.distributed.fleet as fleet diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/pipeline_mnist_one_device.py b/python/paddle/fluid/tests/unittests/collective/fleet/pipeline_mnist_one_device.py index 1df4aa4fc1d6e8e0f0a0bc6ae671ed0ad38d6e08..33964a6400e245421766acae87f75d1de52bf694 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/pipeline_mnist_one_device.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/pipeline_mnist_one_device.py @@ -12,19 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse -import time -import math - import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -from paddle.fluid import core -import unittest -from multiprocessing import Process -import os -import signal from functools import reduce from test_dist_base import TestDistRunnerBase, runtime_main import paddle.distributed.fleet as fleet diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/static_model_parallel_by_col.py b/python/paddle/fluid/tests/unittests/collective/fleet/static_model_parallel_by_col.py index a8ae0aad642fb0fd6d0c4b28c81fab44f42b355c..40ec79b9844f1a6cda62c48b1810e4361d2a487f 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/static_model_parallel_by_col.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/static_model_parallel_by_col.py @@ -13,19 +13,9 @@ # limitations under the License. import numpy as np -import argparse -import time -import math import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -from paddle.fluid import core -import unittest -from multiprocessing import Process -import os -import signal -from functools import reduce from test_dist_base import TestDistRunnerBase, runtime_main import paddle.distributed.fleet as fleet diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/static_model_parallel_by_row.py b/python/paddle/fluid/tests/unittests/collective/fleet/static_model_parallel_by_row.py index 75e222b206dabeaaeeb4b713e4bdec45a3645d9c..c14dd021729c34d1dbe346f4188a2cbe12c83222 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/static_model_parallel_by_row.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/static_model_parallel_by_row.py @@ -13,19 +13,9 @@ # limitations under the License. import numpy as np -import argparse -import time -import math import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -from paddle.fluid import core -import unittest -from multiprocessing import Process -import os -import signal -from functools import reduce from test_dist_base import TestDistRunnerBase, runtime_main import paddle.distributed.fleet as fleet diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/static_model_parallel_embedding.py b/python/paddle/fluid/tests/unittests/collective/fleet/static_model_parallel_embedding.py index 9c86943fe46e83dc178c81d6af927f8890d800e5..f147190a5d22c43f64a73c593071071f3b0e7484 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/static_model_parallel_embedding.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/static_model_parallel_embedding.py @@ -13,19 +13,9 @@ # limitations under the License. import numpy as np -import argparse -import time -import math import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -from paddle.fluid import core -import unittest -from multiprocessing import Process -import os -import signal -from functools import reduce from test_dist_base import TestDistRunnerBase, runtime_main import paddle.distributed.fleet as fleet diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_auto_checkpoint.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_auto_checkpoint.py index ce1dfa743645a052dd5df21a8405148b863cc366..3a06bc29d0f110f280684324739b70299ad2b584 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_auto_checkpoint.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_auto_checkpoint.py @@ -14,20 +14,11 @@ import unittest import paddle -import paddle.fluid as fluid -import paddle.fluid.incubate.fleet.base.role_maker as role_maker -from paddle.fluid.incubate.fleet.collective import CollectiveOptimizer, fleet import os -import sys from paddle.distributed.fleet.utils.fs import LocalFS, HDFSClient import paddle.fluid.incubate.checkpoint.auto_checkpoint as acp from paddle.fluid.incubate.checkpoint.checkpoint_saver import PaddleModel -from paddle.fluid.framework import program_guard -from paddle.fluid import unique_name - -import numpy as np -from paddle.io import Dataset, BatchSampler, DataLoader from paddle.fluid.tests.unittests.auto_checkpoint_utils import AutoCheckpointBase, get_logger diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_auto_checkpoint1.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_auto_checkpoint1.py index 1f0cec309c54c4e25b36a1595b53eadea7382705..2db7b1e8f80682670d2ed4cf48d6df45479f95a9 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_auto_checkpoint1.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_auto_checkpoint1.py @@ -14,22 +14,9 @@ import unittest import paddle -import paddle.fluid as fluid -import paddle.fluid.incubate.fleet.base.role_maker as role_maker -from paddle.fluid.incubate.fleet.collective import CollectiveOptimizer, fleet import os -import sys -from paddle.distributed.fleet.utils.fs import LocalFS, HDFSClient -import paddle.fluid.incubate.checkpoint.auto_checkpoint as acp -from paddle.fluid.incubate.checkpoint.checkpoint_saver import PaddleModel -from paddle.fluid.framework import program_guard -from paddle.fluid import unique_name - -import numpy as np -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 get_logger from test_auto_checkpoint import AutoCheckPointACLBase paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_auto_checkpoint2.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_auto_checkpoint2.py index 846b31d3fa8d13e7de99519d672e1ed3fe522b55..96b538ee9b846eb8af59a337e30795b7973bef71 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_auto_checkpoint2.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_auto_checkpoint2.py @@ -14,22 +14,9 @@ import unittest import paddle -import paddle.fluid as fluid -import paddle.fluid.incubate.fleet.base.role_maker as role_maker -from paddle.fluid.incubate.fleet.collective import CollectiveOptimizer, fleet import os -import sys -from paddle.distributed.fleet.utils.fs import LocalFS, HDFSClient -import paddle.fluid.incubate.checkpoint.auto_checkpoint as acp -from paddle.fluid.incubate.checkpoint.checkpoint_saver import PaddleModel -from paddle.fluid.framework import program_guard -from paddle.fluid import unique_name - -import numpy as np -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 get_logger from test_auto_checkpoint import AutoCheckPointACLBase paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_auto_checkpoint3.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_auto_checkpoint3.py index d6f11df20b29d5170a9e35b507488be44289c20d..0e75f8e0c477380d62a8c17b64f6eb970265d898 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_auto_checkpoint3.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_auto_checkpoint3.py @@ -14,22 +14,9 @@ import unittest import paddle -import paddle.fluid as fluid -import paddle.fluid.incubate.fleet.base.role_maker as role_maker -from paddle.fluid.incubate.fleet.collective import CollectiveOptimizer, fleet import os -import sys -from paddle.distributed.fleet.utils.fs import LocalFS, HDFSClient -import paddle.fluid.incubate.checkpoint.auto_checkpoint as acp -from paddle.fluid.incubate.checkpoint.checkpoint_saver import PaddleModel -from paddle.fluid.framework import program_guard -from paddle.fluid import unique_name - -import numpy as np -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 get_logger from test_auto_checkpoint import AutoCheckPointACLBase paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_auto_checkpoint_dist_basic.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_auto_checkpoint_dist_basic.py index 4949f4728eaf34313f2f7e0088d2a9fdd8453b10..331f6b104509ea81cfe7b36db4fe474705e701d7 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_auto_checkpoint_dist_basic.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_auto_checkpoint_dist_basic.py @@ -16,20 +16,13 @@ import unittest import paddle import paddle.fluid as fluid import paddle.fluid.incubate.fleet.base.role_maker as role_maker -from paddle.fluid.incubate.fleet.collective import CollectiveOptimizer, fleet +from paddle.fluid.incubate.fleet.collective import fleet import os -import sys from paddle.distributed.fleet.utils.fs import LocalFS, HDFSClient import paddle.fluid.incubate.checkpoint.auto_checkpoint as acp -from paddle.fluid.incubate.checkpoint.checkpoint_saver import PaddleModel -from paddle.fluid.framework import program_guard -from paddle.fluid import unique_name -import numpy as np -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 get_logger from test_auto_checkpoint import AutoCheckPointACLBase paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_auto_checkpoint_multiple.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_auto_checkpoint_multiple.py index 65de718a487da50f0c1e3fbe52e0f140563c58f1..61e0733aa84a1cc1017f8d2cab7a7bda01a24f20 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_auto_checkpoint_multiple.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_auto_checkpoint_multiple.py @@ -14,22 +14,12 @@ import unittest import paddle -import paddle.fluid as fluid -import paddle.fluid.incubate.fleet.base.role_maker as role_maker -from paddle.fluid.incubate.fleet.collective import CollectiveOptimizer, fleet import os -import sys from paddle.distributed.fleet.utils.fs import LocalFS, HDFSClient import paddle.fluid.incubate.checkpoint.auto_checkpoint as acp -from paddle.fluid.incubate.checkpoint.checkpoint_saver import PaddleModel -from paddle.fluid.framework import program_guard -from paddle.fluid import unique_name -import numpy as np -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 get_logger from test_auto_checkpoint import AutoCheckPointACLBase paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_auto_parallel_parallelizer.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_auto_parallel_parallelizer.py index 3bf6c0c91955c8bdcbf8e44e8b787f7ba74fe385..2937dc33dde7868b2fee796ca13a66576ce4cd3c 100755 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_auto_parallel_parallelizer.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_auto_parallel_parallelizer.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import paddle.fluid as fluid from test_parallel_dygraph_dataparallel import TestMultipleGpus diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_communicator_half_async.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_communicator_half_async.py index f7f804eece26a00f7ff49381bd06e07bd24e91d4..ab5bd396d2c2ccea1647ebc3c6d2f7e7987fbbc3 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_communicator_half_async.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_communicator_half_async.py @@ -14,8 +14,6 @@ import os import sys -import time -import threading import subprocess import unittest import numpy diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_dgc_optimizer.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_dgc_optimizer.py index 567d8bacb8eb9d357b0f2f7426e60bdfe80ef32d..50f1b389a0a4706721b1e01f60fb637cf020e169 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_dgc_optimizer.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_dgc_optimizer.py @@ -19,8 +19,6 @@ import paddle.fluid.framework as framework import paddle.fluid.optimizer as optimizer import paddle.fluid.regularizer as regularizer import paddle.fluid.clip as clip -import paddle.compat as cpt -from paddle.fluid.backward import append_backward paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_group_sharded_api.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_group_sharded_api.py index dac26e4e0536d78a4988d05c06a3890b81b1a36f..1302c322ce7a06ee1198cff54170b4749e70e37b 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_group_sharded_api.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_group_sharded_api.py @@ -17,7 +17,6 @@ import os os.environ['FLAGS_enable_eager_mode'] = '0' import unittest -import paddle.fluid as fluid from test_parallel_dygraph_dataparallel import TestMultipleGpus diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_group_sharded_api_for_eager.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_group_sharded_api_for_eager.py index 48ecf71d7693ab166e96e9b7c9792d8ca6183b47..a8b9a3229bdd02908f77ab8a41df0186b7e6fcf6 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_group_sharded_api_for_eager.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_group_sharded_api_for_eager.py @@ -17,7 +17,6 @@ import os os.environ['FLAGS_enable_eager_mode'] = '1' import unittest -import paddle.fluid as fluid from test_parallel_dygraph_dataparallel import TestMultipleGpus diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_recompute.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_recompute.py index c57e8d77490598b841cf6b572c289e176174405f..afd619a390b7bbd80ee13d0e7ac9b89c2042d13c 100755 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_recompute.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_recompute.py @@ -16,13 +16,10 @@ import unittest import numpy as np import paddle -from paddle.autograd import PyLayer from paddle.distributed.fleet.utils import recompute import random from paddle.incubate.distributed.fleet import recompute_sequential -import paddle.fluid.layers as layers - def get_fc_block(block_idx, input_size, is_last=False): block_name = "block_" + str(block_idx) diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_recompute_for_eager.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_recompute_for_eager.py index 05631fa7ee098233c26f176d9271f7b746317acf..d69c52144f5f932a268817b5ed58a722a3cd4a92 100755 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_recompute_for_eager.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_recompute_for_eager.py @@ -20,12 +20,8 @@ import unittest import numpy as np import paddle -from paddle.autograd import PyLayer from paddle.distributed.fleet.utils import recompute import random -from paddle.incubate.distributed.fleet import recompute_sequential - -import paddle.fluid.layers as layers def get_fc_block(block_idx, input_size, is_last=False): diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_sharding_optimizer_stage2.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_sharding_optimizer_stage2.py index 4af164c69df4cb00a6c2cab73b5b8f6e61cce058..f4d3f9728ef6d79edf2bce6e2001e7bcce9d2ce4 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_sharding_optimizer_stage2.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_sharding_optimizer_stage2.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import paddle.fluid as fluid from test_parallel_dygraph_dataparallel import TestMultipleGpus diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_sharding_stage2.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_sharding_stage2.py index 3c7e7c52d8415803030d6e0b49112ef9044ad8d7..07a9b1296e43c4a677069bac8515cf4ba4abf490 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_sharding_stage2.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_sharding_stage2.py @@ -14,7 +14,6 @@ import os import unittest -import paddle.fluid as fluid from test_parallel_dygraph_dataparallel import TestMultipleGpus diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_sharding_stage3.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_sharding_stage3.py index 0b4af46bf1c48da02e21bbb07e43ecd5b53e8a0d..82e7b8e12bfc9fc669df8e68fc6935eb79aa2946 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_sharding_stage3.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_sharding_stage3.py @@ -17,7 +17,6 @@ import os os.environ['FLAGS_enable_eager_mode'] = '0' import unittest -import paddle.fluid as fluid from test_parallel_dygraph_dataparallel import TestMultipleGpus diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_sharding_stage3_for_eager.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_sharding_stage3_for_eager.py index 3796a3e6d1d43ba8c9047e32df96a1bbf01f7e91..a6f9436a4f0b2f518e2945bf7f143c855b0f8c81 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_sharding_stage3_for_eager.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_sharding_stage3_for_eager.py @@ -18,7 +18,6 @@ os.environ['FLAGS_enable_eager_mode'] = '1' import os import unittest -import paddle.fluid as fluid from test_parallel_dygraph_dataparallel import TestMultipleGpus diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_amp_meta_optimizer.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_amp_meta_optimizer.py index 6b05e63482b5da98cee104fdeb6e28450446f8e6..7eb235a549933cfd0dc425c30c7704baa0579977 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_amp_meta_optimizer.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_amp_meta_optimizer.py @@ -17,7 +17,6 @@ import paddle import paddle.fluid as fluid import paddle.distributed.fleet as fleet from paddle.distributed.fleet.meta_optimizers import AMPOptimizer -import os from fleet_meta_optimizer_base import TestFleetMetaOptimizer import paddle.distributed.fleet.base.role_maker as role_maker diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_checkpoint.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_checkpoint.py index fb78f1f1add0c2b2f692e8cd9f10a6822b555950..ef091343204f37c991b73da7e0e8a5fd8e62ee59 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_checkpoint.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_checkpoint.py @@ -16,11 +16,10 @@ import unittest import paddle import paddle.fluid as fluid import paddle.fluid.incubate.fleet.base.role_maker as role_maker -from paddle.fluid.incubate.fleet.collective import CollectiveOptimizer, fleet +from paddle.fluid.incubate.fleet.collective import fleet from paddle.fluid.incubate.checkpoint.auto_checkpoint import ExeTrainStatus from paddle.fluid.incubate.checkpoint.checkpoint_saver import CheckpointSaver import os -import sys from paddle.distributed.fleet.utils.fs import LocalFS, HDFSClient from paddle.fluid.incubate.checkpoint.checkpoint_saver import CheckpointSaver diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_distributed_strategy.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_distributed_strategy.py index 9ac88c802111f1ba42ac1a1e1bfde965a7852989..d2b57d9a8d0bc2303203019cf0fc18e752340610 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_distributed_strategy.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_distributed_strategy.py @@ -14,7 +14,6 @@ import unittest import paddle -import os class TestStrategyConfig(unittest.TestCase): diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_gradient_merge_meta_optimizer.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_gradient_merge_meta_optimizer.py index 0f8b36e3f89b3570bf9f68091774e1c98728887b..99bc614b14ee1a0dac8e3b0ccca84ce03e2021b0 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_gradient_merge_meta_optimizer.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_gradient_merge_meta_optimizer.py @@ -14,9 +14,6 @@ import unittest import paddle -import os -import paddle.distributed.fleet as fleet -import paddle.distributed.fleet.base.role_maker as role_maker from fleet_meta_optimizer_base import TestFleetMetaOptimizer diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_localsgd_meta_optimizer.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_localsgd_meta_optimizer.py index ac7b203d5ee4fce8c4bcff756d4cf4b9af17e33e..2765b8c3eaea00242cc4b5373b18d5a0a412927c 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_localsgd_meta_optimizer.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_localsgd_meta_optimizer.py @@ -14,12 +14,9 @@ import unittest import paddle -import os import paddle import paddle.fluid as fluid -import paddle.distributed.fleet as fleet -import paddle.distributed.fleet.base.role_maker as role_maker from fleet_meta_optimizer_base import TestFleetMetaOptimizer paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_log.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_log.py index 03cb281cf37c930840d02ca22f3e13f204ff2e29..985905bdc815f13bafa5b4fc544d0642e5995778 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_log.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_log.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import paddle from paddle.distributed import fleet from paddle.distributed.fleet.utils.log_util import logger import logging diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_meta_optimizer_base.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_meta_optimizer_base.py index 21246cb74c442360c79ce6b14e70bfac24c84ae5..0c8db67dcb5f47b5ce1d4556a3383d4fb27b44ee 100755 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_meta_optimizer_base.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_meta_optimizer_base.py @@ -15,7 +15,6 @@ import unittest import paddle from paddle import fluid -import os import paddle.distributed.fleet as fleet import paddle.distributed.fleet.base.role_maker as role_maker from paddle.distributed.fleet.meta_optimizers.meta_optimizer_base import MetaOptimizerBase diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_private_function.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_private_function.py index 063cda8aa9de469d30c6819d1b6a9c0c5476c9ec..a4854c695f8ccc7cb112e633095bbba96ad2ce05 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_private_function.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_private_function.py @@ -13,8 +13,6 @@ # limitations under the License. import unittest -import os -import paddle import socket import threading diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_recompute_meta_optimizer.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_recompute_meta_optimizer.py index 230cad18361a8f69794f353d3f3e1ba6e6ad08f8..0045f7311deeed830aa0ea45152988ff81ced521 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_recompute_meta_optimizer.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_recompute_meta_optimizer.py @@ -15,7 +15,6 @@ import unittest import paddle import paddle.fluid as fluid -import os from fleet_meta_optimizer_base import TestFleetMetaOptimizer from paddle.distributed.fleet.meta_optimizers import RecomputeOptimizer diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_sharding_meta_optimizer.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_sharding_meta_optimizer.py index 68ad29880b3721584e509746e70fe34fc2110a78..6c14b49278c5a446b7397bd170d71a23d2e73ec7 100755 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_sharding_meta_optimizer.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_sharding_meta_optimizer.py @@ -16,8 +16,6 @@ import unittest import paddle import os -import paddle.distributed.fleet as fleet -import paddle.fluid as fluid from fleet_meta_optimizer_base import TestFleetMetaOptimizer import paddle.distributed.fleet.meta_optimizers.sharding as sharding diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_static_mp_layers.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_static_mp_layers.py index 9b80d70642db608795fa4e85474aaabbf812ada9..19f926748cf1dc27589869a571c3f76c6932b2c3 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_static_mp_layers.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_static_mp_layers.py @@ -15,12 +15,8 @@ import unittest import paddle -import numpy as np -import random -import paddle.distributed as dist import paddle.fluid as fluid import paddle.distributed.fleet as fleet -from paddle import framework import os paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_utils.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_utils.py index 9e70d8e54f03dda5776532501a1c6e6c88b46055..d7266cf29ab789787342a46c3df891fb59a5bdca 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_utils.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_utils.py @@ -12,17 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -import paddle -import paddle.fluid as fluid import unittest import numpy as np import tarfile import tempfile import os import sys -from paddle.dataset.common import download, DATA_HOME -import paddle.fluid.incubate.fleet.base.role_maker as role_maker -from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler import fleet +from paddle.dataset.common import download from paddle.fluid.incubate.fleet.utils.fleet_util import FleetUtil import paddle.fluid.incubate.fleet.utils.utils as utils diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_hdfs1.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_hdfs1.py index 2fa312fc20be9c8be46fac709d1ca2d8d91e1080..694cfe0cacc1f6ee49385baa1a8b183a4d8b37b1 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_hdfs1.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_hdfs1.py @@ -15,12 +15,9 @@ from paddle.fluid.tests.unittests.hdfs_test_utils import FSTestBase import unittest import paddle.fluid as fluid -import paddle.fluid.incubate.fleet.base.role_maker as role_maker -from paddle.fluid.incubate.fleet.collective import CollectiveOptimizer, fleet import os -import sys -from paddle.distributed.fleet.utils.fs import LocalFS, HDFSClient, FSTimeOut, FSFileExistsError, FSFileNotExistsError +from paddle.distributed.fleet.utils.fs import FSTimeOut, HDFSClient java_home = os.environ["JAVA_HOME"] diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_hdfs2.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_hdfs2.py index a77368d11a16369205f893fbcf857d1fbb663e17..682036a681a22fc568872a90757fed0190b88bd6 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_hdfs2.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_hdfs2.py @@ -14,13 +14,9 @@ from paddle.fluid.tests.unittests.hdfs_test_utils import FSTestBase import unittest -import paddle.fluid as fluid -import paddle.fluid.incubate.fleet.base.role_maker as role_maker -from paddle.fluid.incubate.fleet.collective import CollectiveOptimizer, fleet import os -import sys -from paddle.distributed.fleet.utils.fs import LocalFS, HDFSClient, FSTimeOut, FSFileExistsError, FSFileNotExistsError +from paddle.distributed.fleet.utils.fs import HDFSClient, LocalFS java_home = os.environ["JAVA_HOME"] diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_hdfs3.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_hdfs3.py index 450aceb5a747c6d975c02e71adcfbe5a190ed024..6bf304dc1e79678efb130eb305ca58470c4a377d 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_hdfs3.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_hdfs3.py @@ -14,13 +14,9 @@ from paddle.fluid.tests.unittests.hdfs_test_utils import FSTestBase import unittest -import paddle.fluid as fluid -import paddle.fluid.incubate.fleet.base.role_maker as role_maker -from paddle.fluid.incubate.fleet.collective import CollectiveOptimizer, fleet import os -import sys -from paddle.distributed.fleet.utils.fs import LocalFS, HDFSClient, FSTimeOut, FSFileExistsError, FSFileNotExistsError +from paddle.distributed.fleet.utils.fs import HDFSClient, LocalFS java_home = os.environ["JAVA_HOME"] diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_hybrid_parallel_inference_helper.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_hybrid_parallel_inference_helper.py index 04ec6b48239425cac97ccd5d50d7decbbf5394c1..06b3ec02de0c7be0a6baff10f663316fa2e707b6 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_hybrid_parallel_inference_helper.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_hybrid_parallel_inference_helper.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import paddle.fluid as fluid from test_parallel_dygraph_dataparallel import TestMultipleGpus diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_imperative_auto_mixed_precision.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_imperative_auto_mixed_precision.py index b6a85e94d85ec8a4d6ee1998b2be4a3c7191c3a9..026fa8fb9d44a0fe63135acbadac15e979b6de1c 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_imperative_auto_mixed_precision.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_imperative_auto_mixed_precision.py @@ -21,10 +21,8 @@ import paddle import paddle.fluid as fluid import paddle.fluid.core as core import numpy as np -import six -import cv2 import tempfile -from test_imperative_resnet import ResNet, BottleneckBlock, ConvBNLayer, train_parameters, optimizer_setting +from test_imperative_resnet import ResNet, optimizer_setting, train_parameters import paddle.nn as nn from paddle.static import InputSpec from paddle.autograd import PyLayer diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_imperative_auto_mixed_precision_for_eager.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_imperative_auto_mixed_precision_for_eager.py index 39982264736db7fccdea87852f913452d9f9f7bd..7ff434987a9c1391099d7133c41fe217b5711b37 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_imperative_auto_mixed_precision_for_eager.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_imperative_auto_mixed_precision_for_eager.py @@ -20,10 +20,8 @@ import unittest import paddle import paddle.fluid as fluid import numpy as np -import six -import cv2 import tempfile -from test_imperative_resnet import ResNet, BottleneckBlock, ConvBNLayer, train_parameters, optimizer_setting +from test_imperative_resnet import ResNet, optimizer_setting, train_parameters import paddle.nn as nn from paddle.static import InputSpec from paddle.autograd import PyLayer diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_mixed_precision.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_mixed_precision.py index 5fdc137f744707a524adbdfa1fe7b16dfe16ec17..37fcf7c6509ba43eeac5662514f110b7df08aadc 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_mixed_precision.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_mixed_precision.py @@ -13,9 +13,6 @@ # limitations under the License. import unittest -import paddle.fluid as fluid -from paddle.fluid import core -from paddle.fluid.contrib.mixed_precision import fp16_utils import paddle import paddle.nn as nn import paddle.static as static diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_class_center_sample.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_class_center_sample.py index 9e5c2b3eec551117d86905c419e4148d5111a540..0d22628c8aae5729b8dbfc59450fa22167e62203 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_class_center_sample.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_class_center_sample.py @@ -14,10 +14,8 @@ import os import unittest -import paddle.fluid as fluid from test_parallel_dygraph_dataparallel import TestMultipleGpus -from paddle.fluid.framework import _test_eager_guard class TestParallelClassCenterSample(TestMultipleGpus): diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_control_flow.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_control_flow.py index 183e8ad958dc22988495550c79d9d1849c798b65..c991818a5fbbde2dd58856749ab72d71b37473ef 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_control_flow.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_control_flow.py @@ -13,12 +13,10 @@ # limitations under the License. import os -import sys import unittest import paddle.fluid as fluid from test_dist_base import TestDistBase -from spawn_runner_base import TestDistSpawnRunner flag_name = os.path.splitext(__file__)[0] diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_mp_layers.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_mp_layers.py index 0705115cd9bb04aeac2b0d0fcb85d936389ec6ce..21aa82db3dc99e7045d9191b371a8ef8985a7f04 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_mp_layers.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_mp_layers.py @@ -14,7 +14,6 @@ import os import unittest -import paddle.fluid as fluid from test_parallel_dygraph_dataparallel import TestMultipleGpus diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_no_sync_gradient_check.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_no_sync_gradient_check.py index bceec2989f1bd44d5ad1309f00bcbe6274a6e112..d170cd0ed54dfe97bc71444e015942895ec082df 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_no_sync_gradient_check.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_no_sync_gradient_check.py @@ -14,7 +14,6 @@ import os import unittest -import paddle.fluid as fluid from test_parallel_dygraph_dataparallel import TestMultipleGpus diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_pipeline_parallel.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_pipeline_parallel.py index 9dd54f47347b38c4ffa99991159a859002af0e50..ebd1096fdc296cf70e07ec23a783cca728ce8dde 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_pipeline_parallel.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_pipeline_parallel.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import paddle.fluid as fluid import os from test_parallel_dygraph_dataparallel import TestMultipleGpus diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_pipeline_parallel_with_virtual_stage.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_pipeline_parallel_with_virtual_stage.py index 2a095881eb0f2473634f2366a8cffa06e57147ad..7af7d6dba1a07ef0cc10cdff3e1b6275bbf26e74 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_pipeline_parallel_with_virtual_stage.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_pipeline_parallel_with_virtual_stage.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import paddle.fluid as fluid import os from test_parallel_dygraph_dataparallel import TestMultipleGpus diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_qat.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_qat.py index e3c493d27215a9ccbb3536c35a31451248c55f1a..842f7166118346bb5999b3e5da20ac98b5eb330c 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_qat.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_qat.py @@ -14,7 +14,6 @@ import unittest import time -import paddle import paddle.fluid as fluid import copy import os diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_sharding_parallel.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_sharding_parallel.py index a28a9aeed2e6c47628a5531c5f0a5de0f199fef4..f6c6e3378e43c377e1d350d58ebd637e50f3ce83 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_sharding_parallel.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_sharding_parallel.py @@ -14,7 +14,6 @@ import os import unittest -import paddle.fluid as fluid from test_parallel_dygraph_dataparallel import TestMultipleGpus diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_sparse_embedding.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_sparse_embedding.py index 0f9c88745f1c365b0e4741ee2ad1b170e1368317..2f8ea8feddd2e4a7435aed4f7b98efd84836aca8 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_sparse_embedding.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_sparse_embedding.py @@ -20,7 +20,6 @@ import paddle.fluid as fluid from test_dist_base import TestDistBase from spawn_runner_base import TestDistSpawnRunner from parallel_dygraph_sparse_embedding import TestSparseEmbedding -from parallel_dygraph_sparse_embedding_fp64 import TestSparseEmbeddingFP64 flag_name = os.path.splitext(__file__)[0] diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_tensor_parallel.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_tensor_parallel.py index 9e08e3ff5e6b6b8ccb892de26786c3b60ffbc101..c2b1b17fc52cf643f41828560db9063f41ae50e6 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_tensor_parallel.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_tensor_parallel.py @@ -14,7 +14,6 @@ import os import unittest -import paddle.fluid as fluid from test_parallel_dygraph_dataparallel import TestMultipleGpus diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_transformer.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_transformer.py index 665e2bb26bfcf1e0de2401cff53681b06d07baab..8d12dfdce5891b6f19dcfa06b7804521fc773be2 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_transformer.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_transformer.py @@ -13,13 +13,10 @@ # limitations under the License. import os -import sys import unittest import paddle.fluid as fluid from test_dist_base import TestDistBase -from spawn_runner_base import TestDistSpawnRunner -from parallel_dygraph_transformer import TestTransformer flag_name = os.path.splitext(__file__)[0] diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_margin_cross_entropy.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_margin_cross_entropy.py index 6593fdc7fb378aa1500c7603d6a172fbb4bf142e..b983be50f7309e9f4abc5810c48224836de30682 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_margin_cross_entropy.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_margin_cross_entropy.py @@ -14,7 +14,6 @@ import os import unittest -import paddle.fluid as fluid from test_parallel_dygraph_dataparallel import TestMultipleGpus diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_recv_save_op.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_recv_save_op.py index e5bbbc1e50464307a385e8d996da6ce1f091c990..2da9079467f83cc15285566f01c9683bd4258697 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_recv_save_op.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_recv_save_op.py @@ -25,7 +25,6 @@ import paddle.fluid as fluid import paddle.fluid.core as core from paddle.fluid.op import Operator from paddle.fluid.framework import Program, program_guard -from paddle.fluid.transpiler.details import VarStruct, VarsDistributed from dist_test_utils import * from paddle.fluid.incubate.fleet.parameter_server.mode import DistributedMode diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_rnn_dp.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_rnn_dp.py index 46e1530a1916d5e6e1086ecf51aea2deb86d405c..8976f7919d294e74c4e2d37b0c8f876afb4b34c5 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_rnn_dp.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_rnn_dp.py @@ -16,12 +16,9 @@ import unittest import paddle import os -import numpy as np import paddle import paddle.static as static -import paddle.distributed.fleet as fleet import paddle.nn as nn -import paddle.nn.functional as F paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/test_tcp_store.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_tcp_store.py index b8650db0c5abe4dd86fa1590ceaec215c98d361c..ff5cff2c9cb9fc2ff87c1104e279199701d71ae6 100644 --- a/python/paddle/fluid/tests/unittests/collective/fleet/test_tcp_store.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_tcp_store.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import datetime import paddle import os diff --git a/python/paddle/fluid/tests/unittests/collective/init_process_group.py b/python/paddle/fluid/tests/unittests/collective/init_process_group.py index 27e6f740c2e2c2619b776f66db7ab94c26008eb0..dfb9dcf556c2177fc4fb967089e5aba03e5c9ab3 100644 --- a/python/paddle/fluid/tests/unittests/collective/init_process_group.py +++ b/python/paddle/fluid/tests/unittests/collective/init_process_group.py @@ -13,18 +13,9 @@ # limitations under the License. import unittest -import random -import numpy as np -import os -import shutil import paddle -from paddle.fluid import core -import datetime -from datetime import timedelta -import paddle.fluid.core as core from paddle.fluid.framework import _test_eager_guard -from paddle.fluid.dygraph.parallel import ParallelEnv class TestProcessGroupFp32(unittest.TestCase): diff --git a/python/paddle/fluid/tests/unittests/collective/multinode/dygraph_hybrid_dp.py b/python/paddle/fluid/tests/unittests/collective/multinode/dygraph_hybrid_dp.py index c007c6590fbda0b7ad18b5438c2bc18c184f5f74..5583041db8b6710f80e5e3c17065cf41bdf063fa 100644 --- a/python/paddle/fluid/tests/unittests/collective/multinode/dygraph_hybrid_dp.py +++ b/python/paddle/fluid/tests/unittests/collective/multinode/dygraph_hybrid_dp.py @@ -12,27 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np -import argparse -import os -import sys -import signal -import time -import socket -from contextlib import closing -from six import string_types -import math -import paddle -import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -import paddle.fluid.unique_name as nameGen -from paddle.fluid import core -import paddle.distributed.fleet as fleet -from paddle.fluid.incubate.fleet.base import role_maker -import unittest -from multiprocessing import Process -import paddle.fluid.layers as layers -from functools import reduce from test_collective_multi_nodes import TestCollectiveAPIRunnerBase, runtime_main @@ -44,7 +23,6 @@ class TestDygrapgHybridDP(TestCollectiveAPIRunnerBase): def check_pass(self, *args, **kwargs): from common import init_parallel_env import paddle - from paddle.distributed import fleet hcg = init_parallel_env("DP16-MP1-PP1-SH1-O1", 2) import numpy as np dp_group = hcg.get_data_parallel_group() diff --git a/python/paddle/fluid/tests/unittests/collective/multinode/dygraph_hybrid_dpppmp.py b/python/paddle/fluid/tests/unittests/collective/multinode/dygraph_hybrid_dpppmp.py index 83fbe3a6a65720159a3aaaaa8c15a7dea1ca4417..6de0954b0e7e4dd448389c1348962ffd00767f80 100644 --- a/python/paddle/fluid/tests/unittests/collective/multinode/dygraph_hybrid_dpppmp.py +++ b/python/paddle/fluid/tests/unittests/collective/multinode/dygraph_hybrid_dpppmp.py @@ -13,26 +13,8 @@ # limitations under the License. import numpy as np -import argparse -import os -import sys -import signal -import time -import socket -from contextlib import closing -from six import string_types -import math import paddle -import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -import paddle.fluid.unique_name as nameGen -from paddle.fluid import core import paddle.distributed.fleet as fleet -from paddle.fluid.incubate.fleet.base import role_maker -import unittest -from multiprocessing import Process -import paddle.fluid.layers as layers -from functools import reduce from test_collective_multi_nodes import TestCollectiveAPIRunnerBase, runtime_main from paddle import nn import numpy as np diff --git a/python/paddle/fluid/tests/unittests/collective/multinode/dygraph_hybrid_fp16.py b/python/paddle/fluid/tests/unittests/collective/multinode/dygraph_hybrid_fp16.py index bde59dba0d0cb6424abfdcca5d898d859c3d9e49..0c4eddffeecec4269732d893af116d10b98789cb 100644 --- a/python/paddle/fluid/tests/unittests/collective/multinode/dygraph_hybrid_fp16.py +++ b/python/paddle/fluid/tests/unittests/collective/multinode/dygraph_hybrid_fp16.py @@ -13,26 +13,8 @@ # limitations under the License. import numpy as np -import argparse -import os -import sys -import signal -import time -import socket -from contextlib import closing -from six import string_types -import math import paddle -import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -import paddle.fluid.unique_name as nameGen -from paddle.fluid import core import paddle.distributed.fleet as fleet -from paddle.fluid.incubate.fleet.base import role_maker -import unittest -from multiprocessing import Process -import paddle.fluid.layers as layers -from functools import reduce from test_collective_multi_nodes import TestCollectiveAPIRunnerBase, runtime_main from paddle import nn import numpy as np diff --git a/python/paddle/fluid/tests/unittests/collective/multinode/dygraph_hybrid_recompute.py b/python/paddle/fluid/tests/unittests/collective/multinode/dygraph_hybrid_recompute.py index f65e44abc8829ed516cf961f29a330974adeb7a4..16e6d1602f39eefc2369c50f391a5509175e8153 100644 --- a/python/paddle/fluid/tests/unittests/collective/multinode/dygraph_hybrid_recompute.py +++ b/python/paddle/fluid/tests/unittests/collective/multinode/dygraph_hybrid_recompute.py @@ -13,26 +13,8 @@ # limitations under the License. import numpy as np -import argparse -import os -import sys -import signal -import time -import socket -from contextlib import closing -from six import string_types -import math import paddle -import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -import paddle.fluid.unique_name as nameGen -from paddle.fluid import core import paddle.distributed.fleet as fleet -from paddle.fluid.incubate.fleet.base import role_maker -import unittest -from multiprocessing import Process -import paddle.fluid.layers as layers -from functools import reduce from test_collective_multi_nodes import TestCollectiveAPIRunnerBase, runtime_main from paddle import nn import numpy as np diff --git a/python/paddle/fluid/tests/unittests/collective/multinode/mn_dygraph_group_sharded_stage3.py b/python/paddle/fluid/tests/unittests/collective/multinode/mn_dygraph_group_sharded_stage3.py index 6e742f1b2f91bdd537fd565f675734f39b7d1017..9c432eefa8a297bde0064ca57745d935a81f7962 100644 --- a/python/paddle/fluid/tests/unittests/collective/multinode/mn_dygraph_group_sharded_stage3.py +++ b/python/paddle/fluid/tests/unittests/collective/multinode/mn_dygraph_group_sharded_stage3.py @@ -18,14 +18,9 @@ import os import shutil import tempfile import numpy as np -import argparse -import ast -import time import paddle import paddle.fluid as fluid from paddle.fluid.dygraph.nn import Linear -from paddle.distributed import fleet -from paddle.fluid.dygraph import nn from paddle.fluid.framework import _test_eager_guard from paddle.distributed.fleet.meta_parallel.sharding.group_sharded_optimizer_stage2 import GroupShardedOptimizerStage2 diff --git a/python/paddle/fluid/tests/unittests/collective/multinode/mn_dygraph_sharding_stage2.py b/python/paddle/fluid/tests/unittests/collective/multinode/mn_dygraph_sharding_stage2.py index 6aa888921845b1cb2dd82c6cacb793408c964e9f..affb6d31f2ae5527bd6bee2cedfa05917dfb0dc6 100644 --- a/python/paddle/fluid/tests/unittests/collective/multinode/mn_dygraph_sharding_stage2.py +++ b/python/paddle/fluid/tests/unittests/collective/multinode/mn_dygraph_sharding_stage2.py @@ -17,15 +17,11 @@ import os import shutil import numpy as np -import argparse import tempfile -import ast -import time import paddle import paddle.fluid as fluid from paddle.fluid.dygraph.nn import Linear from paddle.distributed import fleet -from paddle.fluid.dygraph import nn from paddle.fluid.framework import _test_eager_guard from paddle.distributed.fleet.meta_optimizers.dygraph_optimizer.sharding_optimizer_stage2 import ShardingOptimizerStage2 diff --git a/python/paddle/fluid/tests/unittests/collective/multinode/test_collective_multi_nodes.py b/python/paddle/fluid/tests/unittests/collective/multinode/test_collective_multi_nodes.py index 4dc0265a7ade132782e965e48a2b05074da79cf6..c7ad96c061ef794773def975b0a0ab4aa11fbab1 100644 --- a/python/paddle/fluid/tests/unittests/collective/multinode/test_collective_multi_nodes.py +++ b/python/paddle/fluid/tests/unittests/collective/multinode/test_collective_multi_nodes.py @@ -12,23 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -import numpy as np import unittest -import time -import argparse import os import sys import subprocess -import traceback -import functools -import pickle import tempfile -from contextlib import closing -import paddle -import paddle.fluid as fluid -import paddle.fluid.unique_name as nameGen -from paddle.fluid import core -import socket class TestCollectiveAPIRunnerBase(object): diff --git a/python/paddle/fluid/tests/unittests/collective/multinode/test_multinode_dygraph_hybrid_dp.py b/python/paddle/fluid/tests/unittests/collective/multinode/test_multinode_dygraph_hybrid_dp.py index ab35a227f4b7f4273edc0eebec6752ef6eaabc9d..05124e0ddd5dd3501f5df367822b59d7855e2d8f 100755 --- a/python/paddle/fluid/tests/unittests/collective/multinode/test_multinode_dygraph_hybrid_dp.py +++ b/python/paddle/fluid/tests/unittests/collective/multinode/test_multinode_dygraph_hybrid_dp.py @@ -15,8 +15,6 @@ # limitations under the License. import unittest -import numpy as np -import paddle from test_collective_multi_nodes import TestDistBase diff --git a/python/paddle/fluid/tests/unittests/collective/multinode/test_multinode_dygraph_hybrid_dpppmp.py b/python/paddle/fluid/tests/unittests/collective/multinode/test_multinode_dygraph_hybrid_dpppmp.py index c0b24f2a3dcc02a7c23946c26dcc8ecd43ee9207..aa2a01454ae9b654077c3485e84f8756e9706065 100755 --- a/python/paddle/fluid/tests/unittests/collective/multinode/test_multinode_dygraph_hybrid_dpppmp.py +++ b/python/paddle/fluid/tests/unittests/collective/multinode/test_multinode_dygraph_hybrid_dpppmp.py @@ -15,8 +15,6 @@ # limitations under the License. import unittest -import numpy as np -import paddle from test_collective_multi_nodes import TestDistBase diff --git a/python/paddle/fluid/tests/unittests/collective/multinode/test_multinode_dygraph_sharding.py b/python/paddle/fluid/tests/unittests/collective/multinode/test_multinode_dygraph_sharding.py index c00110b9ddbe02daaaa09f8cc31664239ea1bb95..f0da628a4c8a3c8982e6d9a95b26d864f17b3535 100755 --- a/python/paddle/fluid/tests/unittests/collective/multinode/test_multinode_dygraph_sharding.py +++ b/python/paddle/fluid/tests/unittests/collective/multinode/test_multinode_dygraph_sharding.py @@ -15,8 +15,6 @@ # limitations under the License. import unittest -import numpy as np -import paddle from test_collective_multi_nodes import TestDistBase diff --git a/python/paddle/fluid/tests/unittests/collective/parallel_embedding_api.py b/python/paddle/fluid/tests/unittests/collective/parallel_embedding_api.py index e8205aa7a02cc30459978f4e061330f63ada4bd4..8b6ab746ce858abb8cb4406db6ffc29d5d7bb474 100644 --- a/python/paddle/fluid/tests/unittests/collective/parallel_embedding_api.py +++ b/python/paddle/fluid/tests/unittests/collective/parallel_embedding_api.py @@ -13,26 +13,9 @@ # limitations under the License. import numpy as np -import argparse -import os -import sys -import signal -import time -import socket -from contextlib import closing -from six import string_types -import math import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -import paddle.fluid.unique_name as nameGen -from paddle.fluid import core import paddle.distributed.fleet as fleet -from paddle.fluid.incubate.fleet.base import role_maker -import unittest -from multiprocessing import Process -import paddle.fluid.layers as layers -from functools import reduce from test_collective_api_base import TestCollectiveAPIRunnerBase, runtime_main paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective/process_group_gloo.py b/python/paddle/fluid/tests/unittests/collective/process_group_gloo.py index b2392d90b2588c49950c3a6c806fc6e2d7bac5c1..4e678ef955e59e19964c25e83d6d0836825eb236 100644 --- a/python/paddle/fluid/tests/unittests/collective/process_group_gloo.py +++ b/python/paddle/fluid/tests/unittests/collective/process_group_gloo.py @@ -15,13 +15,9 @@ import unittest import random import numpy as np -import os -import shutil import paddle from paddle.fluid import core -import datetime -from datetime import timedelta import paddle.fluid.core as core from paddle.fluid.framework import _test_eager_guard from paddle.fluid.dygraph.parallel import ParallelEnv diff --git a/python/paddle/fluid/tests/unittests/collective/process_group_mpi.py b/python/paddle/fluid/tests/unittests/collective/process_group_mpi.py index db3ef4a032e048e7345b4c0aa85fefeecf438bdd..f3ca19ebe7eae154746f088cbc4cd06eab5c98f3 100644 --- a/python/paddle/fluid/tests/unittests/collective/process_group_mpi.py +++ b/python/paddle/fluid/tests/unittests/collective/process_group_mpi.py @@ -15,17 +15,12 @@ import unittest import random import numpy as np -import os -import shutil import paddle from paddle.fluid import core -from datetime import timedelta import paddle.fluid.core as core from paddle.fluid.framework import _test_eager_guard -from paddle.fluid.dygraph.parallel import ParallelEnv from paddle.distributed.collective import Group -from paddle.distributed.collective import _group_map_by_name from paddle.distributed.collective import _default_group_name from paddle.distributed.collective import _set_group_map from paddle.distributed.collective import _set_group_map_by_name diff --git a/python/paddle/fluid/tests/unittests/collective/process_group_nccl.py b/python/paddle/fluid/tests/unittests/collective/process_group_nccl.py index 124e68ce6e387af0224a7d1973a8295a32e31078..aa3a9575f42ffcda41c323ab674e5554e5e1d587 100644 --- a/python/paddle/fluid/tests/unittests/collective/process_group_nccl.py +++ b/python/paddle/fluid/tests/unittests/collective/process_group_nccl.py @@ -15,13 +15,8 @@ import unittest import random import numpy as np -import os -import shutil import paddle -from paddle.fluid import core -from datetime import timedelta -import paddle.fluid.core as core from paddle.fluid.framework import _test_eager_guard from paddle.fluid.dygraph.parallel import ParallelEnv import paddle.distributed as dist diff --git a/python/paddle/fluid/tests/unittests/collective/row_parallel_linear_api.py b/python/paddle/fluid/tests/unittests/collective/row_parallel_linear_api.py index ec465bc91cf1fc1ae444258e25bda794b77ca77a..854ef9cb69e0d6e3e1a898d74017897340e4b7e9 100644 --- a/python/paddle/fluid/tests/unittests/collective/row_parallel_linear_api.py +++ b/python/paddle/fluid/tests/unittests/collective/row_parallel_linear_api.py @@ -13,26 +13,9 @@ # limitations under the License. import numpy as np -import argparse -import os -import sys -import signal -import time -import socket -from contextlib import closing -from six import string_types -import math import paddle import paddle.fluid as fluid -import paddle.fluid.profiler as profiler -import paddle.fluid.unique_name as nameGen -from paddle.fluid import core import paddle.distributed.fleet as fleet -from paddle.fluid.incubate.fleet.base import role_maker -import unittest -from multiprocessing import Process -import paddle.fluid.layers as layers -from functools import reduce from test_collective_api_base import TestCollectiveAPIRunnerBase, runtime_main paddle.enable_static() diff --git a/python/paddle/fluid/tests/unittests/collective/test_allreduce.py b/python/paddle/fluid/tests/unittests/collective/test_allreduce.py index c311d3b7f320cb00fe8d0aed353b5ae71858d426..d137f0f3ec4524c62b6e5d391109af6fcc07d189 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_allreduce.py +++ b/python/paddle/fluid/tests/unittests/collective/test_allreduce.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import numpy as np import paddle from test_collective_base import TestDistBase diff --git a/python/paddle/fluid/tests/unittests/collective/test_broadcast.py b/python/paddle/fluid/tests/unittests/collective/test_broadcast.py index 21d5d082e19162071433d5e33508e0f4fdd52244..ff171d084d3f65cdb000e474aaba6af1eff7dd1c 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_broadcast.py +++ b/python/paddle/fluid/tests/unittests/collective/test_broadcast.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import numpy as np import paddle from test_collective_base import TestDistBase diff --git a/python/paddle/fluid/tests/unittests/collective/test_c_concat.py b/python/paddle/fluid/tests/unittests/collective/test_c_concat.py index 07e22ac1890fe7ebcc8d94cf9ca6f9efb3861a5c..bc241c1e556f5dd5c496ac29a33a215cb8fa808c 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_c_concat.py +++ b/python/paddle/fluid/tests/unittests/collective/test_c_concat.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import numpy as np import paddle from test_collective_base import TestDistBase diff --git a/python/paddle/fluid/tests/unittests/collective/test_c_identity.py b/python/paddle/fluid/tests/unittests/collective/test_c_identity.py index b6f3b32fc2493ef7ce205f734ecd01654787330f..936e2961c57c2d84a691bdd4159b8143873968ef 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_c_identity.py +++ b/python/paddle/fluid/tests/unittests/collective/test_c_identity.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import numpy as np import paddle from test_collective_base import TestDistBase diff --git a/python/paddle/fluid/tests/unittests/collective/test_c_split.py b/python/paddle/fluid/tests/unittests/collective/test_c_split.py index 772982d9973d2e94f2afa28d5b8d57ceb5cce4df..43dc766ad24b9a6b7c93f91d20d290792787194d 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_c_split.py +++ b/python/paddle/fluid/tests/unittests/collective/test_c_split.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import numpy as np import paddle from test_collective_base import TestDistBase diff --git a/python/paddle/fluid/tests/unittests/collective/test_collective_allgather_api.py b/python/paddle/fluid/tests/unittests/collective/test_collective_allgather_api.py index ec5e7a6f72e921fc444f9cd35b97a08c2bc49438..af4e6c10baaf9fd5c6e5726e34ee5a16fc9ec416 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_collective_allgather_api.py +++ b/python/paddle/fluid/tests/unittests/collective/test_collective_allgather_api.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import numpy as np import paddle from test_collective_api_base import TestDistBase diff --git a/python/paddle/fluid/tests/unittests/collective/test_collective_allgather_object_api.py b/python/paddle/fluid/tests/unittests/collective/test_collective_allgather_object_api.py index 63ac93adf8dee1140f2d66355e1851c9c3e5d14b..90539e89c0b0e6afe17fe5f80ae3d3a2b5c53d7d 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_collective_allgather_object_api.py +++ b/python/paddle/fluid/tests/unittests/collective/test_collective_allgather_object_api.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import paddle import test_collective_api_base as test_base diff --git a/python/paddle/fluid/tests/unittests/collective/test_collective_allreduce_api.py b/python/paddle/fluid/tests/unittests/collective/test_collective_allreduce_api.py index e68bd590aba58be12b0305bb4147c801c099b6f4..c0bd54a6fad7a08cb78360c861a598162b36eb04 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_collective_allreduce_api.py +++ b/python/paddle/fluid/tests/unittests/collective/test_collective_allreduce_api.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import numpy as np import paddle from test_collective_api_base import TestDistBase diff --git a/python/paddle/fluid/tests/unittests/collective/test_collective_alltoall_api.py b/python/paddle/fluid/tests/unittests/collective/test_collective_alltoall_api.py index 9d24014365189851b32ae9bac7c704144da0a1f2..a042507ede1d4bb3354396638820a50bf1e4fff9 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_collective_alltoall_api.py +++ b/python/paddle/fluid/tests/unittests/collective/test_collective_alltoall_api.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import numpy as np import paddle from test_collective_api_base import TestDistBase diff --git a/python/paddle/fluid/tests/unittests/collective/test_collective_alltoall_single.py b/python/paddle/fluid/tests/unittests/collective/test_collective_alltoall_single.py index 74378a09f0fd5f7496094948311f2f48ea5cf7a2..9ef0a7639e18b449d4e8bf2079b5026294361691 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_collective_alltoall_single.py +++ b/python/paddle/fluid/tests/unittests/collective/test_collective_alltoall_single.py @@ -14,7 +14,6 @@ import os import unittest -import paddle.fluid as fluid from test_parallel_dygraph_dataparallel import TestMultipleGpus diff --git a/python/paddle/fluid/tests/unittests/collective/test_collective_alltoall_single_api.py b/python/paddle/fluid/tests/unittests/collective/test_collective_alltoall_single_api.py index fb1e5e9da22ef10e18358fa45a64c6ddd33d3bce..2f18903068edb8bc7546adab355cdce72f7053d5 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_collective_alltoall_single_api.py +++ b/python/paddle/fluid/tests/unittests/collective/test_collective_alltoall_single_api.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import paddle import test_collective_api_base as test_base diff --git a/python/paddle/fluid/tests/unittests/collective/test_collective_barrier_api.py b/python/paddle/fluid/tests/unittests/collective/test_collective_barrier_api.py index f93c0d4d56d9cdbb0a95d3454066cad8938ad1f5..8a883ce989c184cc09c8b137c1774f63daa079e9 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_collective_barrier_api.py +++ b/python/paddle/fluid/tests/unittests/collective/test_collective_barrier_api.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import numpy as np import paddle from test_collective_api_base import TestDistBase diff --git a/python/paddle/fluid/tests/unittests/collective/test_collective_batch_isend_irecv.py b/python/paddle/fluid/tests/unittests/collective/test_collective_batch_isend_irecv.py index c671f19053445c4c77be7db94946f3c8387797ba..e9fad9aa1c1f695f3cd09cd00958a24d8f5030cc 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_collective_batch_isend_irecv.py +++ b/python/paddle/fluid/tests/unittests/collective/test_collective_batch_isend_irecv.py @@ -14,7 +14,6 @@ import os import unittest -import paddle.fluid as fluid from test_parallel_dygraph_dataparallel import TestMultipleGpus diff --git a/python/paddle/fluid/tests/unittests/collective/test_collective_broadcast_api.py b/python/paddle/fluid/tests/unittests/collective/test_collective_broadcast_api.py index 010e8580947566efcc7a9bdbdd2c22340110db38..f0c768280524792610995ce18998f5aeb0420c39 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_collective_broadcast_api.py +++ b/python/paddle/fluid/tests/unittests/collective/test_collective_broadcast_api.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import numpy as np import paddle from test_collective_api_base import TestDistBase diff --git a/python/paddle/fluid/tests/unittests/collective/test_collective_cpu_barrier_with_gloo.py b/python/paddle/fluid/tests/unittests/collective/test_collective_cpu_barrier_with_gloo.py index bf503d804ca235ab5d6cee9f41021d01d2ff1c34..157e7106308ab1fd138e7ccf920b061204c615d3 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_collective_cpu_barrier_with_gloo.py +++ b/python/paddle/fluid/tests/unittests/collective/test_collective_cpu_barrier_with_gloo.py @@ -13,8 +13,6 @@ # limitations under the License. import unittest -import os -import sys import time import multiprocessing from contextlib import closing diff --git a/python/paddle/fluid/tests/unittests/collective/test_collective_global_gather.py b/python/paddle/fluid/tests/unittests/collective/test_collective_global_gather.py index 6022f1c747292fadb13fe6e8edb9ef36cb9a99a8..85406dd00bb5a9024b8c448ab4d75e3629ed53ec 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_collective_global_gather.py +++ b/python/paddle/fluid/tests/unittests/collective/test_collective_global_gather.py @@ -13,11 +13,9 @@ # limitations under the License. import unittest -import numpy as np import paddle from test_collective_api_base import TestDistBase -import os class TestCollectiveGlobalGatherAPI(TestDistBase): diff --git a/python/paddle/fluid/tests/unittests/collective/test_collective_global_scatter.py b/python/paddle/fluid/tests/unittests/collective/test_collective_global_scatter.py index b7e0a9a4cb3ad3b6b2870e17818e79aa5bb79bb1..c2668c62047def3d060b57577773f33329ba441f 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_collective_global_scatter.py +++ b/python/paddle/fluid/tests/unittests/collective/test_collective_global_scatter.py @@ -13,11 +13,9 @@ # limitations under the License. import unittest -import numpy as np import paddle from test_collective_api_base import TestDistBase -import os class TestCollectiveSelectScatterAPI(TestDistBase): diff --git a/python/paddle/fluid/tests/unittests/collective/test_collective_isend_irecv_api.py b/python/paddle/fluid/tests/unittests/collective/test_collective_isend_irecv_api.py index f9613abc2406363b3c6525da2af22c6583bbbdd1..333da7e6807aaecb676e1c1757a6130caba8bcc0 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_collective_isend_irecv_api.py +++ b/python/paddle/fluid/tests/unittests/collective/test_collective_isend_irecv_api.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import paddle import test_collective_api_base as test_base diff --git a/python/paddle/fluid/tests/unittests/collective/test_collective_reduce.py b/python/paddle/fluid/tests/unittests/collective/test_collective_reduce.py index 4c8f598152305397e5c3b953fef793e8ec81b72e..e5cc5441097507eba46ce057ddacce1e7fcc21a4 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_collective_reduce.py +++ b/python/paddle/fluid/tests/unittests/collective/test_collective_reduce.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import numpy as np import paddle from test_collective_base import TestDistBase diff --git a/python/paddle/fluid/tests/unittests/collective/test_collective_reduce_api.py b/python/paddle/fluid/tests/unittests/collective/test_collective_reduce_api.py index 0d7286f63a7a9a6e86977ce5748b58a934e595d6..ccaf61472fe8a92490e2e3e46ffee5dd9c85cf6d 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_collective_reduce_api.py +++ b/python/paddle/fluid/tests/unittests/collective/test_collective_reduce_api.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import numpy as np import paddle from test_collective_api_base import TestDistBase diff --git a/python/paddle/fluid/tests/unittests/collective/test_collective_reduce_scatter.py b/python/paddle/fluid/tests/unittests/collective/test_collective_reduce_scatter.py index 7ed9d942169979c8a48b2421a74982a38556ef41..a9151e1466539509b3a2895ff501975145df329b 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_collective_reduce_scatter.py +++ b/python/paddle/fluid/tests/unittests/collective/test_collective_reduce_scatter.py @@ -14,7 +14,6 @@ import os import unittest -import paddle.fluid as fluid from test_parallel_dygraph_dataparallel import TestMultipleGpus diff --git a/python/paddle/fluid/tests/unittests/collective/test_collective_reduce_scatter_api.py b/python/paddle/fluid/tests/unittests/collective/test_collective_reduce_scatter_api.py index 1d25527407f4533fe3f7225e436479695c214c95..d490a8bbce5df605e63f5ee0c61847247592c765 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_collective_reduce_scatter_api.py +++ b/python/paddle/fluid/tests/unittests/collective/test_collective_reduce_scatter_api.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import paddle import test_collective_api_base as test_base diff --git a/python/paddle/fluid/tests/unittests/collective/test_collective_scatter.py b/python/paddle/fluid/tests/unittests/collective/test_collective_scatter.py index c356767310f632b162f7b4d14cbda2149d99b69d..e4d26459967dc78e94f32b682fb6856c2d42193c 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_collective_scatter.py +++ b/python/paddle/fluid/tests/unittests/collective/test_collective_scatter.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import numpy as np import paddle from test_collective_base import TestDistBase diff --git a/python/paddle/fluid/tests/unittests/collective/test_collective_scatter_api.py b/python/paddle/fluid/tests/unittests/collective/test_collective_scatter_api.py index 3f2522a082fd5fb6fd18fab6e28a775249857111..d5e8e7cc62e162a3c5d88cfb4cdafc9d0861fd8c 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_collective_scatter_api.py +++ b/python/paddle/fluid/tests/unittests/collective/test_collective_scatter_api.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import numpy as np import paddle from test_collective_api_base import TestDistBase diff --git a/python/paddle/fluid/tests/unittests/collective/test_collective_sendrecv.py b/python/paddle/fluid/tests/unittests/collective/test_collective_sendrecv.py index 84c138feaccdbc22b5318a65ac0ca2d601017114..8f1467cf652032bedd4ba87ec11bbd5744147a60 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_collective_sendrecv.py +++ b/python/paddle/fluid/tests/unittests/collective/test_collective_sendrecv.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import numpy as np import paddle from test_collective_base import TestDistBase diff --git a/python/paddle/fluid/tests/unittests/collective/test_collective_sendrecv_api.py b/python/paddle/fluid/tests/unittests/collective/test_collective_sendrecv_api.py index 2df0ac5e35e5c4857ce8c9f656e188a9aec649c1..ee8ada3d22be65f585bffde1a17db73eba303e44 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_collective_sendrecv_api.py +++ b/python/paddle/fluid/tests/unittests/collective/test_collective_sendrecv_api.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import numpy as np import paddle from test_collective_api_base import TestDistBase diff --git a/python/paddle/fluid/tests/unittests/collective/test_collective_split_col_linear.py b/python/paddle/fluid/tests/unittests/collective/test_collective_split_col_linear.py index ad7a432fd036bc1d9b298b48acfdce87807d3cfe..c2983d3ea79930d7f36bcd5b36c61f9f843c7d3b 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_collective_split_col_linear.py +++ b/python/paddle/fluid/tests/unittests/collective/test_collective_split_col_linear.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import numpy as np import paddle from test_collective_api_base import TestDistBase diff --git a/python/paddle/fluid/tests/unittests/collective/test_collective_split_embedding.py b/python/paddle/fluid/tests/unittests/collective/test_collective_split_embedding.py index 835fed0f08d5586a02cb99ffbe46a5944bb22bea..fbab3e68cea4e28efb2e0f67c6dd20efa0ddbd93 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_collective_split_embedding.py +++ b/python/paddle/fluid/tests/unittests/collective/test_collective_split_embedding.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import numpy as np import paddle from test_collective_api_base import TestDistBase diff --git a/python/paddle/fluid/tests/unittests/collective/test_collective_split_embedding_none_divisible.py b/python/paddle/fluid/tests/unittests/collective/test_collective_split_embedding_none_divisible.py index 00df9f3aceeeb8ba5d1dc65da2c032d19bd29fcd..b5888390bcae3aaf723dd678b10335af2bc05b7c 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_collective_split_embedding_none_divisible.py +++ b/python/paddle/fluid/tests/unittests/collective/test_collective_split_embedding_none_divisible.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import numpy as np import paddle from paddle.distributed import fleet diff --git a/python/paddle/fluid/tests/unittests/collective/test_collective_split_row_linear.py b/python/paddle/fluid/tests/unittests/collective/test_collective_split_row_linear.py index 6f39f08e9311ba682356a3fc0f5ed6e594ce714b..c89b1cc7a065db2adcbd0825cff3bd721bb488d9 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_collective_split_row_linear.py +++ b/python/paddle/fluid/tests/unittests/collective/test_collective_split_row_linear.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import numpy as np import paddle from test_collective_api_base import TestDistBase diff --git a/python/paddle/fluid/tests/unittests/collective/test_collective_wait.py b/python/paddle/fluid/tests/unittests/collective/test_collective_wait.py index 5b06e867a7473401dc9b9424ac9ff249d342d004..cf4bcd98fa0bc002a2814243e1bb558757537b21 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_collective_wait.py +++ b/python/paddle/fluid/tests/unittests/collective/test_collective_wait.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import numpy as np import paddle from test_collective_base import TestDistBase diff --git a/python/paddle/fluid/tests/unittests/collective/test_communication_stream_allreduce_api.py b/python/paddle/fluid/tests/unittests/collective/test_communication_stream_allreduce_api.py index 6c6dcfa1c705dd25adc990c730bc9d66814b9e14..7fe30a5d50fb34dc82ecee843c2e86f11c8baada 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_communication_stream_allreduce_api.py +++ b/python/paddle/fluid/tests/unittests/collective/test_communication_stream_allreduce_api.py @@ -13,8 +13,6 @@ # limitations under the License. import unittest -import paddle -import itertools import test_communication_api_base as test_base diff --git a/python/paddle/fluid/tests/unittests/collective/test_communication_stream_sendrecv_api.py b/python/paddle/fluid/tests/unittests/collective/test_communication_stream_sendrecv_api.py index 9590519bc2e13d3f758732dcdc6813fc8b8adbc1..b32ceb2a95229d1e115b6dcd0c02683c4f989f99 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_communication_stream_sendrecv_api.py +++ b/python/paddle/fluid/tests/unittests/collective/test_communication_stream_sendrecv_api.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import paddle import test_communication_api_base as test_base diff --git a/python/paddle/fluid/tests/unittests/collective/test_gen_nccl_id_op.py b/python/paddle/fluid/tests/unittests/collective/test_gen_nccl_id_op.py index 8543912f04f2ef8b952e773b9f6e02b9b233a1ce..80afdd393f0ec7db3a4d52be6c33295779011fe9 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_gen_nccl_id_op.py +++ b/python/paddle/fluid/tests/unittests/collective/test_gen_nccl_id_op.py @@ -14,10 +14,8 @@ import unittest import os -import copy from launch_function_helper import wait, _find_free_port -from multiprocessing import Pool, Process -from threading import Thread +from multiprocessing import Process os.environ['GLOG_vmodule'] = str("gen_nccl_id_op*=10,gen_comm_id*=10") diff --git a/python/paddle/fluid/tests/unittests/collective/test_new_group_api.py b/python/paddle/fluid/tests/unittests/collective/test_new_group_api.py index 00f5db42e63299631b8b279984c1cfcb89169ace..dfa0fb2402fd95f09510b3c636cd38558765379b 100644 --- a/python/paddle/fluid/tests/unittests/collective/test_new_group_api.py +++ b/python/paddle/fluid/tests/unittests/collective/test_new_group_api.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import numpy as np import paddle from test_collective_api_base import TestDistBase diff --git a/python/paddle/fluid/tests/unittests/collective/world_size_and_rank.py b/python/paddle/fluid/tests/unittests/collective/world_size_and_rank.py index 69620238a94377966e983b9d78f2031d3375d42a..5916370f7533c37a5526a44167e5a0669a11d963 100644 --- a/python/paddle/fluid/tests/unittests/collective/world_size_and_rank.py +++ b/python/paddle/fluid/tests/unittests/collective/world_size_and_rank.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import paddle import paddle.distributed as dist