aten::expand is not Supported! Please report. #4323
Description
Describe the issue:
As the title of this issue, this error occured when I pruned the GAST-Net (https://github.com/fabro66/GAST-Net-3DPoseEstimation) with NNI L2FilterPruner. It seems that the operation of aten::expand is still not supported. So the mask of this layer is an empty list, which is not allowed by torch.cat().
If possible, please fix this issue as soon. Thanks!
Here is part of the layers of the model.
+-------+----------------------------------------------------------------------+--------+--------------------+-----------+---------+
| Index | Name | Type | Weight Shape | FLOPs | #Params |
+-------+----------------------------------------------------------------------+--------+--------------------+-----------+---------+
| 0 | expand_conv | Conv2d | (64, 3, 3, 1) | 955584 | 576 |
| 1 | layers_graph_conv.0.local_graph_layer.cat_conv | Conv2d | (64, 128, 1, 1) | 13590528 | 8192 |
| 2 | layers_graph_conv.0.global_graph_layer.attentions.0.g | Conv1d | (16, 64, 1) | 21504 | 1040 |
| 3 | layers_graph_conv.0.global_graph_layer.attentions.0.theta | Conv1d | (16, 64, 1) | 21504 | 1040 |
| 4 | layers_graph_conv.0.global_graph_layer.attentions.0.phi | Conv1d | (16, 64, 1) | 21504 | 1040 |
| 5 | layers_graph_conv.0.global_graph_layer.attentions.0.concat_project.0 | Conv2d | (1, 32, 1, 1) | 14112 | 32 |
| 6 | layers_graph_conv.0.global_graph_layer.attentions.1.g | Conv1d | (16, 64, 1) | 21504 | 1040 |
| 7 | layers_graph_conv.0.global_graph_layer.attentions.1.theta | Conv1d | (16, 64, 1) | 21504 | 1040 |
| 8 | layers_graph_conv.0.global_graph_layer.attentions.1.phi | Conv1d | (16, 64, 1) | 21504 | 1040 |
| 9 | layers_graph_conv.0.global_graph_layer.attentions.1.concat_project.0 | Conv2d | (1, 32, 1, 1) | 14112 | 32 |
| 10 | layers_graph_conv.0.global_graph_layer.attentions.2.g | Conv1d | (16, 64, 1) | 21504 | 1040 |
| 11 | layers_graph_conv.0.global_graph_layer.attentions.2.theta | Conv1d | (16, 64, 1) | 21504 | 1040 |
| 12 | layers_graph_conv.0.global_graph_layer.attentions.2.phi | Conv1d | (16, 64, 1) | 21504 | 1040 |
| 13 | layers_graph_conv.0.global_graph_layer.attentions.2.concat_project.0 | Conv2d | (1, 32, 1, 1) | 14112 | 32 |
| 14 | layers_graph_conv.0.global_graph_layer.attentions.3.g | Conv1d | (16, 64, 1) | 21504 | 1040 |
| 15 | layers_graph_conv.0.global_graph_layer.attentions.3.theta | Conv1d | (16, 64, 1) | 21504 | 1040 |
| 16 | layers_graph_conv.0.global_graph_layer.attentions.3.phi | Conv1d | (16, 64, 1) | 21504 | 1040 |
| 17 | layers_graph_conv.0.global_graph_layer.attentions.3.concat_project.0 | Conv2d | (1, 32, 1, 1) | 14112 | 32 |
| 18 | layers_graph_conv.0.global_graph_layer.cat_conv | Conv2d | (64, 64, 1, 1) | 6795264 | 4096 |
| 19 | layers_graph_conv.0.cat_conv | Conv2d | (128, 192, 1, 1) | 40771584 | 24576 |
| 20 | layers_conv.0 | Conv2d | (128, 128, 3, 1) | 75350016 | 49152 |
| 21 | layers_conv.1 | Conv2d | (128, 128, 1, 1) | 25116672 | 16384 |
......
Environment:
- NNI version: 2.5
- Training service (local|remote|pai|aml|etc):
- Client OS: Ubuntu 18
- Server OS (for remote mode only):
- Python version: 3.7
- PyTorch/TensorFlow version: Pytorch 1.7.1
- Is conda/virtualenv/venv used?: Yes
- Is running in Docker?: No
Configuration:
- Experiment config (remember to remove secrets!): default config of NNI pruner
- Search space:
Log message:
- nnimanager.log:
[2021-11-21 16:07:29] INFO (nni.compression.pytorch.speedup.compressor/MainThread) Update mask for layers_graph_conv.0.global_graph_layer.attentions.0.aten::permute.238
[2021-11-21 16:07:29] INFO (nni.compression.pytorch.speedup.compressor/MainThread) Update mask for layers_graph_conv.0.global_graph_layer.attentions.0.aten::size.241
[2021-11-21 16:07:29] INFO (nni.compression.pytorch.speedup.compressor/MainThread) Update mask for layers_graph_conv.0.global_graph_layer.attentions.0.aten::size.242
[2021-11-21 16:07:29] INFO (nni.compression.pytorch.speedup.compressor/MainThread) Update mask for layers_graph_conv.0.global_graph_layer.attentions.1.aten::permute.258
[2021-11-21 16:07:29] INFO (nni.compression.pytorch.speedup.compressor/MainThread) Update mask for layers_graph_conv.0.global_graph_layer.attentions.1.aten::size.261
[2021-11-21 16:07:29] INFO (nni.compression.pytorch.speedup.compressor/MainThread) Update mask for layers_graph_conv.0.global_graph_layer.attentions.1.aten::size.262
[2021-11-21 16:07:29] INFO (nni.compression.pytorch.speedup.compressor/MainThread) Update mask for layers_graph_conv.0.global_graph_layer.attentions.2.aten::permute.278
[2021-11-21 16:07:29] INFO (nni.compression.pytorch.speedup.compressor/MainThread) Update mask for layers_graph_conv.0.global_graph_layer.attentions.2.aten::size.281
[2021-11-21 16:07:29] INFO (nni.compression.pytorch.speedup.compressor/MainThread) Update mask for layers_graph_conv.0.global_graph_layer.attentions.2.aten::size.282
[2021-11-21 16:07:29] INFO (nni.compression.pytorch.speedup.compressor/MainThread) Update mask for layers_graph_conv.0.global_graph_layer.attentions.3.aten::permute.298
[2021-11-21 16:07:29] INFO (nni.compression.pytorch.speedup.compressor/MainThread) Update mask for layers_graph_conv.0.global_graph_layer.attentions.3.aten::size.301
[2021-11-21 16:07:29] INFO (nni.compression.pytorch.speedup.compressor/MainThread) Update mask for layers_graph_conv.0.global_graph_layer.attentions.3.aten::size.302
[2021-11-21 16:07:29] INFO (nni.compression.pytorch.speedup.compressor/MainThread) Update mask for layers_graph_conv.0.global_graph_layer.attentions.0.aten::expand.244
[2021-11-21 16:07:29] ERROR (nni.compression.pytorch.speedup.jit_translate/MainThread) aten::expand is not Supported! Please report an issue at https://github.com/microsoft/nni. Thanks~
[2021-11-21 16:07:29] INFO (nni.compression.pytorch.speedup.compressor/MainThread) Update mask for layers_graph_conv.0.global_graph_layer.attentions.0.aten::expand.243
[2021-11-21 16:07:29] ERROR (nni.compression.pytorch.speedup.jit_translate/MainThread) aten::expand is not Supported! Please report an issue at https://github.com/microsoft/nni. Thanks~
[2021-11-21 16:07:29] INFO (nni.compression.pytorch.speedup.compressor/MainThread) Update mask for layers_graph_conv.0.global_graph_layer.attentions.1.aten::expand.264
[2021-11-21 16:07:29] ERROR (nni.compression.pytorch.speedup.jit_translate/MainThread) aten::expand is not Supported! Please report an issue at https://github.com/microsoft/nni. Thanks~
[2021-11-21 16:07:29] INFO (nni.compression.pytorch.speedup.compressor/MainThread) Update mask for layers_graph_conv.0.global_graph_layer.attentions.1.aten::expand.263
[2021-11-21 16:07:29] ERROR (nni.compression.pytorch.speedup.jit_translate/MainThread) aten::expand is not Supported! Please report an issue at https://github.com/microsoft/nni. Thanks~
[2021-11-21 16:07:29] INFO (nni.compression.pytorch.speedup.compressor/MainThread) Update mask for layers_graph_conv.0.global_graph_layer.attentions.2.aten::expand.284
[2021-11-21 16:07:29] ERROR (nni.compression.pytorch.speedup.jit_translate/MainThread) aten::expand is not Supported! Please report an issue at https://github.com/microsoft/nni. Thanks~
[2021-11-21 16:07:29] INFO (nni.compression.pytorch.speedup.compressor/MainThread) Update mask for layers_graph_conv.0.global_graph_layer.attentions.2.aten::expand.283
[2021-11-21 16:07:29] ERROR (nni.compression.pytorch.speedup.jit_translate/MainThread) aten::expand is not Supported! Please report an issue at https://github.com/microsoft/nni. Thanks~
[2021-11-21 16:07:29] INFO (nni.compression.pytorch.speedup.compressor/MainThread) Update mask for layers_graph_conv.0.global_graph_layer.attentions.3.aten::expand.304
[2021-11-21 16:07:29] ERROR (nni.compression.pytorch.speedup.jit_translate/MainThread) aten::expand is not Supported! Please report an issue at https://github.com/microsoft/nni. Thanks~
[2021-11-21 16:07:29] INFO (nni.compression.pytorch.speedup.compressor/MainThread) Update mask for layers_graph_conv.0.global_graph_layer.attentions.3.aten::expand.303
[2021-11-21 16:07:29] ERROR (nni.compression.pytorch.speedup.jit_translate/MainThread) aten::expand is not Supported! Please report an issue at https://github.com/microsoft/nni. Thanks~
[2021-11-21 16:07:29] INFO (nni.compression.pytorch.speedup.compressor/MainThread) Update mask for layers_graph_conv.0.global_graph_layer.attentions.0.aten::cat.245 - dispatcher.log:
- nnictl stdout and stderr:
How to reproduce it?:
-
Download GAST-Net (https://github.com/fabro66/GAST-Net-3DPoseEstimation).
-
Use this function to create a GAST-Net model.
def load_gastnet():
from main import *
from common.skeleton import Skeleton
from common.graph_utils import adj_mx_from_skeletonntu_skeleton = Skeleton(parents=[-1, 0, 20, 2, 20, 4, 5, 6, 20, 8, 9, 10, 0, 12, 13, 14, 0, 16, 17, 18, 1],
joints_left=[4, 5, 6, 7, 12, 13, 14, 15],
joints_right=[8, 9, 10, 11, 16, 17, 18, 19])adj = adj_mx_from_skeleton(ntu_skeleton)
dp = 0.05
filters_width = [3, 3, 3, 3]
channels = 64
model_pos = SpatioTemporalModel(adj, num_joints_in=21, in_features=3, num_joints_out=21,
filter_widths=filters_width, causal=False,
channels=channels, dropout=dp)
return model_pos -
input_size = [1, 81, 21, 3]
-
Use L2FilterPruner to prune the model and speed it up.