Esempio n. 1
0
 def sample_predictor_configs(self):
     config = CxxConfig()
     config.set_valid_places({
         Place(TargetType.X86, PrecisionType.FP32, DataLayoutType.NCHW),
         Place(TargetType.X86, PrecisionType.INT64, DataLayoutType.NCHW)
     })
     yield config, ["sequence_concat"], (1e-5, 1e-5)
Esempio n. 2
0
 def sample_predictor_configs(self):
     config = CxxConfig()
     config.set_valid_places({
         Place(TargetType.Host, PrecisionType.INT64, DataLayoutType.NCHW),
         Place(TargetType.Host, PrecisionType.INT32, DataLayoutType.NCHW)
     })
     yield config, ["ctc_align"], (1e-5, 1e-5)
Esempio n. 3
0
    def enable_testing_on_place(self,
                                target=None,
                                precision=None,
                                layout=None,
                                thread=None,
                                places=None) -> None:
        # set thread_num
        if isinstance(thread, list):
            self.thread_num = list(set(self.thread_num + thread))
        if isinstance(thread, int):
            self.thread_num.append(thread)
            self.thread_num = list(self.thread_num)

        # arm basic places:
        arm_basic_places = [
            Place(TargetType.ARM, PrecisionType.INT32),
            Place(TargetType.ARM, PrecisionType.INT64)
        ]

        # if list[Place] is inputed, this will be used directly
        if places is not None:
            assert isinstance(places, list)
            self.valid_places.append(places)
            return
        # otherwise we will generate a list[Place] from the inputed[target\precision\layout]
        assert (target is not None)
        target_ = target if isinstance(target, list) else [target]
        precision_ = precision if isinstance(precision, list) else [precision]
        layout_ = layout if isinstance(layout, list) else [layout]
        for tar_, pre_, lay_ in product(target_, precision_, layout_):
            if (tar_ == TargetType.ARM):
                self.valid_places.append([Place(tar_, pre_, lay_)] +
                                         arm_basic_places)
            else:
                self.valid_places.append([Place(tar_, pre_, lay_)])
Esempio n. 4
0
 def __init__(self, *args, **kwargs):
     AutoScanTest.__init__(self, *args, **kwargs)
     self.enable_testing_on_place(TargetType.X86,
                                  PrecisionType.FP32,
                                  DataLayoutType.NCHW,
                                  thread=[1, 4])
     self.enable_testing_on_place(TargetType.ARM,
                                  PrecisionType.FP32,
                                  DataLayoutType.NCHW,
                                  thread=[1, 4])
     self.enable_testing_on_place(TargetType.ARM,
                                  PrecisionType.FP16,
                                  DataLayoutType.NCHW,
                                  thread=[1, 4])
     opencl_places = [
         Place(TargetType.OpenCL, PrecisionType.FP16,
               DataLayoutType.ImageFolder),
         Place(TargetType.OpenCL, PrecisionType.FP32, DataLayoutType.NCHW),
         Place(TargetType.OpenCL, PrecisionType.Any,
               DataLayoutType.ImageFolder),
         Place(TargetType.OpenCL, PrecisionType.Any, DataLayoutType.NCHW),
         Place(TargetType.Host, PrecisionType.FP32)
     ]
     self.enable_testing_on_place(places=opencl_places)
     self.enable_testing_on_place(TargetType.NNAdapter, PrecisionType.FP32)
     self.enable_devices_on_nnadapter(device_names=[
         "kunlunxin_xtcl", "cambricon_mlu", "nvidia_tensorrt"
     ])
 def __init__(self, *args, **kwargs):
     FusePassAutoScanTest.__init__(self, *args, **kwargs)
     self.ops = []
     arm_places = [
         Place(TargetType.ARM, PrecisionType.FP32, DataLayoutType.NCHW),
         Place(TargetType.ARM, PrecisionType.FP16, DataLayoutType.NCHW),
         Place(TargetType.ARM, PrecisionType.INT8, DataLayoutType.NCHW)
     ]
     self.enable_testing_on_place(places=arm_places, thread=[1, 4])
     self.enable_testing_on_place(
         TargetType.X86, [PrecisionType.FP32],
         DataLayoutType.NCHW,
         thread=[1, 4])
     opencl_places = [
         Place(TargetType.OpenCL, PrecisionType.FP16,
               DataLayoutType.ImageDefault), Place(
                   TargetType.OpenCL, PrecisionType.FP16,
                   DataLayoutType.ImageFolder),
         Place(TargetType.OpenCL, PrecisionType.FP32, DataLayoutType.NCHW),
         Place(TargetType.OpenCL, PrecisionType.Any,
               DataLayoutType.ImageDefault), Place(
                   TargetType.OpenCL, PrecisionType.Any,
                   DataLayoutType.ImageFolder),
         Place(TargetType.OpenCL, PrecisionType.Any, DataLayoutType.NCHW),
         Place(TargetType.Host, PrecisionType.FP32)
     ]
     self.enable_testing_on_place(places=opencl_places)
     #Metal not support conv2d_transpose: cannot find the name
     '''
Esempio n. 6
0
 def __init__(self, *args, **kwargs):
     AutoScanTest.__init__(self, *args, **kwargs)
     host_op_config = [
         Place(TargetType.Host, PrecisionType.Any, DataLayoutType.NCHW),
         Place(TargetType.Host, PrecisionType.FP32, DataLayoutType.Any)
     ]
     self.enable_testing_on_place(places=host_op_config)
 def __init__(self, *args, **kwargs):
     AutoScanTest.__init__(self, *args, **kwargs)
     x86_places = [
         Place(TargetType.X86, PrecisionType.INT8, DataLayoutType.NCHW),
         Place(TargetType.X86, PrecisionType.FP32, DataLayoutType.NCHW)
     ]
     self.enable_testing_on_place(places=x86_places, thread=[1, 4])
Esempio n. 8
0
 def __init__(self, *args, **kwargs):
     AutoScanTest.__init__(self, *args, **kwargs)
     host_op_config = [
         Place(TargetType.Host, PrecisionType.Any, DataLayoutType.NCHW),
         Place(TargetType.Host, PrecisionType.FP32, DataLayoutType.Any)
     ]
     self.enable_testing_on_place(places=host_op_config)
     self.enable_testing_on_place(TargetType.NNAdapter, PrecisionType.FP32)
     self.enable_devices_on_nnadapter(device_names=["cambricon_mlu"])
Esempio n. 9
0
    def __init__(self, *args, **kwargs):
        AutoScanTest.__init__(self, *args, **kwargs)
        x86_places = [
            Place(TargetType.X86, PrecisionType.FP32, DataLayoutType.NCHW)
        ]
        self.enable_testing_on_place(places=x86_places)

        arm_places = [
            Place(TargetType.ARM, PrecisionType.FP32, DataLayoutType.NCHW)
        ]
        self.enable_testing_on_place(places=arm_places)

        # opencl demo
        opencl_places = [
            Place(TargetType.OpenCL, PrecisionType.FP16,
                  DataLayoutType.ImageDefault),
            Place(TargetType.OpenCL, PrecisionType.FP16,
                  DataLayoutType.ImageFolder),
            Place(TargetType.OpenCL, PrecisionType.FP32, DataLayoutType.NCHW),
            Place(TargetType.OpenCL, PrecisionType.Any,
                  DataLayoutType.ImageDefault),
            Place(TargetType.OpenCL, PrecisionType.Any,
                  DataLayoutType.ImageFolder),
            Place(TargetType.OpenCL, PrecisionType.Any, DataLayoutType.NCHW),
            Place(TargetType.Host, PrecisionType.FP32)
        ]
        self.enable_testing_on_place(places=opencl_places)
Esempio n. 10
0
    def __init__(self, *args, **kwargs):
        AutoScanTest.__init__(self, *args, **kwargs)
        x86_places = [
            Place(TargetType.X86, PrecisionType.FP32, DataLayoutType.NCHW)
        ]
        self.enable_testing_on_place(places=x86_places)

        arm_places = [
            Place(TargetType.ARM, PrecisionType.FP32, DataLayoutType.NCHW)
        ]
        self.enable_testing_on_place(places=arm_places)
        self.enable_testing_on_place(TargetType.NNAdapter, PrecisionType.FP32)
        self.enable_devices_on_nnadapter(device_names=[
            "kunlunxin_xtcl", "nvidia_tensorrt", "intel_openvino"
        ])

        opencl_places = [
            Place(TargetType.OpenCL, PrecisionType.FP16,
                  DataLayoutType.ImageDefault),
            Place(TargetType.OpenCL, PrecisionType.FP16,
                  DataLayoutType.ImageFolder),
            Place(TargetType.OpenCL, PrecisionType.FP32, DataLayoutType.NCHW),
            Place(TargetType.OpenCL, PrecisionType.Any,
                  DataLayoutType.ImageDefault),
            Place(TargetType.OpenCL, PrecisionType.Any,
                  DataLayoutType.ImageFolder),
            Place(TargetType.OpenCL, PrecisionType.Any, DataLayoutType.NCHW),
            Place(TargetType.Host, PrecisionType.FP32)
        ]
        self.enable_testing_on_place(places=opencl_places)
Esempio n. 11
0
    def __init__(self, *args, **kwargs):
        AutoScanTest.__init__(self, *args, **kwargs)
        self.enable_testing_on_place(TargetType.Host,
                                     PrecisionType.FP32,
                                     DataLayoutType.NCHW,
                                     thread=[1, 2])

        # opencl
        opencl_valid_places = [
            Place(TargetType.OpenCL, PrecisionType.FP16,
                  DataLayoutType.ImageDefault),
            Place(TargetType.OpenCL, PrecisionType.FP16,
                  DataLayoutType.ImageFolder),
            Place(TargetType.OpenCL, PrecisionType.FP32, DataLayoutType.NCHW),
            Place(TargetType.OpenCL, PrecisionType.Any,
                  DataLayoutType.ImageDefault),
            Place(TargetType.OpenCL, PrecisionType.Any,
                  DataLayoutType.ImageFolder),
            Place(TargetType.OpenCL, PrecisionType.Any, DataLayoutType.NCHW),
            Place(TargetType.Host, PrecisionType.FP32)
        ]
        self.enable_testing_on_place(places=opencl_valid_places)

        # metal not support now
        metal_places = [
            Place(TargetType.Metal, PrecisionType.FP32,
                  DataLayoutType.MetalTexture2DArray),
            Place(TargetType.Metal, PrecisionType.FP16,
                  DataLayoutType.MetalTexture2DArray)
        ]
        self.enable_testing_on_place(places=metal_places)
Esempio n. 12
0
    def __init__(self, *args, **kwargs):
        AutoScanTest.__init__(self, *args, **kwargs)
        x86_places = [
            Place(TargetType.X86, PrecisionType.FP32, DataLayoutType.NCHW)
        ]
        self.enable_testing_on_place(places=x86_places)

        arm_places = [
            Place(TargetType.ARM, PrecisionType.FP32, DataLayoutType.NCHW)
        ]
        self.enable_testing_on_place(places=arm_places)
Esempio n. 13
0
    def __init__(self, *args, **kwargs):
        AutoScanTest.__init__(self, *args, **kwargs)
        host_places = [
            Place(TargetType.Host, PrecisionType.FP32, DataLayoutType.NCHW)
        ]
        self.enable_testing_on_place(places=host_places)

        # opencl demo
        opencl_places = [
            Place(TargetType.OpenCL, PrecisionType.FP16,
                  DataLayoutType.ImageDefault),
            Place(TargetType.OpenCL, PrecisionType.FP16,
                  DataLayoutType.ImageFolder),
            Place(TargetType.OpenCL, PrecisionType.FP32, DataLayoutType.NCHW),
            Place(TargetType.OpenCL, PrecisionType.Any,
                  DataLayoutType.ImageDefault),
            Place(TargetType.OpenCL, PrecisionType.Any,
                  DataLayoutType.ImageFolder),
            Place(TargetType.OpenCL, PrecisionType.Any, DataLayoutType.NCHW),
            Place(TargetType.Host, PrecisionType.FP32)
        ]
        self.enable_testing_on_place(places=opencl_places)
        self.enable_testing_on_place(TargetType.NNAdapter, PrecisionType.FP32)
        self.enable_devices_on_nnadapter(
            device_names=["cambricon_mlu", "nvidia_tensorrt"])
Esempio n. 14
0
 def __init__(self, *args, **kwargs):
     AutoScanTest.__init__(self, *args, **kwargs)
     self.enable_testing_on_place(TargetType.Host,
                                  PrecisionType.FP32,
                                  DataLayoutType.NCHW,
                                  thread=[1, 4])
     metal_places = [
         Place(TargetType.Metal, PrecisionType.FP32,
               DataLayoutType.MetalTexture2DArray),
         Place(TargetType.Metal, PrecisionType.FP16,
               DataLayoutType.MetalTexture2DArray),
         Place(TargetType.ARM, PrecisionType.FP32),
         Place(TargetType.Host, PrecisionType.FP32)
     ]
     self.enable_testing_on_place(places=metal_places)
Esempio n. 15
0
    def sample_predictor_configs(self):
        config = CxxConfig()
        config.set_valid_places(
            {Place(TargetType.ARM, PrecisionType.FP32, DataLayoutType.NCHW)})
        config.set_threads(1)

        yield config, ["fusion_elementwise_add_activation"], (1e-5, 1e-5)
Esempio n. 16
0
    def __init__(self, *args, **kwargs):
        AutoScanTest.__init__(self, *args, **kwargs)

        host_places = [
            Place(TargetType.Host, PrecisionType.FP32, DataLayoutType.NCHW)
        ]
        self.enable_testing_on_place(places=host_places, thread=[1, 4])
Esempio n. 17
0
 def __init__(self, *args, **kwargs):
     AutoScanTest.__init__(self, *args, **kwargs)
     self.enable_testing_on_place(TargetType.Host,
                                  PrecisionType.FP32,
                                  DataLayoutType.NCHW,
                                  thread=[1, 4])
     metal_places = [
         Place(TargetType.Metal, PrecisionType.FP32,
               DataLayoutType.MetalTexture2DArray),
         Place(TargetType.Metal, PrecisionType.FP16,
               DataLayoutType.MetalTexture2DArray),
         Place(TargetType.ARM, PrecisionType.FP32),
         Place(TargetType.Host, PrecisionType.FP32)
     ]
     self.enable_testing_on_place(places=metal_places)
     self.enable_testing_on_place(TargetType.NNAdapter, PrecisionType.FP32)
     self.enable_devices_on_nnadapter(device_names=["cambricon_mlu"])
Esempio n. 18
0
 def __init__(self, *args, **kwargs):
     AutoScanTest.__init__(self, *args, **kwargs)
     host_places = [
         Place(TargetType.Host, PrecisionType.FP32, DataLayoutType.NCHW)
     ]
     self.enable_testing_on_place(places=host_places, thread=[1, 4])
     self.enable_testing_on_place(TargetType.NNAdapter, PrecisionType.FP32)
     self.enable_devices_on_nnadapter(device_names=["nvidia_tensorrt"])
 def __init__(self, *args, **kwargs):
     AutoScanTest.__init__(self, *args, **kwargs)
     self.enable_testing_on_place(
         TargetType.X86,
         PrecisionType.FP32,
         DataLayoutType.NCHW,
         thread=[1, 4])
     self.enable_testing_on_place(
         TargetType.ARM, [PrecisionType.FP32, PrecisionType.INT32],
         DataLayoutType.NCHW,
         thread=[1, 4])
     opencl_valid_places = [
         Place(TargetType.OpenCL, PrecisionType.FP16,
               DataLayoutType.ImageDefault), Place(
                   TargetType.OpenCL, PrecisionType.FP16,
                   DataLayoutType.ImageFolder),
         Place(TargetType.OpenCL, PrecisionType.FP32, DataLayoutType.NCHW),
         Place(TargetType.OpenCL, PrecisionType.Any,
               DataLayoutType.ImageDefault), Place(
                   TargetType.OpenCL, PrecisionType.Any,
                   DataLayoutType.ImageFolder),
         Place(TargetType.OpenCL, PrecisionType.Any, DataLayoutType.NCHW),
         Place(TargetType.Host, PrecisionType.FP32)
     ]
     self.enable_testing_on_place(places=opencl_valid_places)
     self.enable_testing_on_place(TargetType.NNAdapter, PrecisionType.FP32)
     self.enable_devices_on_nnadapter(device_names=["nvidia_tensorrt"])
Esempio n. 20
0
 def __init__(self, *args, **kwargs):
     FusePassAutoScanTest.__init__(self, *args, **kwargs)
     self.enable_testing_on_place(TargetType.ARM,
                                  PrecisionType.FP32,
                                  DataLayoutType.NCHW,
                                  thread=[1, 4])
     #opencl
     opencl_places = [
         Place(TargetType.OpenCL, PrecisionType.FP16,
               DataLayoutType.ImageDefault),
         Place(TargetType.OpenCL, PrecisionType.FP16,
               DataLayoutType.ImageFolder),
         Place(TargetType.OpenCL, PrecisionType.FP32, DataLayoutType.NCHW),
         Place(TargetType.OpenCL, PrecisionType.Any,
               DataLayoutType.ImageDefault),
         Place(TargetType.OpenCL, PrecisionType.Any,
               DataLayoutType.ImageFolder),
         Place(TargetType.OpenCL, PrecisionType.Any, DataLayoutType.NCHW),
         Place(TargetType.Host, PrecisionType.FP32)
     ]
     self.enable_testing_on_place(places=opencl_places)
     self.enable_testing_on_place(TargetType.X86,
                                  PrecisionType.FP32,
                                  DataLayoutType.NCHW,
                                  thread=[1, 4])
Esempio n. 21
0
 def __init__(self, *args, **kwargs):
     AutoScanTest.__init__(self, *args, **kwargs)
     # precision bugs will be fix in the future
     self.enable_testing_on_place(
         TargetType.ARM, [PrecisionType.FP16, PrecisionType.FP32],
         DataLayoutType.NCHW,
         thread=[1, 4])
     self.enable_testing_on_place(
         TargetType.X86,
         PrecisionType.FP32,
         DataLayoutType.NCHW,
         thread=[1, 4])
     self.enable_testing_on_place(
         TargetType.Metal,
         PrecisionType.FP32,
         DataLayoutType.NCHW,
         thread=[1, 4])
     opencl_places = [
         Place(TargetType.OpenCL, PrecisionType.FP16,
               DataLayoutType.ImageDefault), Place(
                   TargetType.OpenCL, PrecisionType.FP16,
                   DataLayoutType.ImageFolder),
         Place(TargetType.OpenCL, PrecisionType.FP32, DataLayoutType.NCHW),
         Place(TargetType.OpenCL, PrecisionType.Any,
               DataLayoutType.ImageDefault), Place(
                   TargetType.OpenCL, PrecisionType.Any,
                   DataLayoutType.ImageFolder),
         Place(TargetType.OpenCL, PrecisionType.Any, DataLayoutType.NCHW),
         Place(TargetType.Host, PrecisionType.FP32)
     ]
     self.enable_testing_on_place(places=opencl_places)
Esempio n. 22
0
 def __init__(self, *args, **kwargs):
     AutoScanTest.__init__(self, *args, **kwargs)
     self.enable_testing_on_place(TargetType.NNAdapter, PrecisionType.FP32)
     self.enable_devices_on_nnadapter(
         device_names=["cambricon_mlu", "nvidia_tensorrt"])
     # precision bugs will be fix in the future
     self.enable_testing_on_place(TargetType.ARM,
                                  [PrecisionType.FP16, PrecisionType.FP32],
                                  DataLayoutType.NCHW,
                                  thread=[1, 4])
     self.enable_testing_on_place(TargetType.X86,
                                  PrecisionType.FP32,
                                  DataLayoutType.NCHW,
                                  thread=[1, 4])
     self.enable_testing_on_place(TargetType.Metal,
                                  PrecisionType.FP32,
                                  DataLayoutType.NCHW,
                                  thread=[1, 4])
     opencl_places = [
         Place(TargetType.OpenCL, PrecisionType.FP16,
               DataLayoutType.ImageDefault),
         Place(TargetType.OpenCL, PrecisionType.FP16,
               DataLayoutType.ImageFolder),
         Place(TargetType.OpenCL, PrecisionType.FP32, DataLayoutType.NCHW),
         Place(TargetType.OpenCL, PrecisionType.Any,
               DataLayoutType.ImageDefault),
         Place(TargetType.OpenCL, PrecisionType.Any,
               DataLayoutType.ImageFolder),
         Place(TargetType.OpenCL, PrecisionType.Any, DataLayoutType.NCHW),
         Place(TargetType.Host, PrecisionType.FP32)
     ]
     self.enable_testing_on_place(places=opencl_places)
Esempio n. 23
0
 def sample_predictor_configs(self):
     config = CxxConfig()
     config.set_valid_places({
         Place(TargetType.OpenCL, PrecisionType.FP16,
               DataLayoutType.ImageDefault),
         Place(TargetType.OpenCL, PrecisionType.FP16,
               DataLayoutType.ImageFolder),
         Place(TargetType.OpenCL, PrecisionType.FP32, DataLayoutType.NCHW),
         Place(TargetType.OpenCL, PrecisionType.Any,
               DataLayoutType.ImageDefault),
         Place(TargetType.OpenCL, PrecisionType.Any,
               DataLayoutType.ImageFolder),
         Place(TargetType.OpenCL, PrecisionType.Any, DataLayoutType.NCHW),
         Place(TargetType.X86, PrecisionType.FP32),
         Place(TargetType.ARM, PrecisionType.FP32),
         Place(TargetType.Host, PrecisionType.FP32)
     })
     yield config, ['box_coder'], (1e-5, 1e-5)
Esempio n. 24
0
    def __init__(self, *args, **kwargs):
        AutoScanTest.__init__(self, *args, **kwargs)
        x86_valid_places = [
            Place(TargetType.X86, PrecisionType.FP32, DataLayoutType.NCHW)
        ]
        self.enable_testing_on_place(places=x86_valid_places, thread=[1, 4])
        self.enable_testing_on_place(TargetType.ARM,
                                     PrecisionType.FP32,
                                     DataLayoutType.NCHW,
                                     thread=[1, 4])
        # self.enable_testing_on_place(
        #     TargetType.ARM,
        #     PrecisionType.FP16,
        #     DataLayoutType.NCHW,
        #     thread=[1, 4])
        arm_valid_places = [
            Place(TargetType.ARM, PrecisionType.INT8, DataLayoutType.NCHW),
            Place(TargetType.ARM, PrecisionType.FP32, DataLayoutType.NCHW)
        ]
        self.enable_testing_on_place(places=arm_valid_places, thread=[1, 4])

        opencl_valid_places = [
            Place(TargetType.OpenCL, PrecisionType.FP16,
                  DataLayoutType.ImageDefault),
            Place(TargetType.OpenCL, PrecisionType.FP16,
                  DataLayoutType.ImageFolder),
            Place(TargetType.OpenCL, PrecisionType.FP32, DataLayoutType.NCHW),
            Place(TargetType.OpenCL, PrecisionType.Any,
                  DataLayoutType.ImageDefault),
            Place(TargetType.OpenCL, PrecisionType.Any,
                  DataLayoutType.ImageFolder),
            Place(TargetType.OpenCL, PrecisionType.Any, DataLayoutType.NCHW),
            Place(TargetType.Host, PrecisionType.FP32)
        ]
        self.enable_testing_on_place(places=opencl_valid_places)
        self.enable_testing_on_place(TargetType.NNAdapter, PrecisionType.FP32)
        self.enable_devices_on_nnadapter(device_names=[
            "cambricon_mlu", "nvidia_tensorrt", "intel_openvino"
        ])
Esempio n. 25
0
 def __init__(self, *args, **kwargs):
     AutoScanTest.__init__(self, *args, **kwargs)
     host_places = [
         Place(TargetType.Host, PrecisionType.INT32, DataLayoutType.NCHW),
         Place(TargetType.Host, PrecisionType.INT64, DataLayoutType.NCHW),
         Place(TargetType.Host, PrecisionType.FP32, DataLayoutType.NCHW)
     ]
     self.enable_testing_on_place(thread=[1, 4], places=host_places)
     opencl_places = [
         Place(TargetType.OpenCL, PrecisionType.FP16,
               DataLayoutType.ImageDefault),
         Place(TargetType.OpenCL, PrecisionType.FP16,
               DataLayoutType.ImageFolder),
         Place(TargetType.OpenCL, PrecisionType.FP32, DataLayoutType.NCHW),
         Place(TargetType.OpenCL, PrecisionType.Any,
               DataLayoutType.ImageDefault),
         Place(TargetType.OpenCL, PrecisionType.Any,
               DataLayoutType.ImageFolder),
         Place(TargetType.OpenCL, PrecisionType.Any, DataLayoutType.NCHW),
         Place(TargetType.Host, PrecisionType.FP32)
     ]
     self.enable_testing_on_place(places=opencl_places)
Esempio n. 26
0
 def __init__(self, *args, **kwargs):
     AutoScanTest.__init__(self, *args, **kwargs)
     self.enable_testing_on_place(TargetType.Host,
                                  PrecisionType.FP32,
                                  DataLayoutType.NCHW,
                                  thread=[1, 2])
     # When Host and X86 exist at the same time, the error occurred.
     # self.enable_testing_on_place(
     #     TargetType.X86,
     #     PrecisionType.FP32,
     #     DataLayoutType.NCHW,
     #     thread=[1, 2])
     self.enable_testing_on_place(TargetType.ARM,
                                  PrecisionType.FP32,
                                  DataLayoutType.NCHW,
                                  thread=[1, 4])
     # Diff occurred.
     # self.enable_testing_on_place(
     #     TargetType.ARM,
     #     PrecisionType.FP16,
     #     DataLayoutType.NCHW,
     #     thread=[1, 4])
     opencl_places = [
         Place(TargetType.OpenCL, PrecisionType.FP16,
               DataLayoutType.ImageDefault),
         Place(TargetType.OpenCL, PrecisionType.FP32, DataLayoutType.NCHW),
         Place(TargetType.OpenCL, PrecisionType.FP16,
               DataLayoutType.ImageFolder),
         Place(TargetType.OpenCL, PrecisionType.Any,
               DataLayoutType.ImageDefault),
         Place(TargetType.OpenCL, PrecisionType.Any,
               DataLayoutType.ImageFolder),
         Place(TargetType.OpenCL, PrecisionType.Any, DataLayoutType.NCHW),
         Place(TargetType.Host, PrecisionType.FP32)
     ]
     self.enable_testing_on_place(places=opencl_places)
     metal_places = [
         Place(TargetType.Metal, PrecisionType.FP32,
               DataLayoutType.MetalTexture2DArray),
         Place(TargetType.Metal, PrecisionType.FP16,
               DataLayoutType.MetalTexture2DArray)
     ]
     self.enable_testing_on_place(places=metal_places)
 def __init__(self, *args, **kwargs):
     FusePassAutoScanTest.__init__(self, *args, **kwargs)
     #opencl not support padding_weights
     opencl_places = [
         Place(TargetType.OpenCL, PrecisionType.FP16,
               DataLayoutType.ImageDefault), Place(
                   TargetType.OpenCL, PrecisionType.FP16,
                   DataLayoutType.ImageFolder),
         Place(TargetType.OpenCL, PrecisionType.FP32, DataLayoutType.NCHW),
         Place(TargetType.OpenCL, PrecisionType.Any,
               DataLayoutType.ImageDefault), Place(
                   TargetType.OpenCL, PrecisionType.Any,
                   DataLayoutType.ImageFolder),
         Place(TargetType.OpenCL, PrecisionType.Any, DataLayoutType.NCHW),
         Place(TargetType.Host, PrecisionType.FP32)
     ]
     self.enable_testing_on_place(places=opencl_places)
Esempio n. 28
0
    def __init__(self, *args, **kwargs):
        AutoScanTest.__init__(self, *args, **kwargs)
        self.enable_testing_on_place(TargetType.Host,
                                     PrecisionType.FP32,
                                     DataLayoutType.NCHW,
                                     thread=[1, 2])

        # opencl
        opencl_places = [
            Place(TargetType.OpenCL, PrecisionType.FP16,
                  DataLayoutType.ImageDefault),
            Place(TargetType.OpenCL, PrecisionType.FP16,
                  DataLayoutType.ImageFolder),
            Place(TargetType.OpenCL, PrecisionType.FP32, DataLayoutType.NCHW),
            Place(TargetType.OpenCL, PrecisionType.Any,
                  DataLayoutType.ImageDefault),
            Place(TargetType.OpenCL, PrecisionType.Any,
                  DataLayoutType.ImageFolder),
            Place(TargetType.OpenCL, PrecisionType.Any, DataLayoutType.NCHW),
            Place(TargetType.Host, PrecisionType.FP32)
        ]
        self.enable_testing_on_place(places=opencl_places)

        # metal
        metal_places = [
            Place(TargetType.Metal, PrecisionType.FP32,
                  DataLayoutType.MetalTexture2DArray),
            Place(TargetType.Metal, PrecisionType.FP16,
                  DataLayoutType.MetalTexture2DArray)
        ]
        self.enable_testing_on_place(places=metal_places)
        self.enable_testing_on_place(TargetType.NNAdapter, PrecisionType.FP32)
        self.enable_devices_on_nnadapter(device_names=[
            "kunlunxin_xtcl", "cambricon_mlu", "nvidia_tensorrt",
            "intel_openvino"
        ])
Esempio n. 29
0
 def __init__(self, *args, **kwargs):
     AutoScanTest.__init__(self, *args, **kwargs)
     host_places = [
         Place(TargetType.Host, PrecisionType.INT32, DataLayoutType.NCHW),
         Place(TargetType.Host, PrecisionType.INT64, DataLayoutType.NCHW),
         Place(TargetType.Host, PrecisionType.FP32, DataLayoutType.NCHW)
     ]
     arm_places = [
         Place(TargetType.ARM, PrecisionType.INT32, DataLayoutType.NCHW),
         Place(TargetType.ARM, PrecisionType.INT64, DataLayoutType.NCHW),
         Place(TargetType.ARM, PrecisionType.FP32, DataLayoutType.NCHW)
     ]
     self.enable_testing_on_place(thread=[1, 4], places=host_places)
     self.enable_testing_on_place(thread=[1, 4], places=arm_places)
Esempio n. 30
0
    def __init__(self, *args, **kwargs):
        AutoScanTest.__init__(self, *args, **kwargs)
        x86_places = [
            Place(TargetType.X86, PrecisionType.FP32, DataLayoutType.NCHW)
        ]
        self.enable_testing_on_place(places=x86_places)

        arm_places = [
            Place(TargetType.ARM, PrecisionType.FP32, DataLayoutType.NCHW)
        ]
        self.enable_testing_on_place(places=arm_places)

        # opencl having diffs , big diff
        # opencl_places = [
        #     Place(TargetType.OpenCL, PrecisionType.FP16,
        #           DataLayoutType.ImageDefault), Place(
        #               TargetType.OpenCL, PrecisionType.FP16,
        #               DataLayoutType.ImageFolder),
        #     Place(TargetType.OpenCL, PrecisionType.FP32, DataLayoutType.NCHW),
        #     Place(TargetType.OpenCL, PrecisionType.Any,
        #           DataLayoutType.ImageDefault), Place(
        #               TargetType.OpenCL, PrecisionType.Any,
        #               DataLayoutType.ImageFolder),
        #     Place(TargetType.OpenCL, PrecisionType.Any, DataLayoutType.NCHW),
        #     Place(TargetType.Host, PrecisionType.FP32)
        # ]
        # self.enable_testing_on_place(places=opencl_places)

        metal_places = [
            Place(TargetType.Metal, PrecisionType.FP32,
                  DataLayoutType.MetalTexture2DArray),
            Place(TargetType.Metal, PrecisionType.FP16,
                  DataLayoutType.MetalTexture2DArray),
            Place(TargetType.ARM, PrecisionType.FP32),
            Place(TargetType.Host, PrecisionType.FP32)
        ]
        self.enable_testing_on_place(places=metal_places)