173
|
1 // RUN: mlir-opt %s -split-input-file -verify-diagnostics
|
|
2
|
|
3 // -----
|
|
4 // Invalid type.
|
|
5 // expected-error@+1 {{unknown quantized type foobar}}
|
236
|
6 !qalias = !quant.foobar
|
173
|
7
|
|
8 // -----
|
|
9 // Unrecognized token: illegal token
|
|
10 // expected-error@+1 {{unknown quantized type __}}
|
236
|
11 !qalias = !quant.__
|
173
|
12
|
|
13 // -----
|
|
14 // Unrecognized token: trailing
|
|
15 // expected-error@+1 {{expected '>'}}
|
236
|
16 !qalias = !quant.uniform<i8<-4:3>:f32, 0.99872:127 23>
|
173
|
17
|
|
18 // -----
|
|
19 // Unrecognized token: missing storage type maximum
|
|
20 // expected-error@+1 {{expected ':'}}
|
236
|
21 !qalias = !quant.uniform<i8<16>:f32, 0.99872:127>
|
173
|
22
|
|
23 // -----
|
|
24 // Unrecognized token: missing closing angle bracket
|
236
|
25 // expected-error@+1 {{unbalanced '<' character in pretty dialect name}}
|
|
26 !qalias = !quant<uniform<i8<-4:3:f32, 0.99872:127>>
|
173
|
27
|
|
28 // -----
|
|
29 // Unrecognized token: missing type colon
|
|
30 // expected-error@+1 {{expected ':'}}
|
236
|
31 !qalias = !quant.uniform<i8<-4:3>f32, 0.99872:127>
|
173
|
32
|
|
33 // -----
|
|
34 // Unrecognized token: missing comma
|
|
35 // expected-error@+1 {{expected ','}}
|
236
|
36 !qalias = !quant.uniform<i8<-4:3>:f32 0.99872:127>
|
173
|
37
|
|
38 // -----
|
|
39 // Unrecognized storage type: illegal prefix
|
|
40 // expected-error@+1 {{illegal storage type prefix}}
|
236
|
41 !qalias = !quant.uniform<int8<-4:3>:f32, 0.99872:127>
|
173
|
42
|
|
43 // -----
|
|
44 // Unrecognized storage type: no width
|
|
45 // expected-error@+1 {{illegal storage type prefix}}
|
236
|
46 !qalias = !quant.uniform<i<-4:3>:f32, 0.99872:127>
|
173
|
47
|
|
48 // -----
|
|
49 // Unrecognized storage type: storage size > 32
|
|
50 // expected-error@+1 {{illegal storage type size: 33}}
|
236
|
51 !qalias = !quant.uniform<i33:f32, 0.99872:127>
|
173
|
52
|
|
53 // -----
|
|
54 // Unrecognized storage type: storage size < 0
|
|
55 // expected-error@+1 {{illegal storage type prefix}}
|
236
|
56 !qalias = !quant.uniform<i-1<-4:3>:f32, 0.99872:127>
|
173
|
57
|
|
58 // -----
|
221
|
59 // Unrecognized storage type: storage size
|
173
|
60 // expected-error@+1 {{invalid integer width}}
|
236
|
61 !qalias = !quant.uniform<i123123123120<-4:3>:f32, 0.99872:127>
|
173
|
62
|
|
63 // -----
|
|
64 // Illegal storage min/max: max - min < 0
|
|
65 // expected-error@+1 {{illegal storage min and storage max: (2:1)}}
|
236
|
66 !qalias = !quant.uniform<i8<2:1>:f32, 0.99872:127>
|
173
|
67
|
|
68 // -----
|
|
69 // Illegal storage min/max: max - min == 0
|
|
70 // expected-error@+1 {{illegal storage min and storage max: (1:1)}}
|
236
|
71 !qalias = !quant.uniform<i8<1:1>:f32, 0.99872:127>
|
173
|
72
|
|
73 // -----
|
|
74 // Illegal storage min/max: max > defaultMax
|
|
75 // expected-error@+1 {{illegal storage type maximum: 9}}
|
236
|
76 !qalias = !quant.uniform<i4<-1:9>:f32, 0.99872:127>
|
173
|
77
|
|
78 // -----
|
|
79 // Illegal storage min/max: min < defaultMin
|
|
80 // expected-error@+1 {{illegal storage type minimum: -9}}
|
236
|
81 !qalias = !quant.uniform<i4<-9:1>:f32, 0.99872:127>
|
173
|
82
|
|
83 // -----
|
|
84 // Illegal uniform params: invalid scale
|
|
85 // expected-error@+1 {{expected floating point literal}}
|
236
|
86 !qalias = !quant.uniform<i8<-4:3>:f32, abc:127>
|
173
|
87
|
|
88 // -----
|
|
89 // Illegal uniform params: invalid zero point separator
|
|
90 // expected-error@+1 {{expected '>'}}
|
236
|
91 !qalias = !quant.uniform<i8<-4:3>:f32, 0.1abc>
|
173
|
92
|
|
93 // -----
|
|
94 // Illegal uniform params: missing zero point
|
|
95 // expected-error@+1 {{expected integer value}}
|
236
|
96 !qalias = !quant.uniform<i8<-4:3>:f32, 0.1:>
|
173
|
97
|
|
98 // -----
|
|
99 // Illegal uniform params: invalid zero point
|
|
100 // expected-error@+1 {{expected integer value}}
|
236
|
101 !qalias = !quant.uniform<i8<-4:3>:f32, 0.1:abc>
|
173
|
102
|
|
103 // -----
|
|
104 // Illegal expressed type: f33
|
|
105 // expected-error@+1 {{expected non-function type}}
|
236
|
106 !qalias = !quant.uniform<i8<-4:3>:f33, 0.99872:127>
|
173
|
107
|
|
108 // -----
|
|
109 // Illegal scale: negative
|
|
110 // expected-error@+1 {{illegal scale: -1.000000}}
|
236
|
111 !qalias = !quant.uniform<i8<-4:3>:f32, -1.0:127>
|
173
|
112
|
|
113 // -----
|
|
114 // Illegal uniform params: missing quantized dimension
|
|
115 // expected-error@+1 {{expected integer value}}
|
236
|
116 !qalias = !quant.uniform<i8<-4:3>:f32:, {2.000000e+02:-19.987200e-01:1}>
|
173
|
117
|
|
118 // -----
|
|
119 // Illegal uniform params: unspecified quantized dimension, when multiple scales
|
|
120 // provided.
|
|
121 // expected-error@+1 {{expected floating point literal}}
|
236
|
122 !qalias = !quant.uniform<i8<-4:3>:f32, {2.000000e+02,-19.987200e-01:1}>
|