Skip to content

Commit 9a3d29b

Browse files
authored
Merge pull request #80 from cybertronai/YAD/adopt-bytedmd
Adopt ByteDMD as primary metric (vendored from cybertronai/ByteDMD)
2 parents 38343d7 + def240a commit 9a3d29b

22 files changed

Lines changed: 1925 additions & 20 deletions

CLAUDE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ This is a research workspace for the **Sutro Group**, a study group exploring en
2222
- **Data Movement Complexity (DMC)**: Better proxy metric (Ding et al., arXiv:2312.14441). DMC = sum of sqrt(stack_distance) for all float accesses. Tracks alongside ARD in MemTracker. Baseline: ARD 4,104 / DMC 300,298.
2323
- **Cache Energy Model**: register 5pJ, L1 (64KB) 20pJ, L2 (256KB) 100pJ, HBM 640pJ per float access (Bill Dally numbers).
2424
- **CacheTracker**: Extended MemTracker with LRU cache simulation for realistic energy estimates.
25-
- **TrackedArray / Auto DMD**: `TrackedArray` wraps numpy arrays so every operation (ufuncs, indexing, slicing) auto-records reads and writes on an `LRUStackTracker`. Removes manual instrumentation errors. See `docs/research/tracked-numpy.md`.
25+
- **TrackedArray / Auto DMD**: `TrackedArray` wraps numpy arrays so every operation (ufuncs, indexing, slicing) auto-records reads and writes on an `LRUStackTracker`. Removes manual instrumentation errors. Legacy element-level metric. See `docs/research/tracked-numpy.md`.
26+
- **ByteDMD (primary metric, new)**: Pure Python tracer at `src/bytedmd/`. Wraps Python values; traces Python-level ops via dunders. Byte-granularity LRU stack with simultaneous pricing and eager liveness compaction. Reads cost `ceil(sqrt(depth))`; writes are free. Spec/reference: https://github.com/cybertronai/ByteDMD. Use `bytedmd(func, args)` for cost or `traced_eval(func, args)` for the trace. Submissions to the challenge should use Python ops (no numpy) to be fully tracked.
2627

2728
## Current Best Methods
2829

docs/changelog.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
All notable changes to this research workspace.
44

5+
## [0.27.0] - 2026-04-14
6+
7+
### ByteDMD adopted as primary metric
8+
9+
- Vendored [cybertronai/ByteDMD](https://github.com/cybertronai/ByteDMD) at `src/bytedmd/`
10+
- 13 tests (10 core + 3 gotchas) all pass
11+
- TrackedArray retained as legacy tracker for existing experiments (30 tests still pass)
12+
- New docs page: `docs/research/bytedmd.md`
13+
- Decision made by Yaroslav after meetings with Wesley Smith and Bill Dally feedback. Byte-granularity rewards smaller dtypes; pure Python eliminates numpy escape hatches.
14+
- Existing challenge submissions stay on legacy DMC. New submissions use ByteDMD.
15+
516
## [0.26.0] - 2026-03-28
617

718
Largest release: auto-instrumented DMD tracking, RL eval environment, agent infrastructure, Telegram SQLite sync, and documentation fixes. 84 commits from 4 contributors.

docs/google-docs/bigger-picture.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,22 @@ Raw Thoughts
115115

116116
([[planning-sprint1.txt](https://drive.google.com/open?id=1Q2y9pdU4cT4Wn0MBE63XoSeg1xDbgwR-&usp=drive_fs)], [[planning-sprint2.txt](https://drive.google.com/open?id=1NmYwxYazoV5pXXEpV9D6I8J5iP9HB1fb&usp=drive_fs)], [[plannint-spring3.txt](https://drive.google.com/file/d/1xYjR7S4iSG0UeVRZzr-AS72FdsjQ4L-B/view?usp=sharing)], [[gemini](https://gemini.google.com/share/bef3c777a11b)])
117117

118+
.,
119+
120+
Yaroslav Sutro planning sprint #1
121+
122+
Objective
123+
124+
Solve the energy problem of AI. Similar mission to [[https://ml.energy/](https://ml.energy/)] .
125+
126+
Method
127+
128+
Blank slate rewrite. Draw on [[experience](https://docs.google.com/document/d/1PhArG_B1qrurqeXtqG41n_OorHw5J9kJcaZkhJOh7NU/edit?tab=t.0)] to prevent mistakes, (also, [[impractical research](https://www.youtube.com/watch?v=5CUTOOz-pYY&t=13s)])
129+
130+
Raw Thoughts
131+
132+
([[planning-sprint1.txt](https://drive.google.com/open?id=1Q2y9pdU4cT4Wn0MBE63XoSeg1xDbgwR-&usp=drive_fs)], [[planning-sprint2.txt](https://drive.google.com/open?id=1NmYwxYazoV5pXXEpV9D6I8J5iP9HB1fb&usp=drive_fs)], [[plannint-spring3.txt](https://drive.google.com/file/d/1xYjR7S4iSG0UeVRZzr-AS72FdsjQ4L-B/view?usp=sharing)], [[gemini](https://gemini.google.com/share/bef3c777a11b)])
133+
118134
# Mistakes
119135

120136
1. Too simple of an objective
@@ -151,7 +167,7 @@ Math / kernels design.
151167

152168
Hardware lottery (sarah [[hooker](https://hardwarelottery.github.io/)]), machine learning systems are [[stuck in a rut](https://dl.acm.org/doi/10.1145/3317550.3321441)] (Paul Barham, Michael Isard)
153169

154-
To avoid \-- remove as many boundaries as possible. At some point, the problem becomes too big to make progress on, we are forced to partititon to make progress. If we are motivated by keeping the complexity manageable,  we can periodically re-adjust the partitioning. In contrast to the current paradigm which keeps problem partitioning fixed:
170+
To avoid \-- remove as many boundaries as possible. At some point, the problem becomes too big to make progress on, we are forced to partititon to make progress. If we are motivated by keeping the complexity manageable,  we can periodically re-adjust the partitioning. In contrast to the current paradigm which keeps problem partitioning fixed:
155171

156172
- math people vs kernels people
157173

@@ -206,3 +222,7 @@ Michael: [[sutro_challenge_3_sparce parity results.docx](https://docs.google.com
206222
2. The Metric [[Yaroslav Knowledge sprint #1](https://docs.google.com/document/d/105FkE_U5_cXA1o8sxMGrj1NuTxysfSBTZsLB7vift-M/edit?tab=t.0#heading=h.p686ct9trrt)]
207223

208224
3. The Problem [[sutro group challenge #1: sparse parity](https://docs.google.com/document/d/16eeltCaTpiiM1t_m_5BSxRnqxoMoiJ-xn4cy0x-TFgc/edit?tab=t.0)]
225+
226+
# Links
227+
228+
Deep Learning invention timeline: [[https://chatgpt.com/share/69cafda2-5cc0-83e8-99a9-575e876e2c7d](https://chatgpt.com/share/69cafda2-5cc0-83e8-99a9-575e876e2c7d)]

docs/google-docs/how-to-search.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,15 @@ Click \"export chat history\", it'll save it to \"messages.html\"
141141
2.(optional) Use [[parse_telegram](https://drive.google.com/file/d/1NlGREDBJM7QXw_rmgSwsxdPiiCce3SFg/view?usp=sharing)] script to make the file smaller
142142

143143
3. Drag the file to Gemini and ask your query
144+
145+
1. Export archive. Click three verical dots[embedded image]
146+
147+
Click \"View group info\"
148+
149+
[embedded image]
150+
151+
Click \"export chat history\", it'll save it to \"messages.html\"
152+
153+
2.(optional) Use [[parse_telegram](https://drive.google.com/file/d/1NlGREDBJM7QXw_rmgSwsxdPiiCce3SFg/view?usp=sharing)] script to make the file smaller
154+
155+
3. Drag the file to Gemini and ask your query

docs/google-docs/meeting-1-energy-intro.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,40 @@ AI links (local to yaroslav)
445445

446446
[4. Picture]
447447

448+
AI links (local to yaroslav)
449+
450+
[[https://gemini.google.com/app/baf86fdafcaac3af](https://gemini.google.com/app/baf86fdafcaac3af)]
451+
452+
[[https://gemini.google.com/app/5c855e3a869d19cf](https://gemini.google.com/app/5c855e3a869d19cf)]
453+
454+
[[https://chatgpt.com/c/6970003e-4114-8333-86a8-71a8a0e97b23](https://chatgpt.com/c/6970003e-4114-8333-86a8-71a8a0e97b23)]
455+
456+
[Link to \"Slides\"]
457+
458+
[Meeting notes summary]
459+
460+
[Host: Yaroslav Bulatov]
461+
462+
[Jackjack Ganbold \@JackJack]
463+
464+
[Jonathan Belay (@Jonathan Belay )]
465+
466+
[Anish Tondwalkar]
467+
468+
[Seth Stafford]
469+
470+
[Caleb Sirak]
471+
472+
[Anushka Deshpande]
473+
474+
[Daria Soboleva]
475+
476+
[2. Companies & Named Entities]
477+
478+
[3. Key Topics & Tidbits]
479+
480+
[4. Picture]
481+
448482
# Link to \"Slides\"
449483

450484
from [[energy-efficient learning](https://docs.google.com/document/d/1PhArG_B1qrurqeXtqG41n_OorHw5J9kJcaZkhJOh7NU/edit?tab=t.0#heading=h.cdeox1s0xsl1)]

docs/google-docs/meeting-2-forward-forward.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,6 +1233,106 @@ Instead of a forward pass followed by a backward pass, the algorithm uses two fo
12331233
- The Negative Pass (Sleep): The network processes \"negative\" or \"hallucinated\" data (e.g., a hybrid image of a 7 and a 1, or an image with a wrong label). The objective is to minimize \"Goodness\".\
12341234

12351235

1236+
Key Technical Details:
1237+
1238+
- Goodness Function: Typically defined as the sum of squared neural activities (ReLU outputs) in a layer.\
1239+
1240+
- Greedy Layer-wise Learning: Each layer has its own objective function and updates its weights immediately, independent of the layers above or below it. This removes the need for a global error signal.\
1241+
+1\
1242+
1243+
- Normalization: To prevent activity from simply exploding to maximize goodness, the input vector to each layer is length-normalized. This forces the layer to learn from the orientation (spatial pattern) of the activity, not the magnitude.\
1244+
1245+
- Inference: For classification, the label is usually embedded into the input (e.g., a one-hot code in the corner). At inference, the network runs multiple passes---one for each possible label---and selects the label that accumulates the highest \"goodness\" score.\
1246+
+1\
1247+
1248+
1249+
------------------------------------------------------------------------
1250+
1251+
### 2. Summarized Questions and Concerns
1252+
1253+
During the discussion, the group likely identified several \"sticking points\" where the algorithm faces theoretical or practical hurdles:
1254+
1255+
#### A. The \"Negative Data\" Problem
1256+
1257+
- Question: How do we generate valid \"negative data\" for complex tasks?
1258+
- Concern: In the paper, Hinton uses spatial masks to stitch together MNIST digits. The group likely noted that generating high-quality negative data (that lies near the real data manifold but is clearly incorrect) is non-trivial for domains like NLP or Video. If the negative data is too easy (e.g., white noise), the network learns nothing; if it is too hard, the network fails to converge.
1259+
1260+
#### B. The \"Greedy\" Limitation
1261+
1262+
- Question: Does greedy, layer-wise training limit the depth of learning?
1263+
- Concern: Since Layer 1 optimizes its weights without feedback from Layer 10, it might discard information that seems useless locally but is critical for high-level abstraction. This contrasts with Backprop, which can credit-assign through depth.
1264+
- Critique: This effectively turns a Deep Net into a stack of shallow nets. Early experiments show FF struggles to match Backprop on datasets much complex than MNIST (like CIFAR-10) without specific hacks.
1265+
1266+
#### C. Inference Efficiency
1267+
1268+
- Question: Is this actually slower than Backprop?
1269+
- Concern: The inference method (running the forward pass \$N\$ times, once for each class label) scales poorly. For a 1000-class ImageNet task, this would be prohibitively slow compared to a single Softmax pass in standard networks.
1270+
1271+
#### D. Biological Plausibility vs. \"Hacks\"
1272+
1273+
- Question: Is Layer Normalization biologically plausible?
1274+
- Concern: The algorithm relies heavily on normalizing activity vectors between layers to prevent goodness leakage. Some members may have argued that this is just as biologically suspect as Backprop, as it requires a global calculation over the layer.
1275+
1276+
------------------------------------------------------------------------
1277+
1278+
### 3. Follow-up Points & To-Dos
1279+
1280+
Based on the paper and the discussion, here are recommended next steps to deepen your understanding:
1281+
1282+
Conceptual & Theoretical:
1283+
1284+
- Read \"Mortal Computation\": Review Hinton's broader philosophy on \"Mortal Computation.\" It explains why he wants algorithms that run on analog hardware (where weights cannot be copied), which is the true use-case for FF.
1285+
- Compare with Predictive Coding: FF is often compared to Predictive Coding (PC). Look into the differences: FF maximizes/minimizes \"Goodness\" (Energy), while PC typically minimizes \"Prediction Error.\"\
1286+
+1\
1287+
1288+
1289+
Experimental (Coding Projects):
1290+
1291+
- Reproduce MNIST: Clone a simple PyTorch implementation.
1292+
1293+
<!-- -->
1294+
1295+
- Experiment: Visualize the \"Negative Data.\" Try changing the negative generation method (e.g., use random noise vs. permuted pixels) and observe how the accuracy collapses. This proves the algorithm relies entirely on the quality of the \"hallucinations.\"
1296+
1297+
<!-- -->
1298+
1299+
- The \"Sandwich\" Method: Address the inference speed concern by using FF to train the first 3 layers (as a feature extractor), freezing them, and then training a standard Linear Classifier (Softmax) on top using Backprop. This allows for \$O(1)\$ inference while still using FF for feature learning.
1300+
- Permutation Invariance Test: Flatten MNIST images and shuffle the pixels. Train an FF network on this. It often performs surprisingly well compared to ConvNets, highlighting that FF relies on global correlations rather than local geometry.
1301+
1302+
Advanced Reading:
1303+
1304+
- The Recurrent Extension: If the \"Greedy\" critique (Point B) was a major concern, read the specific section of the paper on Recurrent Forward-Forward. Hinton proposes treating static images as a video sequence, allowing later layers to send feedback to earlier layers over time, which theoretically solves the greedy limitation.\
1305+
1306+
This is a detailed summary of the reading group discussion regarding Geoffrey Hinton's \"The Forward-Forward Algorithm: Some Preliminary Investigations.\"
1307+
1308+
This summary synthesizes the paper's core claims with the common critiques, questions, and follow-up topics that typically arise in technical deep dives on this work.
1309+
1310+
------------------------------------------------------------------------
1311+
1312+
### 1. Detailed Summary of the Paper
1313+
1314+
Title: The Forward-Forward Algorithm: Some Preliminary Investigations (Hinton, 2022)
1315+
1316+
Core Motivation:
1317+
1318+
The paper proposes an alternative to Backpropagation (BP). Hinton argues that BP is flawed as a model of biological learning and effectively blocks the development of energy-efficient analog hardware.
1319+
1320+
+1
1321+
1322+
- Bio-Implausibility: The brain cannot \"freeze\" neural activity to propagate error derivatives backward, nor does it have the symmetric connectivity required to send errors back through the same synapses used for the forward pass.\
1323+
1324+
- Hardware Constraints: BP requires perfect knowledge of the forward pass to compute derivatives. This prevents the use of analog or \"black box\" hardware (which is variable and noisy) and prevents \"pipelining\" (processing a continuous stream of data) because the network must wait for the backward pass.\
1325+
1326+
1327+
The Mechanism (Forward-Forward):
1328+
1329+
Instead of a forward pass followed by a backward pass, the algorithm uses two forward passes with opposing objectives.
1330+
1331+
- The Positive Pass (Wake): The network processes \"real\" data (e.g., an image of a 7 combined with the label 7). The objective is to maximize \"Goodness\" (neural activity) in every layer.\
1332+
1333+
- The Negative Pass (Sleep): The network processes \"negative\" or \"hallucinated\" data (e.g., a hybrid image of a 7 and a 1, or an image with a wrong label). The objective is to minimize \"Goodness\".\
1334+
1335+
12361336
Key Technical Details:
12371337

12381338
- Goodness Function: Typically defined as the sum of squared neural activities (ReLU outputs) in a layer.\

0 commit comments

Comments
 (0)