{"slug": "pygo-a-deep-learning-framework-where-go-calls-python-calls-c", "title": "PyGo: A Deep Learning Framework Where Go Calls Python Calls C++", "summary": "A developer built PyGo, a deep learning framework where Go serves as the top-level API, Python handles autograd and model zoo, and C++/CUDA performs raw compute. CPython is embedded inside the Go binary, with tensors in shared memory enabling zero-copy across all layers. The project aims to integrate ML models natively into Go-based infrastructure like Kubernetes, though CGo call overhead at the tensor boundary remains an unsolved challenge.", "body_md": "**[Project] PyGo – embedding CPython inside a Go process to build a deep learning framework**\n\nI've been working on something a bit unusual: a deep learning framework where Go is the top-level API, Python handles autograd and the model zoo, and C++/CUDA does the raw compute.\n\nThe architecture looks like this:\n\n```\nGo API → CGo bridge → CPython (embedded) → pybind11 → CUDA/AVX-512 kernels\n```\n\nThe key insight: instead of a Python sidecar in every pod, CPython runs *inside* the Go binary. Tensors live in shared memory — zero-copy across all three layers.\n\n**Why Go on top?**\n\nGo is already running most ML infrastructure (K8s, Prometheus, etcd). PyGo makes models first-class citizens there, without rewriting your ops stack. Goroutines make dynamic batching trivial.\n\n**Current state:**\n\nThe main unsolved problem is CGo call overhead at the tensor boundary. If anyone has experience embedding CPython in a Go process, I'd love to talk.\n\nLooking for core contributors — especially Go devs with CGo experience, Python autograd engineers, and C++/CUDA kernel writers.\n\nInterested in joining?\n\nEmail: [amitsarkar1066@gmail.com](mailto:amitsarkar1066@gmail.com)", "url": "https://wpnews.pro/news/pygo-a-deep-learning-framework-where-go-calls-python-calls-c", "canonical_source": "https://dev.to/sarkaragi/pygo-a-deep-learning-framework-where-go-calls-python-calls-c-4amo", "published_at": "2026-07-19 07:35:56+00:00", "updated_at": "2026-07-19 07:57:12.088353+00:00", "lang": "en", "topics": ["artificial-intelligence", "machine-learning", "developer-tools", "ai-infrastructure"], "entities": ["PyGo", "Go", "Python", "C++", "CUDA", "CPython", "CGo", "Kubernetes"], "alternates": {"html": "https://wpnews.pro/news/pygo-a-deep-learning-framework-where-go-calls-python-calls-c", "markdown": "https://wpnews.pro/news/pygo-a-deep-learning-framework-where-go-calls-python-calls-c.md", "text": "https://wpnews.pro/news/pygo-a-deep-learning-framework-where-go-calls-python-calls-c.txt", "jsonld": "https://wpnews.pro/news/pygo-a-deep-learning-framework-where-go-calls-python-calls-c.jsonld"}}