Ask HN: What's the best hardware to run small/medium models locally?
11–20 of 99 posts
Re: Ask HN: What's the best hardware to run small/medium models locally?
#12Just run them on AWS
Re: Ask HN: What's the best hardware to run small/medium models locally?
#131) What are you trying to do?
2) What's your budget?
Generically saying, "run inference" is like... you can do that on your current thinkpad, if you want a small enough model. If you want to run 7B or 13B or 34B models for document or sentiment analysis, or whatever, then you can move to the budget question.
When I was faced with this question, I bought the cheapest 4060 Ti with 16GB I could find. It does "okay". Here's an example run:
Llama.generate: prefix-match hit
llama_print_timings: load time = 627.53 ms
llama_print_timings: sample time = 415.30 ms / 200 runs ( 2.08 ms per token, 481.58 tokens per second)
llama_print_timings: prompt eval time = 162.12 ms / 62 tokens ( 2.61 ms per token, 382.44 tokens per second)
llama_print_timings: eval time = 8587.32 ms / 199 runs ( 43.15 ms per token, 23.17 tokens per second)
llama_print_timings: total time = 9498.89 ms
Output generated in 9.79 seconds (20.43 tokens/s, 200 tokens, context 63, seed 1836128893)
I'm using the text-generation-webui to provide the OpenAI API interface. It's pretty easy to hit: import os
import openai
url = "http://localhost:7860/v1"
openai_api_key = os.environ.get("OPENAI_API_KEY")
client = openai.OpenAI(base_url=url, api_key=openai_api_key)
result = client.chat.completions.create(
model="wizardlm_wizardcoder-python-13b-v1.0",
messages = [
{"role":"system", "content":"You are a helpful AI agent. You are honest and truthful"},
{"role":"user", "content": "What is the best approach when writing recursive functions?"},
]
print(result)
But again, it just depends on what you want to do.Re: Ask HN: What's the best hardware to run small/medium models locally?
#14Nvidia GPU's are really your only choice. There is no framework as mature as CUDA and nvidia has been making the fastest hardware for decades. They know their stuff when it comes to architecture, so its unlikely that the hot new thing will actually be able to compete.
Re: Ask HN: What's the best hardware to run small/medium models locally?
#15Re: Ask HN: What's the best hardware to run small/medium models locally?
#16Nvidia GPU's are really your only choice. There is no framework as mature as CUDA and nvidia has been making the fastest hardware for decades. They know their stuff when it comes to architecture, so its unlikely that the hot new thing will actually be able to compete.
Re: Ask HN: What's the best hardware to run small/medium models locally?
#17I don't want to derail the OP's question, but would the same kind of system to run an LLM on also be suitable for an image generator like Stable Diffusion or does it work through different methods?
Re: Ask HN: What's the best hardware to run small/medium models locally?
#18Re: Ask HN: What's the best hardware to run small/medium models locally?
#19Of course with those you'll also have to spend some money on motherboard, ram, SSD, PSU, CPU, ect.
I think the best bang for the buck is probably a Mac studio with as much ram as you can afford.
I bought an RTX A2000 (12GB VRAM), and it's fine for 7B models and some 13B models with 4 bit quantization, but I kind of regret not getting something with more VRAM.
Re: Ask HN: What's the best hardware to run small/medium models locally?
#20Nvidia GPU's are really your only choice. There is no framework as mature as CUDA and nvidia has been making the fastest hardware for decades. They know their stuff when it comes to architecture, so its unlikely that the hot new thing will actually be able to compete.
Unless you use linux, where the quality of Nvidia support continues to decline.