Skip to content
Snippets Groups Projects
  1. Feb 03, 2020
  2. Feb 02, 2020
    • Lev Zlotnik's avatar
      Loss Aware Post Train Quantization search (#432) · 0b493fd3
      Lev Zlotnik authored
      "Loss Aware Post-Training Quantization" (Nahshan et al., 2019)
      
      Paper: https://arxiv.org/abs/1911.07190 
      Reference implementation:
        https://github.com/ynahshan/nn-quantization-pytorch/tree/master/lapq
      
      Proper documentation is still TODO, for now see the example YAML file
      at 'examples/quantization/post_train_quant/resnet18_imagenet_post_train_lapq.yaml'
      
      * Implemented in distiller/quantization/ptq_coordinate_search.py
      * At the moment that file both the model-independent algorithm
        implementation and image-classification specific sample script.
        Still TODO: Refactor that
      
      * Post train quantization changes (range_linear):
        * Added getters/setters for quantization parameters (scale/zero_point)
          and clipping values
        * Add option to save backup of FP32 weights to allow re-quantization
          after quantizer was created.
        * Add option to clip weights in addition to activations
        * Fix fusions to not occur only when activations aren't quantized
        * RangeLinearFakeQuantWrapper:
          * Make inputs quantization optional
          * In case of ReLU + ACIQ, clip according to input stats
      
      * Data loaders:
        * Add option to not load train set at all from disk (to speed up
          loading time in post-training runs)
        * Modified "image_classifier.py" accordingly
      0b493fd3
  3. Jan 19, 2020
  4. Jan 18, 2020
  5. Jan 15, 2020
    • Guy Jacob's avatar
      Fix scale factor calculation in symmetric quantization (#463) · 78255ee0
      Guy Jacob authored
      (we use 8-bit values below, but this applies to any bit-width)
      * We use the notion of "full" and "restricted" quantized range for
        symmetric quantization (see section 2.2 in https://arxiv.org/abs/1806.08342)
      * "Full" quantized range ==> [-128, 127], "restircted" ==> [-127, 127]
      * Until now, when doing symmetric quantization we assumed a "full"
        range when saturating after quantization, but calculated the scale
        factor as if the range was restricted. This means we weren't making
        full utilization of the quantized range.
      * On the other hand, in some other implementations of quantization (e.g.
        TensorFlow), the "restricted" range is used.
      * So, we make it an option to use either the proper "full" range
        (q_min = -128) or "restricted" range (q_min = -127).
      * LinearQuantMode.SYMMETRIC now means the "full" range is used, and
        added LinearQuantMode.SYMMETRIC_RESTRICTED for using the "restricted"
        range.
      * Updated tests and documentation.
      78255ee0
  6. Jan 06, 2020
  7. Dec 30, 2019
  8. Dec 29, 2019
  9. Dec 26, 2019
  10. Dec 18, 2019
    • Bar's avatar
      IFM sparsity collector (#443) · cc50035e
      Bar authored
      Add directionality to SummaryActivationStatsCollector to allow collection of statistics on incoming and outgoing activations/feature-maps; instead of just outgoing activations.
      
      Also includes some code refactoring.
      cc50035e
  11. Dec 12, 2019
  12. Dec 11, 2019
  13. Dec 09, 2019
  14. Dec 08, 2019
    • Guy Jacob's avatar
      Enable weights/activations-only PTQ for conv/linear modules (#439) · 952028d0
      Guy Jacob authored
      * Weights-only PTQ:
        * Allow RangeLinearQuantWrapper to accept num_bits_acts = None, in
          which case it'll act as a simple pass-through during forward
        * In RangeLinearQuantParamLayerWrapper, if bits_activations is None
          and num_bits_params > 0, Perform quant and de-quant of the
          parameters instead of just quant.
      * Activations-only PTQ:
        * Enable activations only quantization for conv/linear modules. When
          PostTrainLinearQuantizer detects # bits != None for activations 
          and # bits == None for weights, a fake-quantization wrapper will
          be used.
      * Allow passing 0 in the `--qe-bits-acts` and `--qe-bits-wts` command
        line arguments to invoke weights/activations-only quantization,
        respectively.
      * Minor refactoring for clarity in PostTrainLinearQuantizer's replace_*
        functions
      952028d0
    • Guy Jacob's avatar
      Update PTQ ResNet-50 command line results · 326d172f
      Guy Jacob authored
      Results changed following commit 9e7ef987 (#402)
      326d172f
  15. Dec 03, 2019
  16. Dec 02, 2019
  17. Nov 28, 2019
  18. Nov 27, 2019
  19. Nov 25, 2019
    • Neta Zmora's avatar
      Resnet50 early-exit update · 8b341593
      Neta Zmora authored
      Update the definition of the exits using info from Haim.
      
      This is still very unsatsifactory because we don't have working
      examples to show users :-(
      8b341593
  20. Nov 17, 2019
  21. Nov 16, 2019
    • Neta Zmora's avatar
      Add README.md files for APG and DropFilter · 70e26735
      Neta Zmora authored
      70e26735
    • Neta Zmora's avatar
      Remove duplicate YAML file · 49933144
      Neta Zmora authored
      49933144
    • Neta Zmora's avatar
      Cifar models: remove explicit parameters initialization · 6913687f
      Neta Zmora authored
      except for the case of VGG, our parameter initialization code was
      matched the default pytorch initialization (per torch.nn operation),
      so writing the initialization code ourselves can only lead to
      more code and maintenance; and also we would not benefit from
      improvements that occur at the pytorch level (e.g. if FB finds a
      better initialization for nn.conv2d than today's kaiming init, we
      would not benefit).
      The VGG initialization we had was "suspicious" and so reverting
      to the default seems reasonable.
      6913687f
  22. Nov 14, 2019
    • Guy Jacob's avatar
      Update required PyTorch version check · fbdbe35a
      Guy Jacob authored
      fbdbe35a
    • Guy Jacob's avatar
      PyTorch 1.3 Support (#426) · b8b4cf32
      Guy Jacob authored
      * summary_graph.py:
        * Change ONNX op.uniqueName() to op.debugName()
        * Removed scope-naming workaround which isn't needed in PyTorch 1.3
      * Tests:
        * Naming of trace entries changed in 1.3. Fixed SummaryGraph unit
          test that checked that
        * Adjusted expected values in full_flow_tests
        * Adjusted tolerance in test_sim_bn_fold
        * Filter some new warnings
      b8b4cf32
  23. Nov 13, 2019
    • Neta Zmora's avatar
      enable load_checkpoint when chkpt_file has an initial component of ~ · 80cab7e6
      Neta Zmora authored
      Prevent exception when loading checkpoints from a home directory
      80cab7e6
    • Neta Zmora's avatar
      Distiller versioning - fix dual version strings · cadd07eb
      Neta Zmora authored
      Two strings represented the library version: one in distiller.__init__.py
      and one in setup.py.
      This can lead to two difference version string values.
      The fix: have distiller.__init__.py read the version string from the
      package installation.
      This assumes that we've installed distiller properly, but we've been
      making this assumption for a long time in our code (e.g. how we do
      imports of distiller from the `tests` directory).
      cadd07eb
Loading