Update gemma2.py

This commit is contained in:
Daniel Han 2024-08-23 23:43:57 -07:00
commit e16fcd7d94

View file

@ -62,7 +62,7 @@ if HAS_FLASH_ATTENTION_SOFTCAPPING:
# [TODO] We must randomnly use torch.compile?
# I checked the gradients and formulas and I'm sure it's correct.
# I'm stumped :(
@torch.compile(fullgraph = True, dynamic = True, options = torch_compile_options)
@torch.compile(fullgraph = False, dynamic = True, options = torch_compile_options)
def fast_rms_layernorm_gemma2_compiled(layernorm, X, gemma = True):
old_dtype = X.dtype
X = X.float()