PyTorch Version - vai_p_pytorch - 3.5 English

Vitis AI User Guide (UG1414)

Document ID
UG1414
Release Date
2023-09-28
Version
3.5 English

The pruning tool on PyTorch is a Python package and not an executable program. vai_p_pytorch provides three methods of model pruning:

Iterative and one-step pruning is suitable for networks with conventional convolution layers but does not work very well on depthwise convolution-based networks such as MobileNet-v2. Convolutional neural networks (CNN) generally contain BatchNormalization layers and one-step pruning is preferred for these networks because it is faster and works better. If no BatchNormalization layers exist in the network, such as VGGNet, iterative pruning should be used.

OFA applies to both depthwise and conventional convolutions. It is important to know that OFA is theoretically the best of these three methods, though it is not easy to get good pruning results. The result depends on how well the supernetwork can be trained; long training time and strong training skills are required.

To summarize, if there are BatchNormalization layers in the network, use one-step pruning. Otherwise, use iterative pruning. If you are unsatisfied with the pruning results, OFA can be an alternative approach.