Disable ipex env var if false (#24885)

Disable ipex if in use
This commit is contained in:
Zach Mueller 2023-07-18 16:07:02 -04:00 committed by GitHub
parent 07360b6c9c
commit a982c0225e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1718,6 +1718,8 @@ class TrainingArguments:
)
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