From f588169fdcc9af37477ab6a5a677815ab066edd8 Mon Sep 17 00:00:00 2001 From: George Hotz Date: Sun, 6 Oct 2024 21:04:06 +0800 Subject: [PATCH] hotfix: ad for DEBUG=2 in the mnist tutorial --- docs/mnist.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/mnist.md b/docs/mnist.md index 2cd34c50df..8aae08f241 100644 --- a/docs/mnist.md +++ b/docs/mnist.md @@ -98,6 +98,14 @@ timeit.repeat(step, repeat=5, number=1) So around 75 ms on T4 colab. +If you want to see a breakdown of the time by kernel: + +```python +from tinygrad import GlobalCounters, Context +GlobalCounters.reset() +with Context(DEBUG=2): step() +``` + ### Why so slow? Unlike PyTorch, tinygrad isn't designed to be fast like that. While 75 ms for one step is plenty fast for debugging, it's not great for training. Here, we introduce the first quintessentially tinygrad concept, the `TinyJit`.