Lurker News
I've been playing around with https://github.com/zphang/minimal-llama/ and https://github.com/tloen/alpaca-lora/blob/main/finetune.py, and wanted to create a simple UI where you can just paste text, tweak the parameters, and finetune the model quickly using a modern GPU.

To prepare the data, simply separate your text with two blank lines.
There's an inference tab, so you can test how the tuned model behaves.
This is my first foray into the world of LLM finetuning, Python, Torch, Transformers, LoRA, PEFT, and Gradio.
Enjoy!

Comments (98) 20 threads

Show all comments

Showing thread 5 of 20

Taek5 replies#
Looks like you need about 120 GB to fine-tune the 65B model with this code at a sequence length of 512. How does the memory usage scale as the sequence length grows?
lxe1 reply#
> How does the memory usage scale as the sequence length grows?

That's a good question. I was under the assumption it's linearly proportional, but I can test it out I guess.

Taek#
I suspect its linear with a small constant factor.
arpowers1 reply#
Really takes that much vram??
ioedward#
Normally people split up the model across multiple GPUs, i.e. model/tensor parallelism.
albertzeyer#
The attention implementation is in a way that the memory scales quadratically with sequence lengths. Overall, this is still a small factor compared to just the model weights, but at some seq lengths, this would dominate.

By using flash attention, you can get memory requirement down to scale linearly with sequence lengths.

joshxyz#
man i hope there are online calculators that lets people visualize the costs of training these things.