Skip to content

Commit

Permalink
Update optim-levels-guide.md
Browse files Browse the repository at this point in the history
grammar nits
  • Loading branch information
jeanniefinks committed Jul 13, 2023
1 parent 9052b5b commit c3d3995
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions docs/optim-levels-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ limitations under the License.
# Sparsify Optim (Sparsification) Levels Guide

When using Sparsify, the optim (sparsification) level is one of the top arguments you should decide on.
Specifically, it controls how much sparsification is applied to your model with higher values resulting in faster and more compressed models.
Specifically, it controls how much sparsification is applied to your model, with higher values resulting in faster and more compressed models.
At the max range, though, you may see a drop in accuracy.
The optim level can be set anywhere from 0.0 to 1.0, where 0.0 is for no sparsification and 1.0 is for maximum sparsification.
0.5 is the default optim level and is a good starting point for most use cases.

## Optim Level Values

The general rule is that 0.0 is the baseline model, <0.3 only quantizes the model, and 0.3-1.0 increases the sparsity (unstructured/structured pruning) of the model and applies quantization.
The exact mappings of optim levels depends on the experiment type.
The exact mappings of optim levels depend on the experiment type.
The current mappings for each experiment type are listed below.
Note, these mappings are subject to change in future releases as we continue to improve Sparsify with new algorithms and capabilities.

### One-Shot Optim Levels

Given that one shot is applied in post-training, the sparsity ranges are lowered to avoid accuracy drops as compared with sparse transfer or training aware.
Given that One-Shot is applied in post-training, the sparsity ranges are lowered to avoid accuracy drops as compared with Sparse-Transfer or Training-Aware.
The specific ranges are the following:

- optim-level == 0.0: no sparsification is applied and the input model is returned as a baseline test case.
Expand All @@ -41,23 +41,23 @@ The specific ranges are the following:

The default of 0.5 will result in a ~50% sparse model with INT8 quantization.

### Sparse Transfer Optim Levels
### Sparse-Transfer Optim Levels

Sparse transfer mappings are a bit different from one shot and training aware since it maps to models available in the SparseZoo to transfer from.
Sparse-Transfer mappings are a bit different from One-Shot and Training-Aware since it maps to models available in the SparseZoo to transfer from.
Increasing the optim level will result in smaller and more compressed models.
The specific mappings are the following:

- optim-level == 0.0: the largest model selected from the SparseZoo with no optimizations.
- optim-level < 0.25: the largest model selected from the SparseZoo with INT8 quantization applied to the model (activations and weights).
- optim-level < 0.5: the largest model selected form the SparseZoo with both unstructured pruning (sparsity) and INT8 quantization applied to the model.
- optim-level < 0.5: the largest model selected from the SparseZoo with both unstructured pruning (sparsity) and INT8 quantization applied to the model.
- optim-level < 0.75: the medium model selected from the SparseZoo with both unstructured pruning (sparsity) and INT8 quantization applied to the model.
- optim-level <= 1.0: the smallest model selected from the SparseZoo with both unstructured pruning (sparsity) and INT8 quantization applied to the model.

The default of 0.5 will result in a medium-sized sparse model with INT8 quantization.

### Training-Aware Optim Levels

Given that training aware is applied while training, the sparsity ranges are increased as compared to one shot since accuracy recovery is easier at higher sparsities.
Given that Training-Aware is applied while training, the sparsity ranges are increased as compared to One-Shot since accuracy recovery is easier at higher sparsities.
The specific ranges are the following:

- optim-level == 0.0: no sparsification is applied and the input model is returned as a baseline test case.
Expand Down

0 comments on commit c3d3995

Please sign in to comment.