This commit is contained in:
Daniel Han 2025-03-19 08:27:36 -07:00
commit 656b15dbc3
2 changed files with 2 additions and 1 deletions

View file

@ -1210,6 +1210,7 @@ def unsloth_compile_transformers(
# Redo patches which override compiler
for temporary_patch in TEMPORARY_PATCHES:
temporary_patch()
print(os.environ["UNSLOTH_FORCE_FLOAT32"])
return model_types
pass

View file

@ -648,7 +648,6 @@ class FastModel(FastBaseModel):
do_forced_float32 = False
model_type_arch = model_types[1]
global FORCE_FLOAT32
print(model_type_arch, FORCE_FLOAT32, dtype)
for disable_name in FORCE_FLOAT32:
if (disable_name.lower() == model_type_arch.lower() or \
disable_name.lower() in model_name.lower()) and \
@ -657,6 +656,7 @@ class FastModel(FastBaseModel):
dtype = torch.bfloat16 # Change to bfloat16 loading
break
pass
print(model_type_arch, FORCE_FLOAT32, dtype, os.environ["UNSLOTH_FORCE_FLOAT32"])
# Patch gradient checkpointing
if use_gradient_checkpointing == "unsloth":
patch_unsloth_smart_gradient_checkpointing(dtype = dtype)