Skip to main content

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).

pip install g2n torch
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:

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

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 · full manual in the repo's docs/.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

g2n-1.5.0.tar.gz (30.3 kB view details)

Uploaded Source

Built Distribution

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

g2n-1.5.0-py3-none-any.whl (25.8 kB view details)

Uploaded Python 3

File details

Details for the file g2n-1.5.0.tar.gz.

File metadata

  • Download URL: g2n-1.5.0.tar.gz
  • Upload date:
  • Size: 30.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for g2n-1.5.0.tar.gz
Algorithm Hash digest
SHA256 17324bcfbb91eea49a610efb403f7e029d8ad81429f77bb26e593eea111f272c
MD5 d988bf8fa5a7a2aee8d1d33bbc6bbbc9
BLAKE2b-256 7c29ece509072914f16b1b7c2223bda845c75651239a43a9a05aa0bf8e719e06

See more details on using hashes here.

File details

Details for the file g2n-1.5.0-py3-none-any.whl.

File metadata

  • Download URL: g2n-1.5.0-py3-none-any.whl
  • Upload date:
  • Size: 25.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for g2n-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 547a7612786f27806a5eb482252a751b7380326a65160dd931fd06389ed4d35e
MD5 1918d6cf72925ca59bab9da608e5137a
BLAKE2b-256 0dea79c9c14f055d8d384691b62e078fd06fab61dc763be1255cfbef5ccb0639

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