Skip to main content

A lightweight model profiler for deep learning frameworks

Project description

Memoraith

Memoraith is a lightweight model profiler for deep learning frameworks, designed to help you optimize your neural network models by providing detailed insights into their performance characteristics.

Features

  • Supports PyTorch and TensorFlow models
  • Profiles memory usage (CPU and GPU)
  • Measures computation time for each layer
  • Detects bottlenecks and anomalies
  • Generates comprehensive reports with visualizations
  • Provides real-time visualization capabilities
  • Offers both programmatic and command-line interfaces

Installation

You can install Memoraith using pip:

pip install memoraith

For GPU support, install with:

pip install memoraith[gpu]

Quick Start

Here's a simple example of how to use Memoraith with a PyTorch model:

from memoraith import profile_model, set_output_path
import torch
import torch.nn as nn

set_output_path('profiling_results/')

class SimpleNet(nn.Module):
    def __init__(self):
        super(SimpleNet, self).__init__()
        self.fc = nn.Linear(10, 5)

    def forward(self, x):
        return self.fc(x)

@profile_model(memory=True, computation=True, gpu=True)
def train_model(model):
    optimizer = torch.optim.Adam(model.parameters())
    for _ in range(100):
        input_data = torch.randn(32, 10)
        output = model(input_data)
        loss = output.sum()
        loss.backward()
        optimizer.step()

if __name__ == "__main__":
    model = SimpleNet()
    train_model(model)

This will generate a profiling report in the 'profiling_results/' directory.

Documentation

For more detailed information on how to use Memoraith, please refer to our documentation.

Contributing

We welcome contributions! Please see our Contributing Guide for more details.

License

Memoraith is released under the MIT License. See the LICENSE file for more details.

Support

If you encounter any issues or have questions, please file an issue on the GitHub issue tracker.

Citing Memoraith

If you use Memoraith in your research, please cite it as follows:

@software{memoraith,
  author = {Your Name},
  title = {Memoraith: A Lightweight Model Profiler for Deep Learning},
  year = {2023},
  url = {https://github.com/yourusername/memoraith}
}

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

memoraith-0.1.0.tar.gz (32.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

memoraith-0.1.0-py3-none-any.whl (44.4 kB view details)

Uploaded Python 3

File details

Details for the file memoraith-0.1.0.tar.gz.

File metadata

  • Download URL: memoraith-0.1.0.tar.gz
  • Upload date:
  • Size: 32.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for memoraith-0.1.0.tar.gz
Algorithm Hash digest
SHA256 12903c9707d2a1730d2f17414388477ad04c6230868e715956965a4e90b11ef8
MD5 b46dae439688e819c4046ad6f4674fdd
BLAKE2b-256 76fe33704448e9f4a708c7890f81068500bc8c0c5a427b45ac534cbc1587f229

See more details on using hashes here.

File details

Details for the file memoraith-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: memoraith-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 44.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for memoraith-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ac9666dba3c8dc4a47e2c4c735a61b450e2b94808dd9269abe64a96002bfb5ac
MD5 4f7f99f0d41e9e6c4bbe510723bd5bbe
BLAKE2b-256 13df78ca48cf18ac6cd21ecb2344ec99083a9acde400ff82a88b17af9c3fad8c

See more details on using hashes here.

Supported by

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