Skip to content

Commit

Permalink
Merge pull request #7 from abhilash1910/patch-5
Browse files Browse the repository at this point in the history
Fix precision device
  • Loading branch information
jingxu10 committed Oct 31, 2023
2 parents 1b90607 + 893b654 commit 5bfb98a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ def _check_and_init_precision(self) -> PrecisionPlugin:
rank_zero_info(
f"Using {'16bit' if self._precision_flag == '16-mixed' else 'bfloat16'} Automatic Mixed Precision (AMP)"
)
device = "cpu" if self._accelerator_flag == "cpu" else "cuda"
device = "cpu" if self._accelerator_flag == "cpu" else "xpu" if _lightning_xpu_available() else "cuda"
return MixedPrecisionPlugin(self._precision_flag, device) # type: ignore[arg-type]

raise RuntimeError("No precision set")
Expand Down

0 comments on commit 5bfb98a

Please sign in to comment.