Module profiler
Project description
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)
[Online documentation | Tutorial ]
Installation
moduleprofiler
can be installed as any regular python
module within your environment.
Install from PyPI:
python -m pip install moduleprofiler
Install from this repository:
python -m pip install git+https://github.com/eagomez2/moduleprofiler.git
Documentation
You can access the online documentation. 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:
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 Esteban Gómez, member of the Speech Interaction Technology group from Aalto University.
License
For further details about the license of this package, please see LICENSE.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file moduleprofiler-0.0.4.tar.gz
.
File metadata
- Download URL: moduleprofiler-0.0.4.tar.gz
- Upload date:
- Size: 444.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8aab7f376860647b2d7308f635b4bdb68ee712b1f4e551add2ec5ce316ce9372 |
|
MD5 | 1ad7261a0d0c29098b2c6f30efcd216e |
|
BLAKE2b-256 | 65d4f9510380b9dae66319ed7c2ac35cf503ec4ae792a79cf3bebf4d685751c7 |
File details
Details for the file moduleprofiler-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: moduleprofiler-0.0.4-py3-none-any.whl
- Upload date:
- Size: 21.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5522167d3b5ff4abc56fee91a146a42c9dab66956b4509bc2368f3fe239bcf30 |
|
MD5 | 93b9b724aa5614a4a912832ddae65f73 |
|
BLAKE2b-256 | 68e81eb14becedd6b6531ba1e330e7264a92b8148ba38f9e17ca90a20458c76f |