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.3.1.tar.gz (25.7 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.3.1-py3-none-any.whl (23.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for g2n-1.3.1.tar.gz
Algorithm Hash digest
SHA256 679bcad695e9e2d12449f73ea91e578fac8a49bda12ebcd02fa3fa0dfb4cadcc
MD5 8ebaa2bf30d4e6112dc15a01aec0128d
BLAKE2b-256 c646939ef097e4d7d9c6a81b1e9c5d2912d96d180dbca4c3e8ff894115ff350f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: g2n-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 23.6 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.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bfaa4765cf2307c9725af6b6827862d39650c090258fc9166b24c1a48da18d10
MD5 de03b9c7eb2a82baf3b41f948f12878c
BLAKE2b-256 f823bfc9dcb965aba900f519df5c7ebe68de52092c12c6dd8776b8b41d66352c

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