diff --git a/python/paddle/fluid/tests/custom_kernel/custom_kernel_dot_setup.py b/python/paddle/fluid/tests/custom_kernel/custom_kernel_dot_setup.py index ba116526d3ff4ba8bd7a4148020758fad4d0710b..8b953ca87251ac01564127befd92177f2d6e8c06 100644 --- a/python/paddle/fluid/tests/custom_kernel/custom_kernel_dot_setup.py +++ b/python/paddle/fluid/tests/custom_kernel/custom_kernel_dot_setup.py @@ -15,7 +15,6 @@ import os import site from paddle.fluid import core -from distutils.sysconfig import get_python_lib from distutils.core import setup, Extension from setuptools.command.build_ext import build_ext diff --git a/python/paddle/fluid/tests/custom_kernel/test_custom_kernel_dot.py b/python/paddle/fluid/tests/custom_kernel/test_custom_kernel_dot.py index 55b3fad1f351965a82213c44642ee004579cb31b..8badd5dfbde81215485dfa6ce937bb6f2e05cc3a 100644 --- a/python/paddle/fluid/tests/custom_kernel/test_custom_kernel_dot.py +++ b/python/paddle/fluid/tests/custom_kernel/test_custom_kernel_dot.py @@ -14,7 +14,6 @@ import os import sys -import site import unittest import numpy as np diff --git a/python/paddle/fluid/tests/custom_op/custom_relu_setup.py b/python/paddle/fluid/tests/custom_op/custom_relu_setup.py index c3a76d65351c4965f28aef062ddd02dcf04c06f8..7dd3dd7aa7e38743fb108be948d0f052b451f60d 100644 --- a/python/paddle/fluid/tests/custom_op/custom_relu_setup.py +++ b/python/paddle/fluid/tests/custom_op/custom_relu_setup.py @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os - from utils import paddle_includes, extra_compile_args, IS_MAC from paddle.utils.cpp_extension import CUDAExtension, setup, CppExtension diff --git a/python/paddle/fluid/tests/custom_op/test_check_abi.py b/python/paddle/fluid/tests/custom_op/test_check_abi.py index 727e02f62cd37e3a6bd0a15155d9cf01cdbd1b69..39bcf1ae628c6df7119053b99c02f5ca7d9b60af 100644 --- a/python/paddle/fluid/tests/custom_op/test_check_abi.py +++ b/python/paddle/fluid/tests/custom_op/test_check_abi.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import paddle import os import warnings diff --git a/python/paddle/fluid/tests/custom_op/test_custom_relu_op_jit.py b/python/paddle/fluid/tests/custom_op/test_custom_relu_op_jit.py index e650d606001fcb327774daea665dfa608352d05b..b1255bc3879b04809c99fbea8485daf11271afa7 100644 --- a/python/paddle/fluid/tests/custom_op/test_custom_relu_op_jit.py +++ b/python/paddle/fluid/tests/custom_op/test_custom_relu_op_jit.py @@ -18,7 +18,7 @@ import paddle import numpy as np from paddle.utils.cpp_extension import load, get_build_directory from paddle.utils.cpp_extension.extension_utils import run_cmd -from utils import paddle_includes, extra_cc_args, extra_nvcc_args, IS_WINDOWS, IS_MAC +from utils import IS_MAC, extra_cc_args, extra_nvcc_args, paddle_includes from test_custom_relu_op_setup import custom_relu_dynamic, custom_relu_static from paddle.fluid.framework import _test_eager_guard # Because Windows don't use docker, the shared lib already exists in the diff --git a/python/paddle/fluid/tests/custom_op/test_custom_relu_op_setup.py b/python/paddle/fluid/tests/custom_op/test_custom_relu_op_setup.py index 0cc1b19e654bfa6045bdb82481067dffc07c67ab..14c8bb0c6f671eaf01d927e7a2492375dc30b1ab 100644 --- a/python/paddle/fluid/tests/custom_op/test_custom_relu_op_setup.py +++ b/python/paddle/fluid/tests/custom_op/test_custom_relu_op_setup.py @@ -18,8 +18,6 @@ import site import unittest import paddle import paddle.static as static -import tempfile -import subprocess import numpy as np from paddle.vision.transforms import Compose, Normalize from paddle.utils.cpp_extension.extension_utils import run_cmd diff --git a/python/paddle/fluid/tests/custom_op/test_custom_tanh_double_grad.py b/python/paddle/fluid/tests/custom_op/test_custom_tanh_double_grad.py index b36c99d1dfad7d04ba89084802b6620a8b0a4f39..fb65422758f38884ebbe578e01210c1ebb1e10d6 100644 --- a/python/paddle/fluid/tests/custom_op/test_custom_tanh_double_grad.py +++ b/python/paddle/fluid/tests/custom_op/test_custom_tanh_double_grad.py @@ -18,7 +18,6 @@ import numpy as np import paddle import paddle.fluid as fluid -import paddle.static as static from paddle.utils.cpp_extension import load, get_build_directory from paddle.utils.cpp_extension.extension_utils import run_cmd from utils import paddle_includes, extra_cc_args, extra_nvcc_args diff --git a/python/paddle/fluid/tests/custom_op/test_multi_out_jit.py b/python/paddle/fluid/tests/custom_op/test_multi_out_jit.py index a3d939df1245eb2585c693f83cd26be7ef88dd27..eb9b9e4677fd2f02193153900fbcf70d80f618d1 100644 --- a/python/paddle/fluid/tests/custom_op/test_multi_out_jit.py +++ b/python/paddle/fluid/tests/custom_op/test_multi_out_jit.py @@ -13,7 +13,6 @@ # limitations under the License. import os -import subprocess import unittest import numpy as np diff --git a/python/paddle/fluid/tests/custom_op/utils.py b/python/paddle/fluid/tests/custom_op/utils.py index 82361f2a30465a5e8fbf66917c3ad9ec2f083836..adce68cd0f969f983b74b19b4a21f34e32b2d1c2 100644 --- a/python/paddle/fluid/tests/custom_op/utils.py +++ b/python/paddle/fluid/tests/custom_op/utils.py @@ -14,7 +14,6 @@ import os import sys -import six from distutils.sysconfig import get_python_lib from paddle.utils.cpp_extension.extension_utils import IS_WINDOWS diff --git a/python/paddle/fluid/tests/custom_runtime/custom_device_multi_process_collective.py b/python/paddle/fluid/tests/custom_runtime/custom_device_multi_process_collective.py index 903cc9c7899ede30bb957f6a8f947f527765b8fc..21e987104269145c5e7aff37a2b23abfe96509cd 100644 --- a/python/paddle/fluid/tests/custom_runtime/custom_device_multi_process_collective.py +++ b/python/paddle/fluid/tests/custom_runtime/custom_device_multi_process_collective.py @@ -14,7 +14,6 @@ import os import sys -import time def train(prefix): diff --git a/python/paddle/fluid/tests/custom_runtime/process_group_xccl.py b/python/paddle/fluid/tests/custom_runtime/process_group_xccl.py index 71d76757c53df8ed9b1e04367fd1b59795d7d522..b830d0eccf526ad83f0d98c29afeaedacbbff2a0 100644 --- a/python/paddle/fluid/tests/custom_runtime/process_group_xccl.py +++ b/python/paddle/fluid/tests/custom_runtime/process_group_xccl.py @@ -15,12 +15,9 @@ 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 diff --git a/python/paddle/fluid/tests/custom_runtime/test_collective_process_group_xccl.py b/python/paddle/fluid/tests/custom_runtime/test_collective_process_group_xccl.py index 88b7bb8fd438059ead1ef435398064faa53c2d0e..1127352d85d9981da93694691f4e426fb1d006ed 100644 --- a/python/paddle/fluid/tests/custom_runtime/test_collective_process_group_xccl.py +++ b/python/paddle/fluid/tests/custom_runtime/test_collective_process_group_xccl.py @@ -14,7 +14,6 @@ import unittest import os -import sys import copy import subprocess import time @@ -27,7 +26,7 @@ def start_local_trainers(cluster, training_script_args, eager_mode=True, log_dir=None): - 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, watch_local_trainers, get_cluster, TrainerProc # noqa: F401 current_env = copy.copy(os.environ.copy()) #paddle broadcast ncclUniqueId use socket, and @@ -83,7 +82,7 @@ def start_local_trainers(cluster, def get_cluster_from_args(selected_gpus): - 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, watch_local_trainers, get_cluster, TrainerProc # noqa: F401 cluster_node_ips = '127.0.0.1' node_ip = '127.0.0.1' @@ -107,7 +106,7 @@ def get_cluster_from_args(selected_gpus): class TestMultipleCustomCPU(unittest.TestCase): def run_mnist_2custom_cpu(self, target_file_name, eager_mode=True): - 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, watch_local_trainers, get_cluster, TrainerProc # noqa: F401 selected_devices = [0, 1] cluster = None @@ -160,7 +159,7 @@ class TestProcessGroup(TestMultipleCustomCPU): self.temp_dir.cleanup() def test_process_group_xccl(self): - 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, watch_local_trainers, get_cluster, TrainerProc # noqa: F401 self.run_mnist_2custom_cpu('process_group_xccl.py') diff --git a/python/paddle/fluid/tests/custom_runtime/test_custom_cpu_plugin.py b/python/paddle/fluid/tests/custom_runtime/test_custom_cpu_plugin.py index 1bba2e73c0895d95b77b2eb04b5969ba8f5e2c26..79e3e506b906ed1cf12322f85ba5e21a823df086 100644 --- a/python/paddle/fluid/tests/custom_runtime/test_custom_cpu_plugin.py +++ b/python/paddle/fluid/tests/custom_runtime/test_custom_cpu_plugin.py @@ -14,7 +14,6 @@ import os import sys -import site import unittest import numpy as np import tempfile diff --git a/python/paddle/fluid/tests/custom_runtime/test_custom_cpu_profiler_plugin.py b/python/paddle/fluid/tests/custom_runtime/test_custom_cpu_profiler_plugin.py index 83c846f2ba092190fc2630e0f83ba78ce35e526b..2e307fbb826b530686e45ce529a8218f71a7553c 100644 --- a/python/paddle/fluid/tests/custom_runtime/test_custom_cpu_profiler_plugin.py +++ b/python/paddle/fluid/tests/custom_runtime/test_custom_cpu_profiler_plugin.py @@ -14,9 +14,7 @@ import os import sys -import site import unittest -import numpy as np import tempfile diff --git a/python/paddle/fluid/tests/custom_runtime/test_custom_cpu_to_static.py b/python/paddle/fluid/tests/custom_runtime/test_custom_cpu_to_static.py index 626b4a6c05fbae214347ac3a05368eba920d0d02..e5e9638a0b5314d562627185aa0f863e5e08e18f 100644 --- a/python/paddle/fluid/tests/custom_runtime/test_custom_cpu_to_static.py +++ b/python/paddle/fluid/tests/custom_runtime/test_custom_cpu_to_static.py @@ -24,7 +24,6 @@ BATCH_SIZE = 1024 def train_func_base(epoch_id, train_loader, model, cost, optimizer): - import paddle total_step = len(train_loader) epoch_start = time.time()