Skip to main content

Advanced lightweight model profiler for deep learning frameworks

Project description

Memoraith

Memoraith is a cutting-edge, lightweight model profiler for deep learning frameworks, developed by Mehdi El Jouhfi. It's designed to revolutionize the optimization of neural network models by providing unparalleled insights into their performance characteristics.

Features

  • Advanced support for PyTorch and TensorFlow models
  • High-precision profiling of memory usage (CPU and GPU)
  • Microsecond-accurate computation time measurement for each layer
  • Sophisticated bottleneck and anomaly detection algorithms
  • Generation of comprehensive, interactive reports with advanced visualizations
  • Real-time visualization capabilities with minimal overhead
  • Flexible programmatic and command-line interfaces

Installation

Install Memoraith using pip:

pip install memoraith

For GPU support and additional features:

pip install memoraith[full]

Quick Start

Here's an example of Memoraith in action 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 AdvancedNet(nn.Module):
    def __init__(self):
        super(AdvancedNet, self).__init__()
        self.conv1 = nn.Conv2d(3, 64, kernel_size=3, padding=1)
        self.conv2 = nn.Conv2d(64, 128, kernel_size=3, padding=1)
        self.fc = nn.Linear(128 * 8 * 8, 10)

    def forward(self, x):
        x = torch.relu(self.conv1(x))
        x = torch.relu(self.conv2(x))
        x = x.view(x.size(0), -1)
        return self.fc(x)

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

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

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

Documentation

For detailed information on Memoraith's advanced features, please refer to our comprehensive documentation.

Contributing

Contributions are welcome! Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.

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 = {El Jouhfi, Mehdi},
  title = {Memoraith: Advanced Lightweight Model Profiler for Deep Learning},
  year = {2024},
  url = {https://github.com/mehdi342/Memoraith}
}

Contact

For inquiries, please contact Mehdi El Jouhfi at midojouhfi@gmail.com.

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.2.0.tar.gz (33.8 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.2.0-py3-none-any.whl (44.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for memoraith-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fe845e24ec2325ef0f1e1f65f319bdfdd2a807d9c4b775119a83994ee6a8545e
MD5 0b2720e04465e1f9e545e753b1cec98e
BLAKE2b-256 6a7163d4b8e8b401adf0c4ca2ebf9c923e7b50a7100cf21803e0a92662d27fc2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: memoraith-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 44.0 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a5d8e38614b675d89ce0a8e9efa9f736cb71983afaab81a6789b8565bca0e5be
MD5 ea05ccc2e0e8a4bbe10e05c19c8f0385
BLAKE2b-256 f579e523cbefee042f02f39f134d7e2387c1c56904bfa76db12b1906f33457eb

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