Metadata-Version: 2.1
Name: moduleprofiler
Version: 0.0.3
Summary: Module profiler
Keywords: pytorch,machine-learning,neural-network,profiling,complexity-analysis
Author-email: Esteban Gómez <esteban.gomezmellado@aalto.fi>
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: torch >= 2.3.0
Requires-Dist: pandas >= 2.0.0
Requires-Dist: psutil >= 6.0.0
Requires-Dist: tqdm >= 4.66.5
Requires-Dist: mkdocs>=1.6.0 ; extra == "docs"
Requires-Dist: mkdocstrings-python>=1.10.8 ; extra == "docs"
Requires-Dist: mkdocs-material>=9.5.31 ; extra == "docs"
Requires-Dist: ruff>=0.1.9 ; extra == "lint"
Requires-Dist: pytest>=7.4.3 ; extra == "test"
Project-URL: Bug Tracker, https://github.com/eagomez2/moduleprofiler/issues
Project-URL: Changelog, https://github.com/eagomez2/moduleprofiler/releases
Project-URL: Documentation, https://eagomez2.github.io/moduleprofiler/
Project-URL: Home, https://github.com/eagomez2/moduleprofiler
Project-URL: Repository, https://github.com/eagomez2/moduleprofiler
Provides-Extra: docs
Provides-Extra: lint
Provides-Extra: test

# 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).
