Skip to content

Commit

Permalink
Disable ipex env var if false (#24885)
Browse files Browse the repository at this point in the history
Disable ipex if in use
  • Loading branch information
muellerzr authored Jul 18, 2023
1 parent 07360b6 commit a982c02
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/transformers/training_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -1718,6 +1718,8 @@ def _setup_devices(self) -> "torch.device":
)
AcceleratorState._reset_state(reset_partial_state=True)
self.distributed_state = None
if not self.use_ipex and "ACCELERATE_USE_IPEX" not in os.environ:
os.environ["ACCELERATE_USE_IPEX"] = "false"
if self.use_cpu:
self.distributed_state = PartialState(cpu=True, backend=self.ddp_backend)
self._n_gpu = 0
Expand Down

0 comments on commit a982c02

Please sign in to comment.