From e0a2ec43cfca1cd8c50d36d7209706fbd1f8fbc3 Mon Sep 17 00:00:00 2001 From: Francisc Bungiu Date: Wed, 4 Jan 2023 08:16:58 -0800 Subject: [PATCH] Enable tf32 by default Summary: According to nvidia (https://fburl.com/bde4267e) TF32 has the same convergence-to-accuracy behavior as FP32, but is faster on A100 machines. Enable it by default for d2go. Differential Revision: D42312721 fbshipit-source-id: 6af09fa0134c64338ff737deacc46d8adbd5bdcd --- d2go/runner/default_runner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/d2go/runner/default_runner.py b/d2go/runner/default_runner.py index 35be2fec..3e8202de 100644 --- a/d2go/runner/default_runner.py +++ b/d2go/runner/default_runner.py @@ -526,7 +526,7 @@ def _get_model_with_abnormal_checker(model): _get_model_with_abnormal_checker(model), data_loader, optimizer ) - if cfg.SOLVER.AMP.ENABLED and torch.cuda.is_available(): + if torch.cuda.is_available(): # Allow to use the TensorFloat32 (TF32) tensor cores, available on A100 GPUs. # For more details https://pytorch.org/docs/stable/notes/cuda.html#tf32-on-ampere. torch.backends.cuda.matmul.allow_tf32 = True