Commit History
-
add a few tests
Andrej Karpathyf8a85a5
-
Merge branch 'master' into fix/kernel
svlandega14c399
-
delete autocast, an unnecessary thorn in my side, manage dtypes directly
Andrej Karpathy1076f97
-
Merge branch 'master' into fix/kernel
svlandega54691b
-
Fix MockModel's device definition (#535)
Sofie Van LandeghemUnverified signature* fix MockModel's device definition * cleanup4800c62
-
also update comments
svlandeg535f664
-
Fix SDPA KV-cache decode to respect sliding window (#456)
Andrej Karpathy +2: KartikVashishta, Claude Opus 4.5
SDPA fallback now respects sliding window during single-token KV-cache decode by slicing K/V to the last (window + 1) tokens. Also simplifies the mask building for chunk inference to properly apply sliding window in that path as well. Fixes #452 Co-Authored-By: Kartik Vashishta <kartikv776@gmail.com> Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>3ba42e8
-
update the CPU/MPS script to give reasonable results. The model can at least answer that Paris is the capital of France and knows that the sky is blue, for about 40 minutes of training on my macbook. Also fixed a bug that existed due to KVCache bfloat16 dtype assumption
karpathyf9a7e0f -
Add high value engine tests for core invariants (33 LoC) (#396)
Unverified signature* test: add engine generation tests for expected invariants - test_seed_reproducibility - test_temperature_zero_determinism - test_max_tokens_respected - test_num_samples_count 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Fix temperature test * add test for seed variation in sampling Add test for seed variation in sampling with temperature > 0. * Rename test for clarity * Shorten assert msg --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>bbc4413
-
implement flash attention 3 fallback to pytorch sdpa by touching as few lines of code as possible in main files and keeping all implementation to a single file. add tests. add helpful warning messages for the user.
Andrej Karpathy8203efa
-
integrate Flash Attention 3. +9% tok_per_sec for d12 with ctx even as low as 2048 out of the box nice. also, ready to tune windows huge
Andrej Karpathy2ff7d51
-
also delete the rustbpe test code, this now lives in rustbpe repo that is separate
Andrej Karpathyda8b7ea
-
fix: sample first token independently for each row in multi-sample generation
Andrej Karpathy +1: Claude Opus 4.5Previously, when generating multiple samples (num_samples > 1), the first token after prefill was sampled once and broadcast to all rows, causing all samples to start identically. Now the prefill logits are expanded to num_samples and sampled independently for each row. Also simplified the generation loop by moving the forward pass to the end of the loop, eliminating the first_iteration flag and if/else branching. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>8f979a8 -
Replace speedup assertion with warning in batch_encode test
Andrej Karpathy +1: Claude Opus 4.5Performance varies by machine and load, making hard assertions flaky. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>91d76cc
-
add rust batch encode as a faster option over encode
790f3be
-
ensure consistency of quotes within each statement
svlandeg2ce62ec -
add explicit UTF-8 encoding
svlandegc72b8b2
-
also add a test that failed before the fix and passes now with the fix for kv cache resize
Andrej Karpathybaf0b3f
-
initial commit
karpathy3a5e0bc