Skip to main content

A compiler backend for PyTorch: pointwise fusion, buffer-reuse planning, and a persistent cross-run compile cache.

Project description

g2n

A compiler backend for PyTorch: pointwise fusion, buffer-reuse planning, and a persistent cross-run compile cache so repeat builds skip recompilation.

pip install g2n
import torch
import g2n

model = MyModule().eval()
compiled = g2n.compile(model)
# or register as a torch.compile backend:
compiled = torch.compile(model, backend="g2n")

A license key unlocks the Pro and Enterprise features (enhanced buffer planner, persistent cache, multi-accelerator routing, model-zoo configurations). See the documentation at https://g2n.dev/docs.

Custom kernels (Pro / Enterprise)

With a licensed tier, the g2n backend runs a real custom compile pass: it fuses LayerNorm (and a trailing GELU) into a Triton kernel via a torch.library custom op, then hands the rest of the graph to TorchInductor. See ARCHITECTURE.md. Correctness is covered by tests/test_layernorm.py; benchmark on your own GPU before quoting any speedup.

Project details


Download files

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

Source Distribution

g2n-0.5.0.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

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

g2n-0.5.0-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for g2n-0.5.0.tar.gz
Algorithm Hash digest
SHA256 9bc823abebd7990a946ce69a53c22fe1a806fbacb445355cfb729f9d2beed6f3
MD5 c14023a1f8822e715064447c4d8eae4c
BLAKE2b-256 63153a2726ee82eac37e74408d276710ef6b8ab96ac8c8bd95140fa14c11ea31

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for g2n-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5fa923dae4eb221be2a79fc90c912a16137bb2c6f22723dd0f28bfcc146c183e
MD5 affa3a011282b4e56131397cedd8c978
BLAKE2b-256 c1fba0a766d7c388a24a7ecc9b870fa6e4202cd50d09b0c99be25ac534442ca8

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