MCPcopy
hub / github.com/OpenPPL/ppq / TargetPlatform

Class TargetPlatform

ppq/core/quant.py:36–120  ·  view source on GitHub ↗

TargetPlatform is a core abstraction of PPQ framework, it defines "platform" as an attribute of an operation. Platform attribute of an operation indicates where this operation is going to be deployed. This feature enables PPQ to simulate inter-device computing. Platform attribute al

Source from the content-addressed store, hash-verified

34
35
36class TargetPlatform(Enum):
37 """TargetPlatform is a core abstraction of PPQ framework, it defines
38 "platform" as an attribute of an operation. Platform attribute of an
39 operation indicates where this operation is going to be deployed. This
40 feature enables PPQ to simulate inter-device computing.
41
42 Platform attribute also tells PPQ how to quantize an operation, and how to execute it.
43 ATTENTION: Different platform might bring different behaviour of a same operation.
44 ATTENTION: Operation which is assigned to an non-quantizible platform will never be quantized.
45
46 There are several supported platforms for PPQ now,
47 however you are supposed to be aware of some particular platforms here:
48
49 SHAPE_OR_INDEX is a virtual platform, however it is an EXTREMELY IMPORTANT components in PPQ.
50 Dispatch an operation to platform SHAPE_OR_INDEX means this operation is SOI-related,
51 it processes a SOI tensor and gives a processed SOI, all calculation of this operation must be sent to CPU
52 (or any platform capable for calculating this.) when deploy.
53
54 An operation with SHAPE_OR_INDEX platform assigned will never be quantized regardless of its type.
55 It is a crucial feature for quantizing network that contains SOI-related operation. (Shufflenet etc.)
56
57 By default, PPQ automatically detects all SOI-related operations, and dispatch them to SHAPE_OR_INDEX platform.
58 To understand how this feature works, see also: ppq.sche
59
60 UNSPECIFIED is a virtual platform, all operations are sent to this platform once they were created.
61 Quantizer then dispatches them towards desired platform through its quantization logic.
62 """
63 MNN_INT8 = 100
64 TRT_INT8 = 101
65 TRT_FP8 = 105
66 NCNN_INT8 = 102
67 OPENVINO_INT8 = 103
68 TENGINE_INT8 = 104
69 ASC_INT8 = 106
70
71 PPL_CUDA_INT8 = 201
72 PPL_CUDA_INT4 = 202
73 PPL_CUDA_FP16 = 203
74 PPL_CUDA_MIX = 204
75
76 PPL_DSP_INT8 = 301
77 SNPE_INT8 = 302
78 PPL_DSP_TI_INT8 = 303
79 QNN_DSP_INT8 = 304
80
81 HOST_INT8 = 401
82
83 NXP_INT8 = 501
84 FPGA_INT8 = 502
85
86 RKNN_INT8 = 601
87
88 METAX_INT8_C = 701 # channel wise
89 METAX_INT8_T = 702 # tensor wise
90
91 HEXAGON_INT8 = 801
92 GRAPHCORE_FP8 = 901
93

Callers 1

dispatch_graphFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected