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

작성자

카테고리:

← 피드로
DEV Community · Sarkar-AGI · 2026-07-19 개발(SW)

Sarkar-AGI

[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

Enter fullscreen mode Exit fullscreen mode

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:

  • LLaMA-3, GPT-2, BERT, ViT, Whisper partially implemented
  • Flash Attention v2, GPTQ/AWQ quantisation
  • FSDP, DPO, SFT trainers
  • Early stage — looking for Go + C++/CUDA contributors

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?
Fill this form:https://docs.google.com/forms/d/e/1FAIpQLSe8rxglSofehizPqFu5Rb8XjsWXGaOzlh2ZZXHExrr8Qk8Sng/viewform

원문에서 계속 ↗

코멘트

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다