Skip to main content

OpenPerformance

A comprehensive ML Performance Engineering Platform for optimizing and monitoring machine learning workloads.

CI Release Docker PyPI Python

Features

  • Hardware Monitoring: Real-time CPU, memory, and GPU monitoring
  • Performance Analysis: AI-powered optimization recommendations
  • Distributed Training: Advanced distributed optimization algorithms
  • CLI Interface: Comprehensive command-line tools
  • REST API: Full-featured API with authentication
  • Cross-Platform: Works on macOS, Linux, and Windows
  • Production Ready: All tests passing (43/43)

Quick Start

Installation

# Install from PyPI
pip install openperformance

# Or install from source
git clone https://github.com/llamasearchai/OpenPerformance.git
cd OpenPerformance
pip install -e .

Basic Usage

# Check system information
mlperf info

# Run performance analysis
mlperf optimize --framework pytorch --batch-size 32

# Start API server
python -m uvicorn python.mlperf.api.main:app --host 0.0.0.0 --port 8000

CLI Commands

mlperf --help                    # Show all available commands
mlperf info                      # Display system hardware information
mlperf version                   # Show platform version
mlperf benchmark                 # Run performance benchmarks
mlperf profile                   # Profile Python scripts
mlperf optimize                  # Optimize ML workloads
mlperf gpt                       # AI-powered shell assistance
mlperf chat                      # Chat with ML performance AI agents

API Endpoints

  • GET /health - System health check
  • GET /system/metrics - Real-time system metrics
  • GET /system/hardware - Detailed hardware information
  • POST /analyze/performance - Performance analysis and optimization
  • GET /admin/system/status - Admin system status

Hardware Monitoring

The platform provides comprehensive hardware monitoring:

  • CPU: Core count, frequency, usage percentage
  • Memory: Total, used, available memory with usage statistics
  • GPU: NVIDIA GPU detection, memory usage, utilization metrics
  • System: Architecture, platform information

Performance Analysis

Get AI-powered optimization recommendations for your ML workloads:

from mlperf.optimization.distributed import DistributedOptimizer

# Initialize optimizer
optimizer = DistributedOptimizer(framework="pytorch")

# Get optimization recommendations
recommendations = optimizer.optimize_model_parallel(
    model_size_gb=10.0,
    gpu_count=4
)

Development

Setup Development Environment

# Clone repository
git clone https://github.com/llamasearchai/OpenPerformance.git
cd OpenPerformance

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -e .
pip install -r dev-requirements.txt

Running Tests

# Run all tests
python -m pytest tests/ -v

# Run with coverage
python -m pytest tests/ --cov=python/mlperf --cov-report=html

# Run specific test categories
python -m pytest tests/test_hardware.py -v
python -m pytest tests/test_integration.py -v

Code Quality

# Linting
flake8 python/ tests/

# Type checking
mypy python/mlperf/

# Security checks
bandit -r python/
safety check

Docker

Build and Run

# Build Docker image
docker build -t openperformance .

# Run container
docker run -p 8000:8000 openperformance

# Run with Docker Compose
docker-compose up -d

Docker Compose Services

  • API Server: FastAPI application on port 8000
  • Database: PostgreSQL for data persistence
  • Redis: Caching and rate limiting
  • Monitoring: Prometheus and Grafana

Configuration

Environment Variables

# Database
DATABASE_URL=postgresql://user:pass@localhost:5432/openperformance

# Redis
REDIS_URL=redis://localhost:6379

# Security
SECRET_KEY=your-secret-key
JWT_SECRET_KEY=your-jwt-secret

# API Keys
OPENAI_API_KEY=your-openai-api-key

# Logging
LOG_LEVEL=INFO
LOG_FILE=logs/openperformance.log

Configuration Files

  • config.env - Environment configuration
  • alembic.ini - Database migration configuration
  • pyproject.toml - Project metadata and dependencies

Architecture

OpenPerformance/
├── python/mlperf/           # Main Python package
│   ├── api/                # FastAPI application
│   ├── auth/               # Authentication and security
│   ├── cli/                # Command-line interface
│   ├── hardware/           # Hardware monitoring
│   ├── optimization/       # Performance optimization
│   ├── utils/              # Utilities and helpers
│   └── workers/            # Background workers
├── tests/                  # Test suite
├── docker/                 # Docker configuration
├── k8s/                    # Kubernetes manifests
├── scripts/                # Utility scripts
└── docs/                   # Documentation

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow PEP 8 style guidelines
  • Write comprehensive tests
  • Update documentation
  • Ensure all tests pass
  • Add type hints where appropriate

Testing

The platform includes comprehensive testing:

  • Unit Tests: 43 tests covering all core functionality
  • Integration Tests: Full workflow testing
  • Performance Tests: Benchmarking and profiling
  • Security Tests: Vulnerability scanning
# Run all tests
python -m pytest tests/ -v

# Run with coverage
python -m pytest tests/ --cov=python/mlperf --cov-report=html

# Run performance benchmarks
python -m pytest tests/performance/ -v

Security

  • JWT-based authentication
  • Role-based access control
  • Rate limiting
  • Input validation
  • Secure password hashing
  • CORS protection

Performance

  • Optimized for production workloads
  • Efficient memory usage
  • Fast API response times
  • Scalable architecture
  • Real-time monitoring

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Acknowledgments

  • Built with FastAPI, PyTorch, and modern Python tooling
  • Inspired by MLPerf and other performance engineering tools
  • Community contributions welcome

Roadmap

  • Web dashboard
  • Advanced analytics
  • Cloud integration
  • Real-time monitoring
  • Additional ML frameworks
  • Performance benchmarking suite

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openperformance-1.0.1.tar.gz (113.1 kB view details)

Uploaded Source

Built Distribution

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

openperformance-1.0.1-py3-none-any.whl (120.1 kB view details)

Uploaded Python 3

File details

Details for the file openperformance-1.0.1.tar.gz.

File metadata

  • Download URL: openperformance-1.0.1.tar.gz
  • Upload date:
  • Size: 113.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for openperformance-1.0.1.tar.gz
Algorithm Hash digest
SHA256 47453097fe9f4cf5c2195767e7d9bfac0f70c6358fb6fc96b62d7d97a4c73e5b
MD5 338794870f6bf6895a5f0d1142f013e3
BLAKE2b-256 a1e203aeae9368d4aca234cce75edb9bcff699c1cb2474d1e14e08e2fa6f3051

See more details on using hashes here.

File details

Details for the file openperformance-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for openperformance-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 187aca5b499a2cb7ace56cd904fa7c56cded19d7cdf0adf537a67ed0229a099b
MD5 66bf3b525879bdd8948d0537eb39a7aa
BLAKE2b-256 a6555413331469fc75975584fd945dac3231972c83c85811c4afa9271e2c4d25

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 files

Supported by

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