Added automatic enabling of tensor cores

This commit is contained in:
2024-06-10 12:58:19 +01:00
parent 08fe32302c
commit 888fe9f2e8
3 changed files with 401 additions and 399 deletions

View File

@@ -27,6 +27,13 @@ def main(
bool, typer.Option(help="Whether or not to log via Weights & Biases")
] = True,
):
import torch
# Enable tensor cores for compatible GPUs
for i in torch.cuda.device_count():
if torch.cuda.get_device_properties(i).major > 6:
torch.set_float32_matmul_precision("medium")
for i, n in enumerate(experiments, start=1):
j = n - 1
experiment = EXPERIMENTS[j].run