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
Metadata
Release files for openperformance 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| openperformance-1.0.1.tar.gz | 113.1 kB | Without provenance | Details for openperformance-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| openperformance-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for openperformance-1.0.1-py3-none-any.whl |
Total release size: 233.2 kB
Release files / openperformance-1.0.1.tar.gz
| Download URL | openperformance-1.0.1.tar.gz |
|---|---|
| Size | 113.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
47453097fe9f4cf5c2195767e7d9bfac0f70c6358fb6fc96b62d7d97a4c73e5b
|
|
BLAKE2b-256 checksum How to use checksums |
a1e203aeae9368d4aca234cce75edb9bcff699c1cb2474d1e14e08e2fa6f3051
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.13
|
Release files / openperformance-1.0.1-py3-none-any.whl
| Download URL | openperformance-1.0.1-py3-none-any.whl |
|---|---|
| Size | 120.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
187aca5b499a2cb7ace56cd904fa7c56cded19d7cdf0adf537a67ed0229a099b
|
|
BLAKE2b-256 checksum How to use checksums |
a6555413331469fc75975584fd945dac3231972c83c85811c4afa9271e2c4d25
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.13
|
Security for openperformance 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.