allow experimental to override precision

This commit is contained in:
Vladimir Mandic
2023-05-28 07:46:47 -04:00
parent 851d129680
commit 9bf0b1ae1f
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -81,6 +81,8 @@ def torch_gc(force=False):
def test_fp16():
if shared.cmd_opts.experimental:
return True
try:
x = torch.tensor([[1.5,.0,.0,.0]]).to(device).half()
layerNorm = torch.nn.LayerNorm(4, eps=0.00001, elementwise_affine=True, dtype=torch.float16, device=device)
@@ -114,7 +116,7 @@ def set_cuda_params():
pass
global dtype, dtype_vae, dtype_unet, unet_needs_upcast # pylint: disable=global-statement
ok = test_fp16()
if shared.cmd_opts.use_directml: # TODO DirectML does not have full autocast capabilities
if shared.cmd_opts.use_directml and not shared.cmd_opts.experimental: # TODO DirectML does not have full autocast capabilities
shared.opts.no_half = True
shared.opts.no_half_vae = True
if ok and shared.opts.cuda_dtype == 'FP32':