Metadata-Version: 2.4
Name: quarterbit
Version: 12.0.0
Summary: AXIOM - High-performance optimizer for deep learning with extreme memory efficiency
Home-page: https://quarterbit.dev
Author: Clouthier Simulation Labs
Author-email: Clouthier Simulation Labs <info@quarterbit.dev>
License: Commercial
Project-URL: Homepage, https://quarterbit.dev
Project-URL: Documentation, https://quarterbit.dev/docs
Keywords: optimizer,adam,deep-learning,pytorch,gpu,memory-efficient,compression,axiom
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.12
Description-Content-Type: text/markdown
Dynamic: author
Dynamic: home-page
Dynamic: requires-python

# QuarterBit - AXIOM Optimizer

**High-performance optimizer for deep learning**

Drop-in Adam replacement with extreme memory efficiency and improved convergence.

## Features

- **Memory Efficient** - Train larger models on the same hardware
- **Better Convergence** - Outperforms AdamW across domains
- **Domain Profiles** - Auto-configured for language, vision, diffusion, and more
- **Production Ready** - Gradient clipping, NaN detection, checkpointing

## Quick Start

```python
from quarterbit import AXIOM

optimizer = AXIOM(model.parameters(), lr=1e-4)

# With domain profile
optimizer = AXIOM(model.parameters(), lr=1e-4, profile="language")

# Training loop
for batch in dataloader:
    loss = model(batch).loss
    optimizer.zero_grad()
    loss.backward()
    optimizer.step(loss.item())
```

## Domain Profiles

| Profile | Use Case |
|---------|----------|
| `language` / `llm` | GPT, LLaMA, Gemma |
| `nlu` | BERT, RoBERTa |
| `vision` / `vit` | ViT, DeiT, Swin |
| `cnn` | ResNet, ConvNeXt |
| `diffusion` | Stable Diffusion, DDPM |
| `audio` | Whisper, HuBERT |
| `speech` / `tts` | VITS, Bark |
| `multimodal` | CLIP, LLaVA |
| `moe` | Mixtral, Switch |

## Extensions

### Activation Checkpoint

Reduce activation memory during training.

```python
from quarterbit.axiom import ActivationCheckpoint

actcp = ActivationCheckpoint(max_slots=32, max_n=1024*1024)
actcp.store(hidden_states, slot=layer_idx)
hidden_states = actcp.restore(slot=layer_idx)
```

### Gradient Compression (DDP)

Reduce all-reduce bandwidth for distributed training.

```python
from quarterbit.axiom import GradientCompressor

gc = GradientCompressor(n=total_params, top_k_percent=6.25)
vals, idx, count = gc.compress(all_gradients)
```

## Installation

```bash
# PyTorch required
pip install torch --index-url https://download.pytorch.org/whl/cu121

# Install QuarterBit
pip install quarterbit
```

## Supported GPUs

- NVIDIA Pascal and newer (sm_60+)
- T4, RTX 20/30/40 series, A100, H100

## API

```python
AXIOM(
    params,                    # Model parameters
    lr=0.001,                  # Learning rate
    betas=(0.9, 0.999),        # Adam betas
    eps=1e-8,                  # Epsilon
    weight_decay=0.01,         # Weight decay
    profile=None,              # Domain profile
    max_grad_norm=None,        # Gradient clipping
    detect_anomaly=True,       # NaN/Inf detection
)

optimizer.step(loss)           # Pass loss for adaptive LR
optimizer.get_lr()             # Current learning rate
optimizer.state_dict()         # For checkpointing
optimizer.load_state_dict(d)   # Restore checkpoint
```

## License

Commercial license required for production use.
Free for research and evaluation.

**https://quarterbit.dev**

---

Copyright 2026 Clouthier Simulation Labs. All rights reserved.
