Hello,
My question is pretty straight-forward. Let’s say I got a pruned ResNet-101 using torch.nn.utils.prune
module. How can I sparsify the network to boost inference speed and reduce the memory footprint ?
The ResNet is from Detectron2 library.
Thank’s in advance for your advice
1 Like
Michela
(Michela Paganini)
July 14, 2020, 5:02pm
2
Hi @cyril9227 , please see my answer to a similar question and links therein:
The point of PyTorch pruning, at the moment, is not necessarily to guarantee inference time speedups or memory savings. It’s more of an experimental feature to enable pruning research.
In any case, answers to questions similar to yours were given here and here .
TL;DR: You can save space by calling .to_sparse() which brings your sparse tensor into coordinate representation. You cannot expect any inference speedups unless you use a custom sparse matrix algebra library to power your computation. t…