Allows user to specify int8 scales via TF nodes.
Basic working example - all tensors have range of -5 to 5 [skip ci] Range of -0.1 to 0.1 seems to work decently [skip ci ] Load quantization numbers from txt file. Switching between prequant and calib now controlled by two bools (in convert_node.h and convert_graph.h - working on merging to a single control arg [skip ci] stuff in scripts for testing prequantized int8 [skip ci] Add python interface using dict and support dynamic op debug prints and inference scripts propagate First mode where we simply tell the user which ranges are missing if not all are supplied. Still need to infer some ranges backward through shuffle etc. Fix ConvertIdentity bug and add error checking to input binding [skip ci] cleanup and fix more [skip ci] Set softmax range. Fix some cases of inferring ranges. Remove theoretical Matmul infer. Don't print missing ranges for internal unnamed tensors Remove unneeded conversion of dict -> unordered_map (it had bugs with python2 strings causing python2 build to fail) [skip ci] Fix syntax error and infer backwards in another shuffle situation Pass weights through quant nodes unchanged. Fix broadcast issue with Relu6. Remove some problematic backwards infers Cleanup Cleanup Change arg to use_calibrate. Add unction to copy ranges. Add comments for features which are incomplete or not used. Fix identity conversion. Add missing code for Relu6 Add missing range copies and fix issue with const ITensor* Properly compute symmetric range. Fix const cast bug Fix bug with use_calibration arg. Change quantization range interface to use Converter class. Change range inferring algorithm to allow for multiple hops. Formatting fixes. Quant ops are format-agnostic to layout optimizer now. Exclude quant ops from FP16 and FP32 graphs. Rename scales to ranges. Formatting Add tests for quantization Fix bug with symmetric range calculation by switching to std::max. Improve tests (they will be broken until Transpose op is added). Add check for when mode is not int8 and calib=true Fix tests. Add comments and checks, small fixes. Fix candidate ops check. Log missing tensors unconditionally. Improve some comments. Revert ConvertIdentity to original implementation - the name check in convert_node is sufficient and adding the no-op shuffles introduced problems Don't use shuffle no-op as conversion for quantize, instead just pass tensor through. Shuffle no-op is not optimized away like we thought so it can interfere with TRT's node fusion, causing reduced accuracy Const bool
Loading
Please sign in to comment