- Sep 16, 2018
-
-
Neta Zmora authored
* A temporary fix for issue 36 The thinning code assumes that the sgraph it is using is not data-parallel, because it (currently) accesses the layer-name keys using a "normalized" name ("module." is removed). The bug is that in thinning.py#L73 we create a data_parallel=True model; and then give it to sgraph. But in other places thinning code uses "normalized" keys. For example in thinning.py#L264. The temporary fix configures data_parallel=False in thinning.py#L73. A long term solution should have SummaryGraph know how to handle both parallel and not-parallel models. This can be done by having SummaryGraph convert layer-names it receives in the API to data_parallel=False using normalize_layer_name. When returning results, use the de-normalized format. * Fix the documentation error from issue 36 * Move some logs to debug and show in logging.conf how to enable DEBUG logs.
-
Neta Zmora authored
-
- Sep 03, 2018
-
-
Guy Jacob authored
* Implemented as a Policy * Integrated in image classification sample * Updated docs and README
-
- Aug 29, 2018
-
-
Neta Zmora authored
-
- Aug 27, 2018
-
-
Neta Zmora authored
Sometimes the gmin/gmax in group color-normalization ends up with a zero dimensional tensor, which needs to be accessed using .item()
-
Neta Zmora authored
Sometimes the gmin/gmax in group color-normalization ends up with a zero dimensional tensor, which needs to be accessed using .item()
-
Neta Zmora authored
-
- Aug 09, 2018
-
-
Guy Jacob authored
* Instead of a single additive value (which so far represented only the regularizer loss), callbacks return a new overall loss * Policy callbacks also return the individual loss components used to calculate the new overall loss. * Add boolean flag to the Scheduler's callback so applications can choose if they want to get individual loss components, or just the new overall loss * In compress_classifier.py, log the individual loss components * Add test for the loss-from-callback flow
-
- Aug 07, 2018
-
-
Neta Zmora authored
* Fix bug: thresholding matrix cols should use dim=0 (issue #39) See issue #39 for a description of the bug from @vinutah. * thresholding test: fix device assignment
-
- Jul 31, 2018
-
-
Haim Barad authored
Enabling Early Exit strategy in image classifier example
-
- Jul 25, 2018
-
-
Neta Zmora authored
We are using this file for more and more use-cases and we need to keep it readable and clean. I've tried to move code that is not in the main control-path to specific functions.
-
Neta Zmora authored
Aslo added a script to analyze model-spaces.
-
Neta Zmora authored
This is a convinence function used by customers of the scheduler, and might change location in the future.
-
Neta Zmora authored
Due to the various uses of these functions, we need to pass an ever growing number of arguments to these functions and the API is becoing bloated and unstable. Also added the option to log the confusion matrix.
-
- Jul 22, 2018
-
-
Gal Novik authored
-
Neta Zmora authored
-
Neta Zmora authored
-
Neta Zmora authored
Up until now I useda proxy for L1, but there's no reason not to use actual L1 magnitude.
-
Neta Zmora authored
-
Neta Zmora authored
-
Gal Novik authored
* Adding PACT quantization method * Move logic modifying the optimizer due to changes the quantizer makes into the Quantizer itself * Updated documentation and tests
-
- Jul 21, 2018
-
-
Neta Zmora authored
MagnitudeParameterPruner: document and test This is in response to a question in issue #19
-
- Jul 19, 2018
-
-
Guy Jacob authored
-
- Jul 17, 2018
-
-
Guy Jacob authored
-
Guy Jacob authored
* Add Quantizer unit tests * Require 'bits_overrides' to be OrderedDict to support overlapping patterns in a predictable manner + update documentation to reflect this * Quantizer class cleanup * Use "public" nn.Module APIs instead of protected attributes * Call the builtins set/get/delattr instead of the class special methods (__***__) * Fix issues reported in #24 * Bug in RangeLinearQuantParamLayerWrapper - add explicit override of pre_quantized_forward accpeting single input (#15) * Add DoReFa test to full_flow_tests
-
- Jul 15, 2018
-
-
Neta Zmora authored
This is now tested and supported when using CNNs and PyTorch 0.4
-
Neta Zmora authored
There are two different “namespaces” referring to module names: normalized and de-normalized. Normalized module names are module names that have the same format for both data-parallel and data-serial models. De-normalized module names are the “raw” PyTorch module names that reflect the full model graph. So if there is a container module such as nn.DataParallel in the model, then a sub-module’s name will have the “module” substring somewhere in it. SummaryGraph operates by converting the PyTorch to ONNX, and I’ve have issues handling nn.DataParallel in this process. Therefore, SummaryGraph uses only normalized names internally. PruningRecipe, on the other hand, uses de-normalized names because it needs to operate on the model itself. This is a sticky situation that can create really annoying bugs and makes for some ugly code. Nonetheless, this is the best I can do right now, and I’ll probably revisit this soon to make it nicer. For now, I’m pushing this commit that fixes the distinction between the two namespaces, and fixes related bugs – in the hope that it is not too brittle. append_module_directive – now uses denormalize_module_name to ensure recipe module names are denormalized. append_param_directive – because we are dealing with parameters, I can’t use denormalize_module_name as easily as in append_module_directive. The clean solution is kept for later :-(
-
Neta Zmora authored
-
Neta Zmora authored
Also add a warnning when swe can't find a node whose predecessors we're looking for.
-
- Jul 13, 2018
-
-
Neta Zmora authored
-
Neta Zmora authored
This is a merge of the ADC branch and master. ADC (using a DDPG RL agent to compress image classifiers) is still WiP and requires An unreleased version of Coach (https://github.com/NervanaSystems/coach). Small features in this commit: -Added model_find_module() - find module object given its name - Add channel ranking and pruning: pruning/ranked_structures_pruner.py - Add a CIFAR10 VGG16 model: models/cifar10/vgg_cifar.py - Thinning: change the level of some log messages – some of the messages were moved to ‘debug’ level because they are not usually interesting. - Add a function to print nicely formatted integers - distiller/utils.py - Sensitivity analysis for channels-removal - compress_classifier.py – handle keyboard interrupts - compress_classifier.py – fix re-raise of exceptions, so they maintain call-stack -Added tests: -- test_summarygraph.py: test_simplenet() - Added a regression test to target a bug that occurs when taking the predecessor of the first node in a graph -- test_ranking.py - test_ch_ranking, test_ranked_channel_pruning -- test_model_summary.py - test_png_generation, test_summary (sparsity/ compute/model/modules) - Bug fixes in this commit: -- Thinning bug fix: handle zero-sized 'indices' tensor During the thinning process, the 'indices' tensor can become zero-sized, and will have an undefiend length. Therefore, we need to check for this situation when assessing the number of elements in 'indices' -- Language model: adjust main.py to new distiller.model_summary API
-
- Jul 11, 2018
-
-
Neta Zmora authored
- Raise IOError instead of crude exit() when file is not found in the file-system - Test that the correct exception is raised when opening a non-existent checkpoint file
-
Neta Zmora authored
-
Neta Zmora authored
Remove the complicated logic trying to handle data-parallel models as serially-processed models, and vice versa. *Function distiller.utils.make_non_parallel_copy() does the heavy lifting of replacing all instances of nn.DataParallel in a model with instances of DoNothingModuleWrapper. The DoNothingModuleWrapper wrapper does nothing but forward to the wrapped module. This is a trick we use to transform a data-parallel model to a serial-processed model. *SummaryGraph uses a copy of the model after the model is processed by distiller.make_non_parallel_copy() which renders the model non-data-parallel. *The same goes for model_performance_summary() *Model inputs are explicitly placed on the Cuda device, since now all models are Executed on the CPU. Previously, if a model was not created using nn.DataParallel, then the model was not explicitly placed on the Cuda device. *The logic in distiller.CompressionScheduler that attempted to load a model parallel model and process it serially, or load a serial model and process it data-parallel, was removed. This removes a lot of fuzziness and makes the code more robust: we do not needlessly try to be heroes. * model summaries - remove pytorch 0.4 warning * create_model: remove redundant .cuda() call * Tests: support both parallel and serial tests
-
- Jul 09, 2018
-
-
Neta Zmora authored
The checkpoint file: examples/ssl/checkpoints/checkpoint_trained_channel_regularized_resnet20_finetuned.pth.tar did not contain the "thinning recipe" while the weight tensor stored within the checkpoint file have already been shrunk/thinned and this caused a mismatch. PyTorch models are defined in code. This includes the network architecture and connectivity (which layers are used and what is the forward path), but also the sizes for the parameter tensors and input/outputs. When the model is created the parameter tensors are also created, as defined or inferred from the code. When a checkpoint is loaded, they parameter tensors are read from the checkpoint and copied to the model's tensors. Therefore, the tensors in the checkpoint and in the model must have the same shape. If a model has been "thinned" and saved to a checkpoint, then the checkpoint tensors are "smaller" than the ones defined by the model. A "thinning recipe" is used to make changes to the model before copying the tensors from the checkpoint. In this case, the "thinning recipe" was missing.
-
- Jul 08, 2018
-
-
Neta Zmora authored
*connectivity_summary() does not use SummaryGraph correctly: Recently we changed the internal representation of SummaryGraph.ops, but connectivity_summary() and connectivity_summary_verbose() were not updated. Fixed that. *Extend the API of create_png(): Add to the signature of create_png() and create_pydot_graph() rankdir and External styles. These are explained in the docstrings. *Added documentation to the PNG drawing functions *Added tests to catch trivial connectivity_summary() bugs
-
Robert Muchsel authored
-
- Jul 05, 2018
-
-
Robert Muchsel authored
-
Guy Jacob authored
* More strict and explicit check for the parameter's type in weights_sparsity_summary * Expose 'param_dims' in weights_sparsity_tbl_summary as well * Some PEP8 related fixes
-
- Jul 03, 2018
-
-
Neta Zmora authored
Add a link to the Wiki
-