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)
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)
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_)])
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 '''
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])
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"])
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)
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)
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)
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)
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"])
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)
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)
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])
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"])
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"])
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])
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)
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)
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)
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" ])
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)
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)
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" ])
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)
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)