mirror of
https://github.com/karpathy/nanochat.git
synced 2026-05-26 17:48:05 +00:00
Refactor Engram data structures for torch.compile compatibility: - Replace nn.ModuleDict (string-keyed) with nested nn.ModuleList (integer-indexed) - Precompute hash powers in __init__ and re-materialize in init_weights to eliminate torch.tensor() construction during forward - Remove hash_seeds and table_sizes dicts (info embedded in _powers / embed_tables) - Add _patch_removed_state_keys for old engram checkpoint backward compat Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| test_attention_fallback.py | ||
| test_engine.py | ||
| test_engram.py | ||