-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Conversation
Common base class for all compressors. | ||
|
||
This class is designed for other base classes. | ||
Algorithms should inherit ``Pruner`` or Quantizer instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quantizer -> Quantizer
if ret is None or ret.get('exclude'): | ||
return None | ||
return ret | ||
The compressed model can only execute in eager mode. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this statement still true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we apply masks by modifying weight variables, which can only be done in eager mode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so the performance will be affected if we apply masks on the model? how much performance degradation it would induce?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to check the performance degradation using simple test
|
||
If you want to prune the model during training, use callback API instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which one is callback API?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PrunerCallback
right?
The key is weight ``Variable``'s name. The value is a mask ``Tensor`` of weight's shape and dtype. | ||
If a weight's key does not appear in the return value, that weight will not be pruned. | ||
Returning ``None`` means the mask is not changed since last time. | ||
Weight names are globally unique, e.g. `model/conv_1/kernel:0`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very clear!
looks good. please add test for it and fix pipeline error |
}] | ||
pruner = FPGMPruner(model, config_list) | ||
pruner.compress() | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we should keep Chinese doc unchanged, and let @JunweiSUN to update Chinese doc using crowdin
Would you mind telling me why FPGM Pruner is removed? Is former version not work or you guys are work on a new version now? I may have to use filter pruning for CNN while there is almost no tensorflow related toolkit for it. Is there a stable version here?(no need to be latest) Much thanks! |
@tu1258 As model compression framework on NNI has been refactored, we will re-implement the algorithms on the new framework for tensorflow. also, highly recommend external contributors to contribute the compression algorithms. |
(cherry picked from commit 5623dbf)
No description provided.