From 49389ecaa88d419c955aff05f725da0e9f70a7fb Mon Sep 17 00:00:00 2001 From: Andrej Karpathy Date: Sat, 27 Dec 2025 22:03:06 +0000 Subject: [PATCH] fix tf32 warning for deprecated api use --- nanochat/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nanochat/common.py b/nanochat/common.py index 8f36f94..ad0fb69 100644 --- a/nanochat/common.py +++ b/nanochat/common.py @@ -158,7 +158,7 @@ def compute_init(device_type="cuda"): # cuda|cpu|mps # Precision if device_type == "cuda": - torch.set_float32_matmul_precision("high") # uses tf32 instead of fp32 for matmuls + torch.backends.cuda.matmul.fp32_precision = "tf32" # uses tf32 instead of fp32 for matmuls # Distributed setup: Distributed Data Parallel (DDP), optional, and requires CUDA ddp, ddp_rank, ddp_local_rank, ddp_world_size = get_dist_info()