summaryrefslogtreecommitdiffstats
path: root/mlir/test/Dialect/QuantOps
Commit message (Collapse)AuthorAgeFilesLines
* Refactor QuantOps TypeParser to use the DialectAsmParser methods directly.River Riddle2019-11-012-25/+25
| | | | | | This greatly simplifies the implementation and removes custom parser functionality. The necessary methods are added to the DialectAsmParser. PiperOrigin-RevId: 278015983
* Convert the Canonicalize and CSE passes to generic Operation Passes.River Riddle2019-10-241-1/+1
| | | | | | This allows for them to be used on other non-function, or even other function-like, operations. The algorithms are already generic, so this is simply changing the derived pass type. The majority of this change is just ensuring that the nesting of these passes remains the same, as the pass manager won't auto-nest them anymore. PiperOrigin-RevId: 276573038
* Add `axis` attribute to the quant.stats opFeng Liu2019-10-032-7/+23
| | | | | | | The first dim length of the axisStats attribute should equals to the slice size of the input argument when splitted by the axis dimension. PiperOrigin-RevId: 272798042
* Specalize f32->i8/u8 Quanitization with C++ native arithmetic to optimize ↵Jing Pu2019-09-221-1/+1
| | | | | | | | performance. The CL adds a rounding mode flag to the class and changes the default to rmNearestTiesToAway from rmNearestTiesToEven because 1) Tensorflow QuantizeV2 ops uses rmNearestTiesToAway; 2) the specialization only implements rmNearestTiesToAway. PiperOrigin-RevId: 270600739
* Quantize attribute values by per axis quantization parametersFeng Liu2019-09-191-0/+20
| | | | | | | | | | | A new converter with per axis quantization parameters is added to quantize a dense elements attribute. For each slice along the quantization axis, it creates an uniform quantized value converter, with different scale and zero point, and quantizes the values in the slice. The current implementation doesn't handle sparse elements attributes. PiperOrigin-RevId: 270121986
* Remove the constraint that min / max should stride zeroFeng Liu2019-09-102-27/+37
| | | | | | | | | | | | Since we apply nudging for the zero point to make sure the nudged zerop points can be in the range of [qmin, qmax], the constraint that rmin / rmax should stride zero isn't necessary. This also matches the documentation of tensorflow's FakeQuantWithMinMaxArgs op, where min and max don't need to stride zero: https://www.tensorflow.org/api_docs/python/tf/quantization/fake_quant_with_min_max_args PiperOrigin-RevId: 268296285
* Convert ConstFakeQuantPerAxis to qcast and dcast pairFeng Liu2019-09-101-0/+19
| | | | | | This is also to add the test to the fakeQuantAttrsToType for per-channel fake quant. PiperOrigin-RevId: 268260032
* Add quant.const_fake_quant_per_axis opFeng Liu2019-09-091-0/+15
| | | | | | | Comparing to the existing quant.const_fake_quant op, the min and max attributes of this new op is for each channel of last dimension of the input. PiperOrigin-RevId: 268093722
* Add tests to verify 0.0 is quantized correctlyFeng Liu2019-08-292-0/+93
| | | | | | We should consider both signed and narrow_range cases. PiperOrigin-RevId: 266167366
* Add an "is_signed" attribute to the quant_ConstFakeQuant opFeng Liu2019-07-191-1/+46
| | | | | | | | | | | Some TensorFlow simulated quantize ops such as QuantizeAndDequantizeV2Op have attribute for the sign of the quantization, so quant_ConstFakeQuant should be able to represent it with the new attribute is added. The method for converting these attributes to an QuantizedType is updated to handle this new argument. PiperOrigin-RevId: 258810290
* Change the attribute dictionary syntax to separate name and value with '='.River Riddle2019-06-254-25/+25
| | | | | | | | | | | The current syntax separates the name and value with ':', but ':' is already overloaded by several other things(e.g. trailing types). This makes the syntax difficult to parse in some situtations: Old: "foo: 10 : i32" New: "foo = 10 : i32" PiperOrigin-RevId: 255097928
* Modify the syntax of the the ElementsAttrs to print the type as a colon type.River Riddle2019-06-254-41/+41
| | | | | | | | | This is the standard syntax for types on operations, and is also already used by IntegerAttr and FloatAttr. Example: dense<5> : tensor<i32> dense<[3]> : tensor<1xi32> PiperOrigin-RevId: 255069157
* Rename -verify mlir-opt flag to -verify-expected-diagnosticsGeoffrey Martin-Noble2019-06-194-4/+4
| | | | | | This name has caused some confusion because it suggests that it's running op verification (and that this verification isn't getting run by default). PiperOrigin-RevId: 254035268
* Refactor SplatElementsAttr to inherit from DenseElementsAttr as opposed to ↵River Riddle2019-06-192-12/+12
| | | | | | being a separate Attribute type. DenseElementsAttr provides a better internal representation for splat values as well as better API for accessing elements. PiperOrigin-RevId: 253138287
* Move Quantization -> Dialect/QuantOps, FxpMathOps -> Dialect/FxpMathOps.Stella Laurenzo2019-05-2010-0/+759
Adding the additional layer of directory was discussed offline and matches the Target/ tree. The names match the defacto convention we seem to be following where the C++ namespace is ^(.+)Ops/$ matched against the directory name. This is in preparation for patching the Quantizer into this tree, which would have been confusing without moving the Quantization dialect to its more proper home. It is left to others to move other dialects if desired. Tested: ninja check-mlir -- PiperOrigin-RevId: 248171982
OpenPOWER on IntegriCloud