FastGemmaModel

This commit is contained in:
Daniel Han-Chen 2024-02-23 02:05:31 +11:00
commit 76de9c1fe3
3 changed files with 4 additions and 4 deletions

View file

@ -90,8 +90,6 @@ class LoRA_MLP(torch.autograd.Function):
e = matmul_lora(X, gateW, gateW_quant, gateA, gateB, gateS)
g = matmul_lora(X, upW, upW_quant, upA, upB, upS)
# f = torch.nn.functional.silu(e)
# h = f * g
h = _forward_function(e, g)
i = matmul_lora(h, downW, downW_quant, downA, downB, downS)

View file

@ -891,9 +891,10 @@ class FastLlamaModel:
device_map = "sequential",
rope_scaling = None,
fix_tokenizer = True,
model_patcher = FastLlamaModel,
model_patcher = None,
**kwargs,
):
if model_patcher is None: model_patcher = FastLlamaModel
SUPPORTS_BFLOAT16 = torch.cuda.is_bf16_supported()
gpu_stats = torch.cuda.get_device_properties(0)
max_memory = round(gpu_stats.total_memory / 1024 / 1024 / 1024, 3)

View file

@ -293,9 +293,10 @@ class FastMistralModel(FastLlamaModel):
device_map = "sequential",
rope_scaling = None, # Mistral does not support RoPE scaling
fix_tokenizer = True,
model_patcher = FastMistralModel,
model_patcher = None,
**kwargs,
):
if model_patcher is None: model_patcher = FastMistralModel
# Mistral does NOT support RoPE Scaling!
if rope_scaling is not None:
logger.warning_once("Unsloth: Mistral models do not support RoPE scaling.")