News for hackers. Stuff that matters.
Re:Facebook LLAMA is being openly distributed via torrents by underlines on Friday March 03, 2023 @10:07AM (#35010548)
- how much vRAM needed to run each model parameter size?

- any inference optimization we can use similar to StableDiffusion, to bring down the vRAM requirements?

I only know about these:

- use 8bit precision

- https://github.com/bigscience-workshop/petals

- https://github.com/FMInference/FlexGen

- https://github.com/microsoft/DeepSpeed

Anything that could bring this to a 10GB 3080 or 24GB 3090 without 60s/it per token?

Re:Facebook LLAMA is being openly distributed via torrents by joker99 on Friday March 03, 2023 @10:38AM (#35010985)
If I may tack on a question as someone with zero clue of ML: when, if ever, will someone like me be able to run this on a Mac Studio with a M1 Ultra and 128GB of ram?
Re:Facebook LLAMA is being openly distributed via torrents by terafo on Friday March 03, 2023 @10:57AM (#35011249)
As far as I can tell you can do it right now, at least for small 13B model, not sure about bigger models.
Re:Facebook LLAMA is being openly distributed via torrents by eightysixfour on Friday March 03, 2023 @12:42PM (#35012737)
I don't believe they could, need CUDA and more VRAM...
Re:Facebook LLAMA is being openly distributed via torrents by terafo on Friday March 03, 2023 @02:07PM (#35013690)
128 gigs is more than enough to load 13B model into. Pytorch has M1 support for some time now so CUDA isn't required.
Re:Facebook LLAMA is being openly distributed via torrents by eightysixfour on Friday March 03, 2023 @02:30PM (#35013947)
Does M1 use system memory as VRAM as well?
Re:Facebook LLAMA is being openly distributed via torrents by jml7c5 on Friday March 03, 2023 @03:16PM (#35014478)
Yes, it's all unified memory.

As much as I dislike the loss of socketed RAM, I have to say it's working out well for Apple users so far. I wonder if CXL will change the situation for consumer devices or if it will only be useful at the scale of a server rack.

Re:Facebook LLAMA is being openly distributed via torrents by MacsHeadroom on Saturday March 04, 2023 @09:25PM (#35026423)
13B fits on a single 3090 (24GB) in int8.

128 gigs might even be enough for 65B, if slowly.

Re:Facebook LLAMA is being openly distributed via torrents by TaylorAlexander on Friday March 03, 2023 @01:59PM (#35013612)
The 13B parameter model is two 13.5GB chunks, but the 7B parameter model is one 13.5GB chunk so that one might be possible.

EDIT: There seems to be a lot of overhead. Here someone struggles to fit the 7B parameter model (13.5GB checkpoint) on a 24GB card: https://github.com/facebookresearch/llama/issues/55

Re:Facebook LLAMA is being openly distributed via torrents by MacsHeadroom on Saturday March 04, 2023 @09:23PM (#35026415)
You can run 7B (equal to GPT-3 175B), 13B (better than GPT-3 175B), or 30B (better than anything else publicly available) but probably not 65B with that much RAM on an M1.

That would be using the CPU, as the M1 GPU is not yet supported.

Re:Facebook LLAMA is being openly distributed via torrents by TaylorAlexander on Friday March 03, 2023 @01:59PM (#35013604)
The checkpoint for the 7B parameter model is 13.5GB, so maybe? Larger models are multiple chunks at 13.6GB each or 16.3GB each. I am hoping I will be able to run on my 16GB Vram but I don't know how much overhead is needed. Maybe people on reddit will do their tricks and squeeze the models in to smaller cards.

EDIT: There seems to be a lot of overhead. Here someone struggles to fit the 7B parameter model (13.5GB checkpoint) on a 24GB card: https://github.com/facebookresearch/llama/issues/55

Re:Facebook LLAMA is being openly distributed via torrents by TaylorAlexander on Friday March 03, 2023 @04:06PM (#35014982)
Following up. After rebooting in to GUI that was enough to get it to fit, I guess xorg just accumulated some cruft in my last boot. So I can run it alongside gnome.

nvidia-smi reports this model is using 15475MiB after changing the max batch size from 32 to 8 (see link in above post)

As others have stated someone may have injected unknown code in to the pickled checkpoint, so I recommend running this in docker. I use this command to run the docker image after getting nvidia docker stuff configured.

docker run --runtime=nvidia -it --mount type=bind,source=/MY_LLAMA_SOURCE_PATH,target=/llama --gpus all nvidia/cuda:11.6.2-base-ubuntu20.04

Then install the necessary dependencies in that container (obv could make a dockerfile), stick your model as well as tokenizer files (from the root dir in download) in to some directory (here models/LLaMA-7B) and run this:

torchrun example.py --ckpt_dir ./models/LLaMA-7B --tokenizer_path ./models/LLaMA-7B/tokenizer.model

enjoy! the 7B parameter model is not amazing from my initial testing. I am very curious if larger models can be run on 1 GPU by sequentially loading checkpoints. I don't know how all this stuff is organized.

Example output below.

Prompt:

Please respond to this question: As a large language model, what are three things that you find most important?

Output:

To get students to analyze what they are doing in their learning

To get students to analyze what they are doing in their learning so that they can find the best practices

To get students to analyze what they are doing in their learning so that they can find the best practices and then to make changes to those practices so that they can improve their learning

To get students to analyze what they are doing in their learning so that they can find the best practices and then to make changes to those practices so that they can improve their learning

I don't think this question really made much sense because the sentence in the question is incomplete

To get students to analyze what they are doing in their learning so that they can find the best practices and then to make changes to those practices so that they can improve their learning

I don't think this question really made much sense because the sentence in the question is incomplete.

I think this question is in fact a good question, even though the initial sentence is incomplete, and I do think it makes sense.

I think this question is in fact a good question, even though the initial sentence is incomplete, and I do think it makes sense. (I think it is a good question but I am not sure it makes sense).

Re:Facebook LLAMA is being openly distributed via torrents by byteknight on Friday March 03, 2023 @04:31PM (#35015312)
Looks like you need multiple GPUs for anything >7B.

https://github.com/facebookresearch/llama/issues/55#issuecom...

Re:Facebook LLAMA is being openly distributed via torrents by markasoftware on Friday March 03, 2023 @07:38PM (#35016915)
I was able to run 7B on a CPU, inferring several words per second: https://github.com/markasoftware/llama-cpu
Re:Facebook LLAMA is being openly distributed via torrents by TaylorAlexander on Friday March 03, 2023 @07:51PM (#35016995)
nice!
Re:Facebook LLAMA is being openly distributed via torrents by jpieper on Friday March 03, 2023 @10:32PM (#35017881)
Beginner pytorch user here... it looks like it is using only one CPU on my machine. Is it feasible to use more than one? If so, what options/env vars/code change are necessary?
Re:Facebook LLAMA is being openly distributed via torrents by markasoftware on Saturday March 04, 2023 @12:50AM (#35018559)
Perhaps try setting `OMP_NUM_THREADS`, for example `OMP_NUM_THREADS=4 torchrun ...`.

But on my machine, it automatically used all 12 available physical cores. Setting OMP_NUM_THREADS=2 for example lets me decrease the number of cores being used, but increasing it to try and use all 24 logical threads has no effect. YMMV.