Enterprise-grade ML Performance Engineering Platform for optimization, monitoring, and deployment
Project description
OpenPerformance
A comprehensive ML Performance Engineering Platform for optimizing and monitoring machine learning workloads.
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 checkGET /system/metrics- Real-time system metricsGET /system/hardware- Detailed hardware informationPOST /analyze/performance- Performance analysis and optimizationGET /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 configurationalembic.ini- Database migration configurationpyproject.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
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - 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
- Documentation: GitHub Wiki
- Issues: GitHub Issues
- Discussions: GitHub Discussions
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
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47453097fe9f4cf5c2195767e7d9bfac0f70c6358fb6fc96b62d7d97a4c73e5b
|
|
| MD5 |
338794870f6bf6895a5f0d1142f013e3
|
|
| BLAKE2b-256 |
a1e203aeae9368d4aca234cce75edb9bcff699c1cb2474d1e14e08e2fa6f3051
|
File details
Details for the file openperformance-1.0.1-py3-none-any.whl.
File metadata
- Download URL: openperformance-1.0.1-py3-none-any.whl
- Upload date:
- Size: 120.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
187aca5b499a2cb7ace56cd904fa7c56cded19d7cdf0adf537a67ed0229a099b
|
|
| MD5 |
66bf3b525879bdd8948d0537eb39a7aa
|
|
| BLAKE2b-256 |
a6555413331469fc75975584fd945dac3231972c83c85811c4afa9271e2c4d25
|