Skip to main content

An intelligent AI model optimization framework for PyTorch.

Project description

Optimax

CI PyPI Python License Coverage

Optimax is an intelligent AI model optimization framework for PyTorch. It automatically analyzes hardware, profiles models, recommends optimizations, applies safe transformations, benchmarks performance, and generates rich reports.

Vision

Developers should be able to optimize any PyTorch model with a single line of code:

import optimax

report = optimax.analyze(model)
optimized_model = optimax.optimize(model, goal="latency", hardware="auto")

Features

  • Hardware Detection — Automatically detect CPU, GPU, CUDA, ROCm, Apple Metal, TPU, RAM, VRAM, and environment details.
  • Model Analysis — Deep inspection of model architecture, parameters, FLOPs, memory usage, and execution graph.
  • Profiling — Measure forward/backward latency, throughput, peak memory, and percentile statistics.
  • Recommendation Engine — Generate actionable optimization suggestions with expected speedup, memory savings, risk, and compatibility.
  • Optimization Engine — Modular, independent optimization passes (torch.compile, mixed precision, FlashAttention, quantization, operator fusion, gradient checkpointing, ONNX export, TensorRT) with validation and rollback.
  • Benchmarking — Compare original vs. optimized models with statistical rigor.
  • Rich Reports — JSON, HTML, Markdown, console, and PDF reports with charts and summaries.
  • CLI — Full command-line interface for analysis, optimization, benchmarking, and diagnostics.
  • Configuration — Support for pyproject.toml, YAML, JSON, and environment variables.

Quick Start

pip install optimax
import torch
import optimax

model = torch.nn.TransformerEncoderLayer(d_model=512, nhead=8)
report = optimax.analyze(model)
optimized = optimax.optimize(model, goal="latency", hardware="auto")

CLI Usage

# Analyze a model file
optimax analyze model.py

# Benchmark a model
optimax benchmark --model model.py --input-shape 1 3 224 224

# Optimize a model
optimax optimize --model model.py --goal latency --output optimized.pt

# Generate a report
optimax report --input report.json --format html

# Run diagnostics
optimax doctor

Documentation

Full documentation is available at https://optimax-ai.github.io/optimax.

Installation

pip install optimax

For development:

pip install optimax[dev]

For optional backends (ONNX, TensorRT):

pip install optimax[all]

Contributing

We welcome contributions! Please read our Contributing Guide and Code of Conduct before submitting issues or pull requests.

License

Optimax is licensed under the Apache License 2.0.

Security

Please see our Security Policy for reporting vulnerabilities.

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

optimaxx-0.1.0.tar.gz (2.1 MB view details)

Uploaded Source

Built Distribution

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

optimaxx-0.1.0-py3-none-any.whl (63.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: optimaxx-0.1.0.tar.gz
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for optimaxx-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0ac6d3dbfb66f0d1adefb17315f38d479216659462b0f194772b31e630e792dc
MD5 66848446e631c33b63a2eaa91e10e98b
BLAKE2b-256 983f1336176c71889a3594ffc13f4c3a88182f6a17f3bc9bd716f78d4e50354e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: optimaxx-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 63.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for optimaxx-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2c55de3b5b5813b950c82973eea62791d99f14ebe5aedc0f217bcf786ac36ed9
MD5 3f1434637d53a818466c4d638431827e
BLAKE2b-256 238aa7d3edd69729e7765cb2fd6a5ed7d39305e3c4ef23f1a6cbe8a37a50823d

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