-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Conversation
docs/en_US/Compression/Tutorial.rst
Outdated
* **op_names**\ : This is to specify by name what operations to be compressed. If this field is omitted, operations will not be filtered by it. | ||
* **exclude**\ : Default is False. If this field is True, it means the operations with specified types and names will be excluded from the compression. | ||
|
||
Some other keys are often specific to a certain algorithms, users can refer to `pruning algorithms <./Pruner.rst>`__ and `quantization algorithms <./Quantizer.rst>`__ for the keys allowed by each algorithm. |
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.
a certain algorithms -> a certain algorithm?
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.
fix it
docs/en_US/Compression/Tutorial.rst
Outdated
.. code-block:: python | ||
|
||
# Save quantized model which is generated by using NNI QAT algorithm | ||
torch.save(model.state_dict(), "quantized_model.pkt") |
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.
just curious, what is .pkt
mean, why not use .pth
?
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.
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.
.pkt
means 'Packet Tracer Network Simulation Model'. The reason why I use '.pkt' here is that I think model generated from QAT is simulated model not the real model. Of course we can use .pth
here.
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.
.pth
is be better
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.
fix it
* **op_types**\ : This is to specify what types of operations to be compressed. 'default' means following the algorithm's default setting. | ||
* **op_names**\ : This is to specify by name what operations to be compressed. If this field is omitted, operations will not be filtered by it. | ||
* **exclude**\ : Default is False. If this field is True, it means the operations with specified types and names will be excluded from the compression. | ||
Note that, ``pruner.compress`` simply adds masks on model weights, it does not include fine-tuning logic. If users want to fine tune the compressed model, they need to write the fine tune logic by themselves after ``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.
better to add a link to a simple example which fine-tunes the model
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.
Add an example code below.
|
||
Then, you can train your model using traditional training approach (e.g., SGD), pruning is applied transparently during the training. Some pruners prune once at the beginning, the following training can be seen as fine-tune. Some pruners prune your model iteratively, the masks are adjusted epoch by epoch during training. |
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 add one or two pruners which are one-shot pruner and interative pruners respectively. Or to add link to allow user to find out by themselves.
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.
Thanks! I think this quick start just shows the basic usage of the pruning process. More pruners can be found in basic_pruners_torch
, so I add the link below.
@colorjam looks much better than our previous version :) |
@quanlu Thanks~ Fix issues according to the comments, please review the latest version. |
@@ -1,16 +1,121 @@ | |||
Python API Reference of Compression Utilities | |||
============================================= | |||
Compression Reference |
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.
Model Compression API Reference
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.
changed
docs/en_US/Compression/Tutorial.rst
Outdated
Export compression result | ||
------------------------- | ||
|
||
Export the pruend model |
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.
pruend?
Done:
advanced.rst
.