summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Quantizer
Commit message (Collapse)AuthorAgeFilesLines
* [mlir] NFC: Remove Value::operator* and Value::operator-> now that Value is ↵River Riddle2020-01-114-26/+26
| | | | | | | | | | properly value-typed. Summary: These were temporary methods used to simplify the transition. Reviewed By: antiagainst Differential Revision: https://reviews.llvm.org/D72548
* NFC: Replace ValuePtr with Value and remove it now that Value is value-typed.River Riddle2019-12-232-8/+8
| | | | | | ValuePtr was a temporary typedef during the transition to a value-typed Value. PiperOrigin-RevId: 286945714
* Adjust License.txt file to use the LLVM licenseMehdi Amini2019-12-2311-143/+44
| | | | PiperOrigin-RevId: 286906740
* NFC: Introduce new ValuePtr/ValueRef typedefs to simplify the transition to ↵River Riddle2019-12-223-9/+9
| | | | | | | | | | Value being value-typed. This is an initial step to refactoring the representation of OpResult as proposed in: https://groups.google.com/a/tensorflow.org/g/mlir/c/XXzzKhqqF_0/m/v6bKb08WCgAJ This change will make it much simpler to incrementally transition all of the existing code to use value-typed semantics. PiperOrigin-RevId: 286844725
* NFC: Cleanup non-conforming usages of namespaces.River Riddle2019-12-182-16/+7
| | | | | | | * Fixes use of anonymous namespace for static methods. * Uses explicit qualifiers(mlir::) instead of wrapping the definition with the namespace. PiperOrigin-RevId: 286222654
* NFC: Remove unnecessary 'llvm::' prefix from uses of llvm symbols declared ↵River Riddle2019-12-186-29/+25
| | | | | | | | in `mlir` namespace. Aside from being cleaner, this also makes the codebase more consistent. PiperOrigin-RevId: 286206974
* Fix minor spelling tweaks (NFC)Kazuaki Ishizaki2019-10-201-1/+1
| | | | | | Closes tensorflow/mlir#177 PiperOrigin-RevId: 275692653
* NFC: Remove trivial builder get methods.River Riddle2019-10-171-2/+2
| | | | | | These don't add any value, and some are even more restrictive than the respective static 'get' method. PiperOrigin-RevId: 275391240
* Fix typos, NFC.Christian Sigg2019-10-041-1/+1
| | | | PiperOrigin-RevId: 272851237
* Add `axis` attribute to the quant.stats opFeng Liu2019-10-031-3/+3
| | | | | | | 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
* NFC: Finish replacing FunctionPassBase/ModulePassBase with OpPassBase.River Riddle2019-09-133-3/+5
| | | | | | These directives were temporary during the generalization of FunctionPass/ModulePass to OpPass. PiperOrigin-RevId: 268970259
* NFC: Move LLVMIR, SDBM, and StandardOps to the Dialect/ directory.River Riddle2019-08-191-1/+1
| | | | PiperOrigin-RevId: 264193915
* Change from llvm::make_unique to std::make_uniqueJacques Pienaar2019-08-175-6/+6
| | | | | | | | Switch to C++14 standard method as llvm::make_unique has been removed ( https://reviews.llvm.org/D66259). Also mark some targets as c++14 to ease next integrates. PiperOrigin-RevId: 263953918
* Refactor ElementsAttr::getValue and DenseElementsAttr::getSplatValue.River Riddle2019-08-142-6/+4
| | | | | | All 'getValue' variants now require that the index is valid, queryable via 'isValidIndex'. 'getSplatValue' now requires that the attribute is a proper splat. This allows for querying these methods on DenseElementAttr with all possible value types; e.g. float, int, APInt, etc. This also allows for removing unnecessary conversions to Attribute that really want the underlying value. PiperOrigin-RevId: 263437337
* Express ownership transfer in PassManager API through std::unique_ptr (NFC)Mehdi Amini2019-08-123-6/+7
| | | | | | | | | | | | | | Since raw pointers are always passed around for IR construct without implying any ownership transfer, it can be error prone to have implicit ownership transferred the same way. For example this code can seem harmless: Pass *pass = .... pm.addPass(pass); pm.addPass(pass); pm.run(module); PiperOrigin-RevId: 263053082
* NFC: Update usages of OwningRewritePatternList to pass by & instead of &&.River Riddle2019-08-091-1/+1
| | | | | | This will allow for reusing the same pattern list, which may be costly to continually reconstruct, on multiple invocations. PiperOrigin-RevId: 262664599
* NFC: Implement OwningRewritePatternList as a class instead of a using directive.River Riddle2019-08-051-6/+3
| | | | | | This allows for proper forward declaration, as opposed to leaking the internal implementation via a using directive. This also allows for all pattern building to go through 'insert' methods on the OwningRewritePatternList, replacing uses of 'push_back' and 'RewriteListBuilder'. PiperOrigin-RevId: 261816316
* NFC: Remove `Module::getFunctions` in favor of a general `getOps<T>`.River Riddle2019-07-081-1/+1
| | | | | | Modules can now contain more than just Functions, this just updates the iteration API to reflect that. The 'begin'/'end' methods have also been updated to iterate over opaque Operations. PiperOrigin-RevId: 257099084
* NFC: Refactor Function to be value typed.River Riddle2019-07-013-3/+3
| | | | | | Move the data members out of Function and into a new impl storage class 'FunctionStorage'. This allows for Function to become value typed, which will greatly simplify the transition of Function to FuncOp(given that FuncOp is also value typed). PiperOrigin-RevId: 255983022
* Internal changeJacques Pienaar2019-06-281-2/+1
| | | | PiperOrigin-RevId: 255700627
* Update cmake depedency.Jacques Pienaar2019-06-271-0/+1
| | | | PiperOrigin-RevId: 255532863
* Move the emitError/Warning/Remark utility methods out of MLIRContext and ↵River Riddle2019-06-252-11/+8
| | | | | | | | into the mlir namespace. Now that Locations are attributes, they have direct access to the MLIR context. This allows for simplifying error emission by removing unnecessary context lookups. PiperOrigin-RevId: 255112791
* NFC: Rename FuncBuilder to OpBuilder and refactor to take a top level region ↵River Riddle2019-06-092-4/+4
| | | | | | instead of a function. PiperOrigin-RevId: 251563898
* Fix an msan warning for use of an uninitialized variable.River Riddle2019-06-011-1/+1
| | | | | | -- PiperOrigin-RevId: 250939301
* Avoid dyn_cast to ShapedTypeGeoffrey Martin-Noble2019-06-011-3/+2
| | | | | | | | | | ShapedType just indicates shape/rank/element semantics. It's generally not useful for other type checking. This check already checks for vector or tensor type, so we can use a direct cast if we check those first. Related to making MemRefType a subclass of ShapedType -- PiperOrigin-RevId: 250583231
* Address some build warnings.Jacques Pienaar2019-06-013-10/+3
| | | | | | -- PiperOrigin-RevId: 249986120
* Upstream the Quantizer tool (part 4).Stella Laurenzo2019-06-015-1/+554
| | | | | | | | | | | | This adds the basic passes needed and ties them into mlir-opt. Also adds two specific unit tests that exercise them. Next step is a standalone quantizer tool and additional cleanup. Tested: ninja check-mlir -- PiperOrigin-RevId: 249167690
* Upstream the Quantizer tool (part 3).Stella Laurenzo2019-05-202-0/+558
| | | | | | | | | | This upstreams the config and constraints for a reference quantization scheme based on the FxpMathOps dialect. There are probably two more CLs to get the rest: one with the passes/tests, and one with the tool main() itself. -- PiperOrigin-RevId: 248817505
* Rename VectorOrTensorType to ShapedTypeGeoffrey Martin-Noble2019-05-202-8/+8
| | | | | | | | | | | | This is in preparation for making it also support/be a parent class of MemRefType. MemRefs have similar shape/rank/element semantics and it would be useful to be able to use these same utilities for them. This CL should not change any semantics and only change variables, types, string literals, and comments. In follow-up CLs I will prepare all callers to handle MemRef types or remove their dependence on ShapedType. Discussion/Rationale in https://groups.google.com/a/tensorflow.org/forum/#!topic/mlir/cHLoyfGu8y8 -- PiperOrigin-RevId: 248476449
* Upstreaming Quantizer tool (part 2).Stella Laurenzo2019-05-204-0/+303
| | | | | | | | | | This adds some additional core types and utilities, notably the constraint analysis graph (CAG) structures, associated metadata and configuration policy object base class. The CAG is not particularly memory efficient as it stands now. I had started some work to turn it into a form that could be better managed by a bump pointer allocator but abandoned that for now in favor of having something that does semantically what I was going for as a starting point. -- PiperOrigin-RevId: 248413133
* Start to introduce the "Quantizer" tool, which is responsible for ↵Stella Laurenzo2019-05-202-0/+269
transforming a computation expressed in floating point to one operating in terms of quantized types (where possible), either using quant-aware-training hints where available or post-training statistics. This is being integrated from an experimental side repository piece by piece over the course of several patches and will ultimately include full build support, documentation and e2e tests. -- PiperOrigin-RevId: 248259895
OpenPOWER on IntegriCloud