add cudaMallocAsync

This commit is contained in:
Vladimir Mandic
2024-05-16 18:02:55 -04:00
parent 199eca2133
commit d63f35e298
8 changed files with 37 additions and 30 deletions
+1 -4
View File
@@ -380,11 +380,8 @@ def randn_without_seed(shape):
return torch.randn(shape, device=cpu).to(device)
return torch.randn(shape, device=device)
def autocast(disable=False):
if disable:
return contextlib.nullcontext()
if dtype == torch.float32 or shared.cmd_opts.precision == "Full":
if disable or dtype == torch.float32 or shared.cmd_opts.precision == "Full":
return contextlib.nullcontext()
if shared.cmd_opts.use_directml:
return torch.dml.amp.autocast(dtype)