Metadata-Version: 2.4
Name: USN
Version: 0.3.0
Summary: Unified State Network (USN) Architecture Library - A production-grade autoregressive sequence modeling architecture with O(n) training and O(1) inference.
Author: BUEORM
License-Expression: MIT
Project-URL: Homepage, https://github.com/BUEORM/USN
Project-URL: Documentation, https://github.com/BUEORM/USN/docs
Project-URL: Repository, https://github.com/BUEORM/USN
Keywords: deep-learning,sequence-modeling,state-space,autoregressive,parallel-scan
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
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 :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: torch>=2.0.0
Requires-Dist: numpy>=1.24.0
Requires-Dist: tokenizers>=0.15.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: tqdm>=4.60.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: hypothesis>=6.0; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: sphinx-rtd-theme; extra == "docs"
Provides-Extra: cuda
Requires-Dist: triton>=2.1.0; extra == "cuda"
Provides-Extra: all
Requires-Dist: USN[cuda,dev,docs]; extra == "all"
Dynamic: license-file

# USN - Unified State Network Architecture Library

A production-grade Python package implementing the Unified State Network (USN) architecture for autoregressive sequence modeling.

USN replaces attention mechanisms with a unified persistent state partitioned into semantic (vector) and relational (matrix) subspaces, achieving **O(n) training complexity** via associative parallel scan and **O(1) inference memory** via constant-size state.

## Features

- Novel state-space architecture with no attention mechanism
- O(n) training via parallel associative scan
- O(1) inference memory via constant-size persistent state
- 4-level acceleration hierarchy (Triton → torch.compile → custom autograd → eager)
- Single-file `.usn` serialization format
- CLI interface for training, generation, and benchmarking

## Installation

```bash
pip install USN
```

For development:

```bash
pip install USN[dev]
```

For CUDA acceleration:

```bash
pip install USN[cuda]
```

For all optional dependencies:

```bash
pip install USN[all]
```

## Quick Start

```python
import usn

# Create a model from a preset configuration
config = usn.USNConfig.tiny()
model = usn.create_model(config)

# Print model summary
print(model.summary())
```

## License

MIT License - Copyright (c) 2024 BUEORM
