Metadata-Version: 2.4
Name: g2n
Version: 1.3.1
Summary: Optimize and run PyTorch models: an open-core compiler (fusion, buffer planning, persistent compile cache), a quantum circuit simulator (g2n.quantum), plus a license-gated serving platform that runs your models behind an inference server.
Author: g2n
Maintainer: g2n
License: Apache-2.0
Project-URL: Homepage, https://g2n.dev
Project-URL: Documentation, https://g2n.dev/docs
Project-URL: Source, https://github.com/your-org/g2n
Project-URL: Issues, https://github.com/your-org/g2n/issues
Keywords: pytorch,compiler,triton,gpu,inference,serving,model-server,torch.compile,quantum,quantum-simulator,statevector
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
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
Classifier: Topic :: Software Development :: Compilers
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: cryptography>=41.0
Provides-Extra: torch
Requires-Dist: torch>=2.4; extra == "torch"
Provides-Extra: triton
Requires-Dist: triton>=2.2; extra == "triton"
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == "dev"
Requires-Dist: twine>=5; extra == "dev"
Requires-Dist: pytest>=7; extra == "dev"

# g2n — a `torch.compile` backend that pays attention

Open-core PyTorch compiler: custom FX fusion passes, a Triton LayerNorm
kernel, and license-gated Inductor tuning. Plus `g2n.quantum`, a statevector
quantum circuit **simulator** (classical simulation — not quantum hardware).

```bash
pip install g2n torch
```

```python
import torch, g2n

compiled = g2n.compile(model)     # == torch.compile(model, backend="g2n")
y = compiled(x)
```

Free (Community) gives you the g2n fusion passes on stock Inductor and
quantum circuits up to 24 qubits. A license key unlocks more — activation is
one command and then fully offline:

```bash
export G2N_LICENSE_KEY=G2N-XXXX-XXXX-XXXX
g2n activate && g2n status
```

| Unlock | Tier |
|---|---|
| Persistent compile cache (warmup once per machine, not per run) | Pro |
| Enhanced planner: epilogue fusion + custom Triton kernels | Pro |
| Serving platform (`pip install g2n-enterprise`): registry, HTTP node, quantization incl. weight-only int8, CUDA graphs | Pro |
| Quantum: unlimited qubits + circuit fusion | Pro |
| max-autotune, dynamic batching, batched quantum sweeps, model zoo | Enterprise |

## Quantum in 20 seconds

```python
import g2n.quantum as qf
c = qf.Circuit(2).h(0).cnot(0, 1)      # Bell state
c.measure_all(shots=1000)              # {'00': ~500, '11': ~500}
c.expectation("ZZ")                    # tensor(1.)
```

## Guarantees

- **Never worse than eager**: any compile failure returns your unmodified
  model with a one-line warning.
- **Offline after activation**: license tokens are Ed25519-verified locally;
  no phone-home during runs.
- **Honest numbers**: no benchmark claim without named hardware and a
  script to reproduce it — including on your own machine.

Docs, pricing, benchmarks: **[g2n.dev](https://g2n.dev)** · full manual in
the repo's `docs/`.
