Skip to content
AI News HubLIVE
More
Source content · Analysis pending1 min read

Everything is a UOp – reading the deep learning stack behind comma[dot]AI

Summary

i’ve used PyTorch for years. a @ b, .backward(), .cuda(). works every time. i never thought about what’s underneath. then i came across tinygrad. it’s the deep learning stack behind comma.ai’s op…

SourceHacker News AIAuthor: nathaah3
Everything is a UOp – reading the deep learning stack behind comma[dot]AI
Report an error

The correction channel is not available yet. You can copy the article reference below for later.

Correction instructions
Read article

i’ve used PyTorch for years. a @ b, .backward(), .cuda(). works every time. i never thought about what’s underneath. then i came across tinygrad. it’s the deep learning stack behind comma.ai’s openpilot, the open-source self-driving system. 17K lines of Python. PyTorch is 3 million lines of C++. this thing fits the whole pipeline, including the compiler, in less code than some test suites. i figured i’d spend an afternoon reading it. to give an outline of how tinygrad works, we would explore these 4 stages: the first thing i noticed to start with, we need to know how a tensor operation works. the fundamental tensor operation used in DL libraries is matrix multiplication. so, i opened a terminal and typed this out. from tinygrad import Tensor a = Tensor.rand(4, 4) b = Tensor.rand(4, 4) c = a.matmul(b) print(c.shape) # (4, 4)

Key points and analysis

Article intelligence

EngineersAdvanced

Key points

  • AI generation is temporarily unavailable; this entry was preserved with deterministic fallback metadata.
  • i’ve used PyTorch for years. a @ b, .backward(), .cuda(). works every time. i never thought about what’s underneath. then i came across tinygrad. it’s the deep l…

Highlights and analysis are generated automatically and may contain errors. Check the original source.