Metadata-Version: 2.4
Name: simgen-vla
Version: 5.0.2
Summary: High-precision GPU computing with exact arithmetic. Free during beta.
Home-page: https://simgen.dev
Author: Clouthier Simulation Labs
Author-email: Clouthier Simulation Labs <kyle@simgen.dev>
License: Free Beta
Project-URL: Homepage, https://simgen.dev
Project-URL: Documentation, https://simgen.dev/docs
Project-URL: Repository, https://github.com/clouthier-simulation-labs/simgen
Keywords: exact-arithmetic,GPU,precision,lossless,scientific-computing,machine-learning,deep-learning,simulation,finance,HPC,cuda,pytorch
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: cython; extra == "dev"
Requires-Dist: torch>=2.0; extra == "dev"
Requires-Dist: numpy>=1.20; extra == "dev"
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# SimGen VLA - High-Precision GPU Arithmetic

**Drop-in PyTorch replacement with exact arithmetic. Zero accumulation error.**

[![PyPI version](https://badge.fury.io/py/simgen-vla.svg)](https://pypi.org/project/simgen-vla/)
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
[![Free Beta](https://img.shields.io/badge/license-Free%20Beta-green.svg)](LICENSE)

> **Free during beta** - Use freely for research, academic, and commercial projects.

## The Problem

```python
import torch

# Classic floating-point failure
x = torch.tensor([1e16, 1.0, -1e16])
print(x.sum())  # 0.0  <- WRONG! Should be 1.0
```

## The Solution

```python
from simgen import vla

# Exact arithmetic - no precision loss
x = vla.tensor([1e16, 1.0, -1e16])
print(x.sum())  # tensor(1)  <- CORRECT!
```

## Installation

```bash
pip install simgen-vla
```

**Requirements:**
- Python 3.10+
- PyTorch 2.0+ with CUDA
- NVIDIA GPU (sm_60 to sm_90: Pascal through Hopper)

---

## API Reference

SimGen VLA provides a PyTorch-compatible API with exact arithmetic.

```python
from simgen import vla

# Create tensors (just like PyTorch)
x = vla.tensor([1.0, 2.0, 3.0])
y = vla.zeros((3, 3))
z = vla.ones((100,))
r = vla.randn((10, 10))

# All operations maintain full precision
result = x.sum()      # Exact sum
mean = x.mean()       # Exact mean
product = x.prod()    # Exact product
```

### Tensor Creation

| Function | Description |
|----------|-------------|
| `vla.tensor(data)` | Create tensor from list/array |
| `vla.zeros(shape)` | Zeros tensor |
| `vla.ones(shape)` | Ones tensor |
| `vla.randn(shape)` | Random normal tensor |
| `vla.rand(shape)` | Random uniform tensor |
| `vla.arange(start, end)` | Range tensor |
| `vla.linspace(start, end, n)` | Linear spaced tensor |
| `vla.eye(n)` | Identity matrix |

### Reductions (Exact, No Drift)

| Function | Description |
|----------|-------------|
| `vla.sum(x)` | Exact sum |
| `vla.mean(x)` | Exact mean |
| `vla.prod(x)` | Exact product |
| `vla.min(x)` | Minimum value |
| `vla.max(x)` | Maximum value |
| `vla.std(x)` | Standard deviation |
| `vla.var(x)` | Variance |

### Linear Algebra

| Function | Description |
|----------|-------------|
| `vla.matmul(a, b)` | Matrix multiplication |
| `vla.mm(a, b)` | Matrix-matrix multiply |
| `vla.mv(a, b)` | Matrix-vector multiply |
| `vla.dot(a, b)` | Dot product |
| `vla.bmm(a, b)` | Batched matrix multiply |

### Math Functions

| Function | Description |
|----------|-------------|
| `vla.exp(x)` | Exponential |
| `vla.log(x)` | Natural logarithm |
| `vla.sqrt(x)` | Square root |
| `vla.abs(x)` | Absolute value |
| `vla.sin(x)` | Sine |
| `vla.cos(x)` | Cosine |
| `vla.tan(x)` | Tangent |
| `vla.tanh(x)` | Hyperbolic tangent |
| `vla.sigmoid(x)` | Sigmoid |

### Shape Operations

| Function | Description |
|----------|-------------|
| `vla.reshape(x, shape)` | Reshape tensor |
| `vla.transpose(x, d0, d1)` | Transpose dimensions |
| `vla.squeeze(x)` | Remove size-1 dims |
| `vla.unsqueeze(x, dim)` | Add dimension |
| `vla.stack(tensors)` | Stack tensors |
| `vla.cat(tensors)` | Concatenate tensors |

---

## Example: Financial Calculations

```python
from simgen import vla

# Mixed magnitude positions - standard FP loses precision
positions = vla.tensor([
    1_000_000_000.00,  # $1B position
    0.01,              # 1 cent
    -999_999_999.99,   # Large short
    50_000.50,         # Medium position
])

# VLA preserves every cent
total = positions.sum()
print(f"Portfolio total: ${float(total):,.2f}")  # Exact
```

## Example: Scientific Computing

```python
from simgen import vla

# Large matrix operations with exact arithmetic
A = vla.randn((1000, 1000))
B = vla.randn((1000, 1000))
C = vla.matmul(A, B)

# Sum with zero accumulation error
total = C.sum()
```

---

## Supported GPUs

| Architecture | GPUs | Compute Capability |
|-------------|------|-------------------|
| Pascal | GTX 1080, P100 | sm_60, sm_61 |
| Volta | V100 | sm_70 |
| Turing | RTX 2080, T4 | sm_75 |
| Ampere | RTX 3090, A100 | sm_80, sm_86 |
| Ada Lovelace | RTX 4090, 4080, 4070 | sm_89 |
| Hopper | H100 | sm_90 |

---

## How It Works

SimGen VLA uses proprietary algorithms that:

1. **Eliminate accumulation errors** during computation
2. **Maintain full precision** through operation chains
3. **Produce deterministic results** regardless of evaluation order

The result is mathematically exact to the precision of the input.

---

## License

**Free during beta.** Use freely for research, academic, and commercial projects.

(c) 2025-2026 Clouthier Simulation Labs

**Website:** https://simgen.dev
**Contact:** kyle@simgen.dev
