The best ChatGPT that $100 can buy.
Python
Fix bug in setting precision (#538)
George Shakanad5557532644
diff --git a/nanochat/common.py b/nanochat/common.pyindex 9bcd5dd..2dd0792 100644--- a/nanochat/common.py+++ b/nanochat/common.py@@ -170,7 +170,7 @@ def compute_init(device_type="cuda"): # cuda|cpu|mps# Precisionif device_type == "cuda":- torch.backends.fp32_precision = "tf32" # uses tf32 instead of fp32 for matmuls+ torch.set_float32_matmul_precision("high") # uses tf32 instead of fp32 for matmuls, see https://docs.pytorch.org/docs/stable/generated/torch.set_float32_matmul_precision.html# Distributed setup: Distributed Data Parallel (DDP), optional, and requires CUDAis_ddp_requested, ddp_rank, ddp_local_rank, ddp_world_size = get_dist_info()