Commit Graph

5 Commits

Author SHA1 Message Date
Stella Laurenzo 5065839da7 Upstream the Quantizer tool (part 4).
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
2019-06-01 19:53:12 -07:00
Stella Laurenzo 8e5bfb85c4 Upstream the Quantizer tool (part 3).
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
2019-05-20 13:46:43 -07:00
Geoffrey Martin-Noble 090662c5f3 Rename VectorOrTensorType to ShapedType
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
2019-05-20 13:43:58 -07:00
Stella Laurenzo 79265887ff Upstreaming Quantizer tool (part 2).
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
2019-05-20 13:43:31 -07:00
Stella Laurenzo d4d8dc8db9 Start to introduce the "Quantizer" tool, which is responsible for 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
2019-05-20 13:42:30 -07:00