Skip to main content

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

moduleprofiler-0.0.3.tar.gz (443.7 kB view details)

Uploaded Source

Built Distribution

moduleprofiler-0.0.3-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

Details for the file moduleprofiler-0.0.3.tar.gz.

File metadata

  • Download URL: moduleprofiler-0.0.3.tar.gz
  • Upload date:
  • Size: 443.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for moduleprofiler-0.0.3.tar.gz
Algorithm Hash digest
SHA256 6d0881fd57d4b9f2adf580a8893a62d3cb8738083776c456a542c5115cc0bb99
MD5 49b1b96825e3236885924538eeb289b5
BLAKE2b-256 7b98750d235008d8a3cdf0dcf2340eba2b4ce426a889884f7836df36c6981629

See more details on using hashes here.

File details

Details for the file moduleprofiler-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for moduleprofiler-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 36eab8ca3ed29ad17d0ef30e68f72842490c357f0b6b151004ee086f491fae5e
MD5 bc75edbce05004d84e7f5fdb607b9cdb
BLAKE2b-256 35250fe1bd1d287bc517b790f71d992c684b09b8b13809bf103ebb2740c77a38

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page