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-1.0.0.tar.gz (178.4 kB view details)

Uploaded Source

Built Distribution

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

optimaxx-1.0.0-py3-none-any.whl (136.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for optimaxx-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c0c56957ab33842fce80895fcfc45c1e01d30e8fbefb9c48b1ed446ccaeea603
MD5 e1ed945aa9f00085e9606e1d4e39f7f0
BLAKE2b-256 0cd13e9f6f76d108f8fe5100aeec1daa810fce63392108561c6cbbcfa4594c16

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for optimaxx-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 23590f7c308c471423d5008e85e07873edefc8c054815afb67ed16137c51c0ba
MD5 5f3779c8c08ba53064ebb2a9c8002518
BLAKE2b-256 4e0c250387d1f59aaa92afca037e700f2bcce2b836eb6b8f4171cc80601f1d08

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