You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@imrankh46 Ye smaller models can sometimes not follow instructions well. Could you approx give an example maybe to show Phi not following instructions?
@imrankh46 Ye smaller models can sometimes not follow instructions well. Could you approx give an example maybe to show Phi not following instructions?
@cm2435 Oh more than happy to collab if you're into it!! I actually took a look at Phi the other day:
Phi seems to not use swiglu but just general f(gate) @ down. Swiglu is (f(gate) * up) @ down. This does mean the Triton kernels backprop has to be derived.
Phi is using gelu instead of swish, and I think the first step is to derive the gradient for gelu. Gelu is f(x) = 0.5 * x* (1.0 + torch.tanh(math.sqrt(2.0 / math.pi) * (x+ 0.044715 * torch.pow(x, 3.0)))) Maybe using Desmos / hand derived
In general Phi is possible, just there are a few blockers - esp (2) and (3). But again - if you want to take a crack at this @cm2435 - I'll be super grateful + I'll collab with you! :) Possibly taking a stab at some steps like (2) finding the derivative might be better as a first step :)
@danielhanchen Started a fork and opened a staging PR to work off. I can start by adding some unit test coverage around the kernels if we need to test their accuracy, something simple like
asserttorch.allclose(triton_out, torch_out)
or I can try to contribute some of the other steps you mentioned- what's your preference?
Activity
danielhanchen commentedon Jan 12, 2024
@asmith26 On it! :)
Imran-tech-lab commentedon Jan 14, 2024
I tried, fine tuning of phi-2. Which is not good.
I just use hugging face transformer code not with unsloth..
danielhanchen commentedon Jan 15, 2024
@imrankh46 Ye smaller models can sometimes not follow instructions well. Could you approx give an example maybe to show Phi not following instructions?
Imran-tech-lab commentedon Jan 15, 2024
here is the code.
https://colab.research.google.com/drive/1a7rL3UzWfo5I7OPyVmTEnR6_tRqIOblg?usp=sharing
cm2435 commentedon Jan 16, 2024
@danielhanchen I'm also interesting in contributing this, let me know if you have space on your PR for another helping hand.
danielhanchen commentedon Jan 16, 2024
@cm2435 Oh more than happy to collab if you're into it!! I actually took a look at Phi the other day:
f(gate) @ down. Swiglu is(f(gate) * up) @ down. This does mean the Triton kernels backprop has to be derived.geluinstead ofswish, and I think the first step is to derive the gradient forgelu. Gelu isf(x) = 0.5 * x* (1.0 + torch.tanh(math.sqrt(2.0 / math.pi) * (x+ 0.044715 * torch.pow(x, 3.0))))Maybe using Desmos / hand derivedRMS Layernormthis means again new kernels have to be written - although I think Triton's tutorials has this already done for us: https://triton-lang.org/main/getting-started/tutorials/05-layer-norm.htmlpartial_rotary_factoris in https://huggingface.co/microsoft/phi-2/blob/main/config.json. Need to investigate.In general Phi is possible, just there are a few blockers - esp (2) and (3). But again - if you want to take a crack at this @cm2435 - I'll be super grateful + I'll collab with you! :) Possibly taking a stab at some steps like (2) finding the derivative might be better as a first step :)
cm2435 commentedon Jan 18, 2024
@danielhanchen Started a fork and opened a staging PR to work off. I can start by adding some unit test coverage around the kernels if we need to test their accuracy, something simple like
or I can try to contribute some of the other steps you mentioned- what's your preference?
danielhanchen commentedon Jan 27, 2024
@cm2435 Oh lmao just noticed i never responded on this thread WHOOPS! Well I responded on your other threads already I guess - sorry!!!
asmith26 commentedon Jun 20, 2024
I thought I'd close this as there are already some fantastic notebooks for finetuning phi-3 (many thanks!)
Merge pull request unslothai#85 from unslothai/fix/password-hint-length
Studio: MiniMax-H3-Image GGUFs on stable-diffusion.cpp, sd.cpp prebui…
Add test pinning gpt-oss developer block to openai-harmony (unslothai…