mirror of
https://github.com/karpathy/nanochat.git
synced 2026-04-01 21:25:21 +00:00
The bf16 cast is intentional for speed on Hopper+ GPUs, but should be skipped on other platforms rather than blindly applied. fp16 is unstable here due to its limited exponent range, and fp32 platforms don't benefit from the cast. Now: bf16 when COMPUTE_DTYPE is bf16, no cast otherwise. Inspired by PR #667. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| checkpoint_manager.py | ||
| common.py | ||
| core_eval.py | ||
| dataloader.py | ||
| dataset.py | ||
| engine.py | ||
| execution.py | ||
| flash_attention.py | ||
| fp8.py | ||
| gpt.py | ||
| logo.svg | ||
| loss_eval.py | ||
| optim.py | ||
| report.py | ||
| tokenizer.py | ||
| ui.html | ||