"git@developer.sourcefind.cn:chenpangpang/ComfyUI.git" did not exist on "a3ba90d237eee1c094c10785b232deb0a7b4140c"
Unverified Commit 55bcd0cb authored by Bram Vanroy's avatar Bram Vanroy Committed by GitHub
Browse files

Raise error when using AMP on non-CUDA device (#7869)

* Raise error when using AMP on non-CUDA device

* make style

* make style
parent e3d2bee8
...@@ -351,6 +351,9 @@ class TrainingArguments: ...@@ -351,6 +351,9 @@ class TrainingArguments:
if self.run_name is None: if self.run_name is None:
self.run_name = self.output_dir self.run_name = self.output_dir
if self.device.type != "cuda" and self.fp16:
raise ValueError("AMP (`--fp16`) can only be used on CUDA devices.")
@property @property
def train_batch_size(self) -> int: def train_batch_size(self) -> int:
""" """
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment