From eea5304807c6a04d0f2c55cb935ec295235d9b54 Mon Sep 17 00:00:00 2001 From: Nadav Elyahu <88962733+nelyahu@users.noreply.github.com> Date: Fri, 20 Dec 2024 07:13:46 +0200 Subject: [PATCH] hpu_accelerator: use torch.use_deterministic_algorithms (#6897) formal API instead of hpu.setDeterministic --- accelerator/hpu_accelerator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accelerator/hpu_accelerator.py b/accelerator/hpu_accelerator.py index 723a66e4c6fb..b46351f8ca43 100644 --- a/accelerator/hpu_accelerator.py +++ b/accelerator/hpu_accelerator.py @@ -21,8 +21,8 @@ def __init__(self): self.apply_hpu_workarounds() try: import habana_frameworks.torch.hpu as hpu - hpu.setDeterministic(True) self.hpu = hpu + torch.use_deterministic_algorithms(True) except ImportError as e: raise ValueError( f"HPU_Accelerator requires habana_frameworks.torch.hpu, which is not installed on this system.")