From d6c4f3b923ce9c648a9865a34e651a1b8b3f01c8 Mon Sep 17 00:00:00 2001 From: Andrej Karpathy Date: Fri, 30 Jan 2026 17:03:15 +0000 Subject: [PATCH] i think this is the new torch 2.9+ API for declaring tf32 preference --- nanochat/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nanochat/common.py b/nanochat/common.py index 44760f9..db9e317 100644 --- a/nanochat/common.py +++ b/nanochat/common.py @@ -170,7 +170,7 @@ def compute_init(device_type="cuda"): # cuda|cpu|mps # Precision if device_type == "cuda": - torch.backends.cuda.matmul.fp32_precision = "tf32" # uses tf32 instead of fp32 for matmuls + torch.backends.fp32_precision = "tf32" # uses tf32 instead of fp32 for matmuls # Distributed setup: Distributed Data Parallel (DDP), optional, and requires CUDA is_ddp_requested, ddp_rank, ddp_local_rank, ddp_world_size = get_dist_info()