Skip to content

Commit 2ce86d9

Browse files
committed
Convert: Warn if TORCH_ALLOW_TF32_CUBLAS_OVERRIDE is set during conversion
1 parent 4356527 commit 2ce86d9

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

exllamav3/conversion/convert_model.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,18 @@
5151

5252
num_ref_states = 5
5353

54+
def check_system():
55+
print("asdasdasd")
56+
if os.environ.get("TORCH_ALLOW_TF32_CUBLAS_OVERRIDE") is not None:
57+
print(
58+
"\n"
59+
f" !! {col_red}IMPORTANT: The environment variable TORCH_ALLOW_TF32_CUBLAS_OVERRIDE is set!{col_default}\n"
60+
f" !! {col_red}This causes Torch to run in reduced precision mode, which is likely to cause this "
61+
f"script to fail or result in broken models.{col_default}\n"
62+
"\n"
63+
)
64+
65+
5466
def save_dict(filename, dict_, args):
5567
path = os.path.join(args["work_dir"], filename)
5668
with open(path, "w", encoding = "utf8") as f:
@@ -104,6 +116,8 @@ def prepare_env(args):
104116

105117

106118
def prepare(args) -> (dict, dict, bool, str):
119+
check_system()
120+
107121
if not args.work_dir:
108122
return None, None, False, "Must specify --work_dir"
109123
if not args.in_dir and not args.resume:

0 commit comments

Comments
 (0)