Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
regisss committed Nov 24, 2023
1 parent 690201e commit d817217
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
10 changes: 1 addition & 9 deletions optimum/habana/diffusers/pipelines/pipeline_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import inspect
import os
import sys
import tempfile
from typing import Optional, Union

import torch
Expand Down Expand Up @@ -117,14 +116,7 @@ def __init__(
)
self.gaudi_config.use_torch_autocast = False
else:
with tempfile.NamedTemporaryFile() as autocast_bf16_file:
with tempfile.NamedTemporaryFile() as autocast_fp32_file:
self.gaudi_config.write_bf16_fp32_ops_to_text_files(
autocast_bf16_file.name,
autocast_fp32_file.name,
)
os.environ["LOWER_LIST"] = str(autocast_bf16_file)
os.environ["FP32_LIST"] = str(autocast_fp32_file)
self.gaudi_config.declare_autocast_bf16_fp32_ops()

# Workaround for Synapse 1.11 for full bf16 and Torch Autocast
if bf16_full_eval or self.gaudi_config.use_torch_autocast:
Expand Down
1 change: 0 additions & 1 deletion optimum/habana/transformers/gaudi_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ def declare_autocast_bf16_fp32_ops(self):
self.write_bf16_fp32_ops_to_text_files(
autocast_bf16_filename,
autocast_fp32_filename,
autocast=True,
)
os.environ["LOWER_LIST"] = autocast_bf16_filename
os.environ["FP32_LIST"] = autocast_fp32_filename

0 comments on commit d817217

Please sign in to comment.