Comments (6)
@mkaglins @vanyalzr
from nncf.
@vshampor @mkaglins @vanyalzr
I am testing NNCF tool for our development. Any suggestions would be greatly appreciated :)
from nncf.
@nsk-lab indeed, nn.ConvTranspose2d pruning is not supported. However, the models that simply contain nn.ConvTranspose2d and don't prune it should still be prunable with respect to the supported prunable ops (which are convolutions, at the moment), so this seems to be a bug.
Please try #171 and see if it fixes your issue.
from nncf.
Hi @nsk-lab, does your model have a significant amount of ConvTranspose2D layers?
If that's the case and you wish to prune them along with standard Conv2d layers, we could plan to add ConvTranspose2D to the scope of prunable ops in filter pruning.
from nncf.
@nsk-lab did applying #171 resolve your problem?
from nncf.
@vshampor @vanyalzr
Yes. I could export onnx without error. thx.
But the final pruning rate was low.
my setting:
"params": {
"schedule": "baseline", // The type of scheduling to use for adjusting the target pruning level. Either `exponential`, `exponential_with_bias`, or `baseline`, by default it is `baseline`"
"pruning_init": 0.1, // Initial value of the pruning level applied to the model. 0.0 by default.
"pruning_target": 0.4, // Target value of the pruning level for the model. 0.5 by default.
"num_init_steps": 1, // Number of epochs for model pretraining before starting filter pruning. 0 by default.
"pruning_steps": 4, // Number of epochs during which the pruning rate is increased from `pruning_init` to `pruning_target` value.
"weight_importance": "L2", // The type of filter importance metric. Can be one of `L1`, `L2`, `geometric_median`. `L2` by default.
"all_weights": false, // Whether to prune layers independently (choose filters with the smallest importance in each layer separately) or not. `False` by default.
"prune_first_conv": false, // Whether to prune first Convolutional layers or not. First means that it is a convolutional layer such that there is a path from model input to this layer such that there are no other convolution operations on it. `False` by default.
"prune_last_conv": false, // Whether to prune last Convolutional layers or not. Last means that it is a Convolutional layer such that there is a path from this layer to the model output such that there are no other convolution operations on it. `False` by default.
"prune_downsample_convs": false, // Whether to prune downsample Convolutional layers (with stride > 1) or not. `False` by default.
"prune_batch_norms": false, // Whether to nullifies parameters of Batch Norm layer corresponds to zeroed filters of convolution corresponding to this Batch Norm. `False` by default.
"zero_grad": true // Whether to setting gradients corresponding to zeroed filters to zero during training, `True` by default.
},```
and the log at 5 epoch is
.
. (ommited)
.
+--------+--------+--------+--------+--------+--------+--------+-------+-------+
| XXXXXX | [64, | [40, | [64] | [40] | 147520 | 92200 | 0.375 | 0.375 |
| XXXX/Y | 256, | 256, | | | | | | |
| YYYYYY | 3, 3] | 3, 3] | | | | | | |
| YYY[ZZ | | | | | | | | |
| Z]/NNC | | | | | | | | |
| FConv2 | | | | | | | | |
| d[0] | | | | | | | | |
+--------+--------+--------+--------+--------+--------+--------+-------+-------+
| XXXXXX | [64, | [40, | [64] | [40] | 147520 | 92200 | 0.375 | 0.375 |
| XXXX/Y | 256, | 256, | | | | | | |
| YYYYYY | 3, 3] | 3, 3] | | | | | | |
| YYY[ZZ | | | | | | | | |
| ]/NNCF | | | | | | | | |
| Conv2d | | | | | | | | |
| [0] | | | | | | | | |
+--------+--------+--------+--------+--------+--------+--------+-------+-------+
INFO:nncf:Final Model Pruning Rate = 0.165
INFO:nncf:Total MAC pruning level = 0.124
0.165 is much lower than pruning target 0.4
Is it due to uncompressed ConvTranspose2D layer?
if so, i really want the support of pruning ConvTranspose2D
from nncf.
Related Issues (20)
- Compressed models that call torch.is_floating_point() during inference are traced with runtime error.
- nncf + ultralytics yolov8 training-time compression HOT 7
- Ultralytics yolov8 QAT example HOT 1
- [Good First Issue] [NNCF] Make NNCF common utils code pass mypy checks HOT 23
- [Good First Issue] [NNCF] Make NNCF common accuracy aware training code pass mypy checks HOT 17
- [Good First Issue] [NNCF] Make NNCF common tensor statistics code pass mypy checks HOT 9
- [Good First Issue] [NNCF] Make NNCF common pruning code pass mypy checks HOT 14
- [Good First Issue] [NNCF] Make NNCF common graph code pass mypy checks HOT 26
- [Good First Issue] [NNCF] Make NNCF common sparsity code pass mypy checks HOT 6
- Thanks to our Contributors HOT 1
- [Good First Issue][NNCF]: Add INT8 weight compression conformance test for Tinyllama-1.1b PyTorch model HOT 19
- [Good First Issue][NNCF]: Fixing NNCFGraph export for visualization in Netron HOT 6
- Why doesn't the size and precision of the model change after INT4 quantization? HOT 2
- [Good First Issue][NNCF]: Optimize memory footprint by removing redundant collected statistics HOT 8
- [Good First Issue][NNCF]: Dump actual_subset_size to ov.Model HOT 8
- [Good First Issue][NNCF]: dump the ignored scope more gracefully HOT 4
- [Good First Issue][NNCF]: check number of u8, u4 constants in weight compression tests HOT 10
- PTQ of Fast R-CNN crashes in PyTorch backend HOT 1
- [Good First Issue][NNCF]: fix invalid error reporting in JSON schema HOT 19
- [Good First Issue][NNCF]: Add tests for torch device utils HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nncf.