zhijian-liu / torchprofile

A general and accurate MACs / FLOPs profiler for PyTorch models
https://pypi.org/project/torchprofile/
MIT License
560 stars 38 forks source link

No handlers found: "torchvision::roi_align". Skipped #21

Open padeirocarlos opened 1 year ago

padeirocarlos commented 1 year ago

Thank you for your great work! I encountered this warning when using torchprofile. It seems like torchprofile cannot calculate the MACs of

UserWarning: No handlers found: "torchvision::roi_align". Skipped UserWarning: No handlers found: "aten::sqrt". Skipped UserWarning: No handlers found: "aten::log2". Skipped UserWarning: No handlers found: "aten::reciprocal". Skipped. UserWarning: No handlers found: "aten::scalarimplicit". Skipped. UserWarning: No handlers found: "aten::max". Skipped.

By the way, apart from the MACs, Is there any way to calculate the model memory use?

zhijian-liu commented 1 year ago

Thanks for reporting this issue. Most of these operators have no MACs or very few MACs, so the MACs should be roughly correct. I will work on supporting these operators.

pvti commented 1 year ago

Hi, I met a similar warning when profiling my customized model wich contains of custom layers with some operators like permute, reshape and einsum. Here's the log:

[/home/tien/anaconda3/lib/python3.9/site-packages/torchprofile/profile.py:22](https://file+.vscode-resource.vscode-cdn.net/home/tien/anaconda3/lib/python3.9/site-packages/torchprofile/profile.py:22): UserWarning: No handlers found: "aten::copy_". Skipped.
  warnings.warn('No handlers found: "{}". Skipped.'.format(
[/home/tien/anaconda3/lib/python3.9/site-packages/torchprofile/profile.py:22](https://file+.vscode-resource.vscode-cdn.net/home/tien/anaconda3/lib/python3.9/site-packages/torchprofile/profile.py:22): UserWarning: No handlers found: "aten::permute". Skipped.
  warnings.warn('No handlers found: "{}". Skipped.'.format(
[/home/tien/anaconda3/lib/python3.9/site-packages/torchprofile/profile.py:22](https://file+.vscode-resource.vscode-cdn.net/home/tien/anaconda3/lib/python3.9/site-packages/torchprofile/profile.py:22): UserWarning: No handlers found: "aten::reshape". Skipped.
  warnings.warn('No handlers found: "{}". Skipped.'.format(
[/home/tien/anaconda3/lib/python3.9/site-packages/torchprofile/profile.py:22](https://file+.vscode-resource.vscode-cdn.net/home/tien/anaconda3/lib/python3.9/site-packages/torchprofile/profile.py:22): UserWarning: No handlers found: "aten::einsum". Skipped.
  warnings.warn('No handlers found: "{}". Skipped.'.format(

I guess it doesn't affect the final result. Just mentioning. Thanks!