You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.rst
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,10 @@ Model Optimizer Changelog (Linux)
8
8
9
9
- Fix a bug in FastNAS pruning (computer vision models) where the model parameters were sorted twice messing up the ordering.
10
10
11
+
**New Features**
12
+
13
+
- Add MoE (e.g. Qwen3-30B-A3B) pruning support for ``num_moe_experts``, ``moe_ffn_hidden_size`` and ``moe_shared_expert_intermediate_size`` parameters in Minitron pruning (``mcore_minitron``).
Checkout pruning [getting started section](../pruning/README.md#getting-started) and [guidelines](../pruning/README.md#pruning-guidelines) for configuring pruning parameters in the pruning README.
114
114
115
-
Pruning is supported for GPT and Mamba models in Pipeline Parallel mode. Available pruning options are:
115
+
Pruning is supported for GPT and Mamba models in Pipeline Parallel mode. Available pruning dimensions are:
116
116
117
117
-`TARGET_FFN_HIDDEN_SIZE`
118
118
-`TARGET_HIDDEN_SIZE`
119
119
-`TARGET_NUM_ATTENTION_HEADS`
120
120
-`TARGET_NUM_QUERY_GROUPS`
121
121
-`TARGET_MAMBA_NUM_HEADS`
122
122
-`TARGET_MAMBA_HEAD_DIM`
123
+
-`TARGET_NUM_MOE_EXPERTS`
124
+
-`TARGET_MOE_FFN_HIDDEN_SIZE`
125
+
-`TARGET_MOE_SHARED_EXPERT_INTERMEDIATE_SIZE`
123
126
-`TARGET_NUM_LAYERS`
124
127
-`LAYERS_TO_DROP` (comma separated, 1-indexed list of layer numbers to directly drop)
Copy file name to clipboardExpand all lines: examples/pruning/README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ Pruning can involve removal (prune) of Linear and Conv layers, and Transformer a
6
6
7
7
This section focuses on applying Model Optimizer's state-of-the-art complementary pruning modes to enable you to search for the best subnet architecture from your provided base model:
8
8
9
-
1.[Minitron](https://arxiv.org/pdf/2408.11796): A pruning method developed by NVIDIA Research for pruning GPT, Mamba and Hybrid Transformer Mamba models in NVIDIA NeMo or Megatron-LM framework. It uses the activation magnitudes to prune the embedding hidden size, mlp ffn hidden size, transformer attention heads, GQA query groups, mamba heads and head dimension, and number of layers of the model.
9
+
1.[Minitron](https://arxiv.org/pdf/2408.11796): A pruning method developed by NVIDIA Research for pruning GPT, Mamba and Hybrid Transformer Mamba models in NVIDIA NeMo or Megatron-LM framework. It uses the activation magnitudes to prune the embedding hidden size; mlp ffn hidden size; transformer attention heads and GQA query groups; mamba heads and head dimension; MoE number of experts, ffn hidden size, and shared expert intermediate size; and number of layers of the model.
10
10
1. FastNAS: A pruning method recommended for Computer Vision models. Given a pretrained model, FastNAS finds the subnet which maximizes the score function while meeting the given constraints.
11
11
1. GradNAS: A light-weight pruning method recommended for language models like Hugging Face BERT, GPT-J. It uses the gradient information to prune the model's linear layers and attention heads to meet the given constraints.
12
12
@@ -89,11 +89,11 @@ If your model parameters are already sorted, you can skip the sorting step by se
> *<sup>1.</sup>Only Pipeline Parallel models are supported. Hugging Face models can be converted to NeMo format and used subsequently.*
96
+
> *<sup>1.</sup>Only Pipeline Parallel models are supported. Hugging Face models can be converted to Megatron-LM/NeMo format and used subsequently.*
97
97
98
98
## Pruning Guidelines
99
99
@@ -122,7 +122,7 @@ Depth pruning reduces the number of layers (`num_layers`) in the model.
122
122
123
123
#### Width Pruning
124
124
125
-
Width pruning reduces model dimensions per layer such as `hidden_size`, `ffn_hidden_size`, `num_attention_heads`, `num_query_groups`, `mamba_num_heads`, and `mamba_head_dim`.
125
+
Width pruning reduces model dimensions per layer such as `hidden_size`, `ffn_hidden_size`, `num_attention_heads`, `num_query_groups`, `mamba_num_heads`, `mamba_head_dim`, `num_moe_experts`, `moe_ffn_hidden_size`, and `moe_shared_expert_intermediate_size`.
0 commit comments