5 ms·
Performance of llama.cpp on Apple Silicon A-series
- yieldcrv 3y agolove that, I’ve been using Mistral 7B on my M1 and I thought it was tolerable but turned out I wasnt utilizing Metal and now its amazing 8x7B nowadays As long as metal is used on an iphone I could see it worked well too. I use quantize 5 on my laptop but quantize 4 seems very practical
- zakki 3y agoHow do you use 8x7B?
- alberth 3y agoWhat did you do to enable Metal?
- yieldcrv 3y agoI use LM Studio and 0.2.9 now has a checkmark for it
- addandsubtract 3y agoHow much RAM do you have? Ollama comes with a note: "this model requires 48GB of RAM".
- moneywoes 3y agocould you please eli5 how metal works
- yieldcrv 3y agoits just a co-processor included in Apple devices that has relevant components of a GPU, can accelerate graphics and general computation tasks Apple’s chip architecture has a variety of co-processors alongside the CPU that make it the most perfect for transformers, in a convenient laptop form factor with fanless heat dissipation and low energy footprint
- cgearhart 3y agoWhat’s the definition of “prompt processing” vs “token generation”? Is that separately comparing the time it takes to preprocess the input prompt (prompt_length / pp_token_rate = time_to_first_token) and then the token generation rate is the time for each successive token? I also see something about bs batch size. Is batching relevant for a locally run model? (Usually you only have one prompt at a time, right?)
- discobot 3y agoregarding the prompt processing and token generation you are correct it makes sense to benchmark them infependently since prompt processing is done in parralel for each token and is compute bound and token generation is sequential and bound by memory banwidth
- idonotknowwhy 3y agoYeah prompt processing is tokenizing the input, which includes the system prompt, chat history and your chat text. Generation is the response it sends back
- andy99 3y agoIt says at the top that prompts are processed with a batch size of 512, while new tokens can only be generated one at a time with batch size of 1. Prompt processing doesn't actually need to compute logits for each new token, just cache the KV values and so is much faster than actual inference.
- deleted 3y ago[deleted]
- eminence32 3y agoI've been playing around a lot with llama.cpp recently, and it's making me re-think my predictions for the future... Given how big these models are (and the steep cost for GPUs to load them), I had been thinking that most people would interact with them via some hosted API (like what openAI is offering) or via some product like Bard or Copilot which offload inference to some big cloud datacenter. But given how well some of these models perform on the CPU when quantized down to 4, 6, or 8 bits, I'm starting to think that there will be quite a few interesting applications for fully local inference on relatively modest hardware
- minimaxir 3y agoThe model running well is only one constraint for consumer adoption. The other ones, namely RAM and making the CPU super warm and rapidly draining battery, are another which is much harder to solve.
- falcor84 3y agoI'm somewhat bullish on the Edge Computing approach to this. For example, how about a co-op neighborhood LLM rack?
- alberth 3y agoHow is “Edge Computing” any different than what the GP was stating about current cloud hosted (eg OpenAI)?
- falcor84 3y agoThere are different possible approaches here, but for me, the main benefit would be of having control over the model(s) used. Other than that, low latency would be crucial for effective voice interaction.
- sho_hn 3y agoI currently use a TrueNAS as my home server, and I'm sure whatever I replace it with will add HW for local inference and act as my Home Brain for various automations and assistants.
- carterschonwald 3y agoLlama.cpp and other “inference at the edge” tools are a really amazing pieces of engineering.
- andy99 3y agoI agree of course though I also think there is/was a lot of "low hanging fruit" in inference. Pytorch is really a model training framework and pytorch/python have not traditionally been well suited to fast inference, e.g. with lacking quantization but also lacking optimized inference code. That's changing, for example this recent post: https://pytorch.org/blog/accelerating-generative-ai-2/ https://pytorch.org/blog/accelerating-generative-ai-2/ But "AI" is still very research focused (training) and not application focused (inference). Llama.cpp et al are filling in this gap.
- carterschonwald 3y agoI honestly would love to full time focus on making high performance tools for ml / applied math, but its a hard area to break into, or at least I’ve been going about it wrong.
- Havoc 3y agoApples stinginess with Ram in phones may come back to bite them on LLMs
- saurik 3y agoI would think the opposite would happen, as they'll be very excited by people having to buy entirely new phones just to use LLMs ;P.
- m3kw9 3y agoTesting performance of LLM without testing the quality isn’t really practical in real world because of its fast and output is gibrish it won’t matter. There should be 10-20 input and output that is tested for correctness or something in addition to t/s as a reference
- johnklos 3y agoWhat's interesting is how there's so much emphasis on high end video cards which are prohibitively expensive for most people, yet many of the newer models, when quantized, run perfectly well on CPUs. Instead of chasing speed with money, seeing what can run decently on available hardware will end up having a much bigger potential impact on a greater number of people. As an experiment, I've been running llama.cpp on an old 2012 AMD Bulldozer system, which most people consider to be AMD's equivalent of Intel's Pentium 4, with 64 gigs of memory, and with newer models it's surprisingly usable, if not entirely practical. It's much more usable, in my opinion, than spending energy trying to get everything to fit in to more modest GPUs' smaller amounts of VRAM. It certainly shows that people shouldn't be dissuaded from playing around just because they have an older GPU and/or a GPU without much VRAM.