by transcriptase · 3y ago · 0 comments
With text-to-image models I pick out software of my choice and drop a downloaded model into an input directory, then launch a GUI.
What is it about LLMs that makes actually being able to run them locally so complex in comparison?
I’m genuinely curious as a layman.
If you're not on a "happy path" of "ubuntu, nvidia, and anaconda," then lots of things could go wrong if you're configuring from scratch. If you want to run these models efficiently, hardware acceleration is a must, but managing the intersection between {GPU, operating system, architecture, Python version, Python virtualenv location} is tricky.
That's even before you deal with hardware-specific implementation details!
- Running NVidia? Double-check your CUDA library version, kernel module version, (optional) CuDNN, and pytorch version
- Running AMD? Double-check your ROCm library version, AMD drivers, and make sure that you use Pytorch provided by AMD with ROCm support
- On Apple machines? Double-check that your M1 hardware actually has proper hardware support, then download and install a custom Pytorch distribution linked with M1 support, and make sure that the numpy library version has been properly linked with Accelerate.framework or else your BLAS calls run on the CPU rather than the undocumented AMX coprocessor. If you want to run on the ANE, you'll additionally need a working xcode toolchain and a version of the CoreML model compiler that can read your serialized pytorch model files properly.
I think the pain of getting things working makes it easier to just throw up one's hands and pay someone else to run your model for you.
The hardware support should be amazing for this, given that the CPU and GPU share the same RAM.
I mostly end up running the CPU versions and grumbling about how slow they are.
I mean, caveat emptor; CoreML has been barebones for years, and Apple isn't exactly notorious for huge commitment to third party APIs. The writing was on the wall with how Metal was rolled out and how fast OpenCL got dropped, it honestly doesn't surprise me at all at this point. Even the current Apple Silicon support in llama.cpp is fudged with NEON and Metal Shaders instead of Apple's "Neural Engine".
I want to write instructions for people to use my software that don't expect them to know how to run make, or even to have a C compiler installed.
That means additional steps or alternative downloads are needed.
Also generative graphics models are about 6 months further advanced than generative text models because Stable Diffusion came out before Llama (Llama being the first "useful" smaller-large-language-model)