cd /news/artificial-intelligence/pygo-a-deep-learning-framework-where… · home topics artificial-intelligence article
[ARTICLE · art-65120] src=dev.to ↗ pub= topic=artificial-intelligence verified=true sentiment=· neutral

PyGo: A Deep Learning Framework Where Go Calls Python Calls C++

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.

read1 min views1 publishedJul 19, 2026

[Project] PyGo – embedding CPython inside a Go process to build a deep learning framework

I'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.

The architecture looks like this:

Go API → CGo bridge → CPython (embedded) → pybind11 → CUDA/AVX-512 kernels

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

Why Go on top?

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

Current state:

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

Looking for core contributors — especially Go devs with CGo experience, Python autograd engineers, and C++/CUDA kernel writers.

Interested in joining?

Email: amitsarkar1066@gmail.com

── more in #artificial-intelligence 4 stories · sorted by recency
── more on @pygo 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/pygo-a-deep-learning…] indexed:0 read:1min 2026-07-19 ·