[GH-ISSUE #1614] [Bug] Milestone 3 does not get past 75% test accuracy over xor problem #27926

Closed
opened 2026-06-20 11:56:19 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @AndreaMattiaGaravagno on GitHub (Apr 30, 2026).
Original GitHub issue: https://github.com/harvard-edge/cs249r_book/issues/1614

Area

TinyTorch

Location

Milestone 3

Description

Milestone 3 does not get past 75% test accuracy over xor problem

Expected Behavior

Milestone 3 should get 100% test accuracy over the xor problem

Environment (TinyTorch bugs only)

Tiny🔥Torch v0.1.10
Python 3.12.3
/home/andre/tinytorch/.venv

Originally created by @AndreaMattiaGaravagno on GitHub (Apr 30, 2026). Original GitHub issue: https://github.com/harvard-edge/cs249r_book/issues/1614 ### Area TinyTorch ### Location Milestone 3 ### Description Milestone 3 does not get past 75% test accuracy over xor problem ### Expected Behavior Milestone 3 should get 100% test accuracy over the xor problem ### Environment (TinyTorch bugs only) Tiny🔥Torch v0.1.10 Python 3.12.3 /home/andre/tinytorch/.venv
GiteaMirror added the priority-higharea: tinytorchtype: bug labels 2026-06-20 11:56:20 -05:00
Author
Owner

@profvjreddi commented on GitHub (Apr 30, 2026):

Fixed in #1618 (merged to dev as f1d5a755f). Regression traced to commit d30257577c which migrated np.random.seed(1986) (global, affecting layer init) to a local rng = np.random.default_rng(7) that's never used — so layer weights ended up using tinytorch.core.layers.rng at the default seed=7, which on this XOR architecture lands in a dead-ReLU saddle (the 75% failure mode). Fix: explicitly re-seed tinytorch.core.layers.rng to 1986 right before model construction in 02_xor_solved.py. Verified 100% convergence (loss 0.0053 in 500 epochs).

<!-- gh-comment-id:4356774000 --> @profvjreddi commented on GitHub (Apr 30, 2026): Fixed in #1618 (merged to dev as f1d5a755f). Regression traced to commit d30257577c which migrated `np.random.seed(1986)` (global, affecting layer init) to a local `rng = np.random.default_rng(7)` that's never used — so layer weights ended up using `tinytorch.core.layers.rng` at the default seed=7, which on this XOR architecture lands in a dead-ReLU saddle (the 75% failure mode). Fix: explicitly re-seed `tinytorch.core.layers.rng` to 1986 right before model construction in `02_xor_solved.py`. Verified 100% convergence (loss 0.0053 in 500 epochs).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/cs249r_book#27926