# ModuleProfiler
Free open-source package to profile `torch.nn.Module` modules and obtain useful information to design a model that fits your needs and constraints at development time.
With `moduleprofiler` you can:
- Calculate the number of parameters of your model.
- Trace the input and output sizes of each component of your model.
- Estimate the number of operations your model performs in a forward pass.
- Calculate per module and total inference time.
All results can be obtained in one of the following formats:
- `dict` (default output format)
- `pandas.DataFrame` (to perform further calculations or filtering in your code)
- `html` (to export as webpage)
- `LaTeX` (to include in your publications)
[<a href="https://eagomez2.github.io/moduleprofiler/" target="_blank">Online documentation</a> | <a href="https://eagomez2.github.io/moduleprofiler/tutorial/" target="_blank">Tutorial</a> ]
# Installation
`moduleprofiler` can be installed as any regular `python` module within your environment.
Install from PyPI:
```bash
python -m pip install moduleprofiler
```
Install from this repository:
```bash
python -m pip install git+https://github.com/eagomez2/moduleprofiler.git
```
# Documentation
You can access the <a href="https://eagomez2.github.io/moduleprofiler/" target="blank">online documentation</a>. There you will find a more in depth introduction to `moduleprofiler`, including tutorials, methods documentation and an extensive reference about the calculations utilized to estimate the operations of different supported `torch.nn.Module` modules.
You can also run the documentation locally by going to the root folder of the package and running:
```bash
mkdocs serve
```
Before running this, make sure that your python environment is enabled.
# Cite
If this package contributed to your work, please consider citing it:
```
@misc{moduleprofiler,
author = {Esteban Gómez},
title = {moduleprofiler},
year = 2024,
url = {https://github.com/eagomez2/moduleprofiler}
}
```
This package was developed by <a href="https://estebangomez.me/" target="_blank">Esteban Gómez</a>, member of the <a href="https://www.aalto.fi/en/department-of-information-and-communications-engineering/speech-interaction-technology" target="_blank">Speech Interaction Technology group from Aalto University</a>.
# License
For further details about the license of this package, please see [LICENSE](LICENSE).
Raw data
{
"_id": null,
"home_page": null,
"name": "moduleprofiler",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "pytorch, machine-learning, neural-network, profiling, complexity-analysis",
"author": null,
"author_email": "Esteban G\u00f3mez <esteban.gomezmellado@aalto.fi>",
"download_url": "https://files.pythonhosted.org/packages/65/d4/f9510380b9dae66319ed7c2ac35cf503ec4ae792a79cf3bebf4d685751c7/moduleprofiler-0.0.4.tar.gz",
"platform": null,
"description": "# ModuleProfiler\nFree open-source package to profile `torch.nn.Module` modules and obtain useful information to design a model that fits your needs and constraints at development time.\n\nWith `moduleprofiler` you can:\n- Calculate the number of parameters of your model.\n- Trace the input and output sizes of each component of your model.\n- Estimate the number of operations your model performs in a forward pass.\n- Calculate per module and total inference time.\n\nAll results can be obtained in one of the following formats:\n- `dict` (default output format)\n- `pandas.DataFrame` (to perform further calculations or filtering in your code)\n- `html` (to export as webpage)\n- `LaTeX` (to include in your publications)\n\n[<a href=\"https://eagomez2.github.io/moduleprofiler/\" target=\"_blank\">Online documentation</a> | <a href=\"https://eagomez2.github.io/moduleprofiler/tutorial/\" target=\"_blank\">Tutorial</a> ]\n\n# Installation\n`moduleprofiler` can be installed as any regular `python` module within your environment.\n\nInstall from PyPI:\n```bash\npython -m pip install moduleprofiler\n```\n\nInstall from this repository:\n```bash\npython -m pip install git+https://github.com/eagomez2/moduleprofiler.git\n```\n\n# Documentation\nYou can access the <a href=\"https://eagomez2.github.io/moduleprofiler/\" target=\"blank\">online documentation</a>. There you will find a more in depth introduction to `moduleprofiler`, including tutorials, methods documentation and an extensive reference about the calculations utilized to estimate the operations of different supported `torch.nn.Module` modules.\n\nYou can also run the documentation locally by going to the root folder of the package and running:\n\n```bash\nmkdocs serve\n```\n\nBefore running this, make sure that your python environment is enabled.\n\n# Cite\nIf this package contributed to your work, please consider citing it:\n\n```\n@misc{moduleprofiler,\n author = {Esteban G\u00f3mez},\n title = {moduleprofiler},\n year = 2024,\n url = {https://github.com/eagomez2/moduleprofiler}\n}\n```\n\nThis package was developed by <a href=\"https://estebangomez.me/\" target=\"_blank\">Esteban G\u00f3mez</a>, member of the <a href=\"https://www.aalto.fi/en/department-of-information-and-communications-engineering/speech-interaction-technology\" target=\"_blank\">Speech Interaction Technology group from Aalto University</a>.\n\n# License\nFor further details about the license of this package, please see [LICENSE](LICENSE).",
"bugtrack_url": null,
"license": null,
"summary": "Module profiler",
"version": "0.0.4",
"project_urls": {
"Bug Tracker": "https://github.com/eagomez2/moduleprofiler/issues",
"Changelog": "https://github.com/eagomez2/moduleprofiler/releases",
"Documentation": "https://eagomez2.github.io/moduleprofiler/",
"Home": "https://github.com/eagomez2/moduleprofiler",
"Repository": "https://github.com/eagomez2/moduleprofiler"
},
"split_keywords": [
"pytorch",
" machine-learning",
" neural-network",
" profiling",
" complexity-analysis"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "68e81eb14becedd6b6531ba1e330e7264a92b8148ba38f9e17ca90a20458c76f",
"md5": "93b9b724aa5614a4a912832ddae65f73",
"sha256": "5522167d3b5ff4abc56fee91a146a42c9dab66956b4509bc2368f3fe239bcf30"
},
"downloads": -1,
"filename": "moduleprofiler-0.0.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "93b9b724aa5614a4a912832ddae65f73",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 21409,
"upload_time": "2024-09-25T23:26:31",
"upload_time_iso_8601": "2024-09-25T23:26:31.770437Z",
"url": "https://files.pythonhosted.org/packages/68/e8/1eb14becedd6b6531ba1e330e7264a92b8148ba38f9e17ca90a20458c76f/moduleprofiler-0.0.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "65d4f9510380b9dae66319ed7c2ac35cf503ec4ae792a79cf3bebf4d685751c7",
"md5": "1ad7261a0d0c29098b2c6f30efcd216e",
"sha256": "8aab7f376860647b2d7308f635b4bdb68ee712b1f4e551add2ec5ce316ce9372"
},
"downloads": -1,
"filename": "moduleprofiler-0.0.4.tar.gz",
"has_sig": false,
"md5_digest": "1ad7261a0d0c29098b2c6f30efcd216e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 444034,
"upload_time": "2024-09-25T23:26:33",
"upload_time_iso_8601": "2024-09-25T23:26:33.710034Z",
"url": "https://files.pythonhosted.org/packages/65/d4/f9510380b9dae66319ed7c2ac35cf503ec4ae792a79cf3bebf4d685751c7/moduleprofiler-0.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-25 23:26:33",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "eagomez2",
"github_project": "moduleprofiler",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "moduleprofiler"
}