How to Accelerate Larger LLMs Locally on RTX With LM Studio
23/10/2024
Large language models (LLMs) are reshaping productivity. They're capable of drafting documents, summarizing web pages and, having been trained on vast quantities of data, accurately answering questions about nearly any topic.
LLMs are at the core of many emerging use cases in generative AI, including digital assistants, conversational avatars and customer service agents.
Many of the latest LLMs can run locally on PCs or workstations. This is useful for a variety of reasons: users can keep conversations and content private on-device, use AI without the internet, or simply take advantage of the powerful NVIDIA GeForce RTX GPUs in their system. Other models, because of their size and complexity, do no't fit into the local GPU's video memory (VRAM) and require hardware in large data centers.
However, Iit i's possible to accelerate part of a prompt on a data-center-class model locally on RTX-powered PCs using a technique called GPU offloading. This allows users to benefit from GPU acceleration without being as limited by GPU memory constraints.
Size and Quality vs. Performance There's a tradeoff between the model size and the quality of responses and the performance. In general, larger models deliver higher-quality responses, but run more slowly. With smaller models, performance goes up while quality goes down.
This tradeoff isn't always straightforward. There are cases where performance might be more important than quality. Some users may prioritize accuracy for use cases like content generation, since it can run in the background. A conversational assistant, meanwhile, needs to be fast while also providing accurate responses.
The most accurate LLMs, designed to run in the data center, are tens of gigabytes in size, and may not fit in a GPU's memory. This would traditionally prevent the application from taking advantage of GPU acceleration.
However, GPU offloading uses part of the LLM on the GPU and part on the CPU. This allows users to take maximum advantage of GPU acceleration regardless of model size.
Optimize AI Acceleration With GPU Offloading and LM Studio LM Studio is an application that lets users download and host LLMs on their desktop or laptop computer, with an easy-to-use interface that allows for extensive customization in how those models operate. LM Studio is built on top of llama.cpp, so it's fully optimized for use with GeForce RTX and NVIDIA RTX GPUs.
LM Studio and GPU offloading takes advantage of GPU acceleration to boost the performance of a locally hosted LLM, even if the model can't be fully loaded into VRAM.
With GPU offloading, LM Studio divides the model into smaller chunks, or subgraphs, which represent layers of the model architecture. Subgraphs aren't permanently fixed on the GPU, but loaded and unloaded as needed. With LM Studio's GPU offloading slider, users can decide how many of these layers are processed by the GPU.
LM Studio's interface makes it easy to decide how much of an LLM should be loaded to the GPU. For example, imagine using this GPU offloading technique with a large model like Gemma 2 27B. 27B refers to the number of parameters in the model, informing an estimate as to how much memory is required to run the model.
According to 4-bit quantization, a technique for reducing the size of an LLM without significantly reducing accuracy, each parameter takes up a half byte of memory. This means that the model should require about 13.5 billion bytes, or 13.5GB - plus some overhead, which generally ranges from 1-5GB.
Accelerating this model entirely on the GPU requires 19GB of VRAM, available on the GeForce RTX 4090 desktop GPU. With GPU offloading, the model can run on a system with a lower-end GPU and still benefit from acceleration.
The table above shows how to run several popular models of increasing size across a range of GeForce RTX and NVIDIA RTX GPUs. The maximum level of GPU offload is indicated for each combination. Note that even with GPU offloading, users still need enough system RAM to fit the whole model. In LM Studio, it's possible to assess the performance impact of different levels of GPU offloading, compared with CPU only. The below table shows the results of running the same query across different offloading levels on a GeForce RTX 4090 desktop GPU.
Depending on the percent of the model offloaded to GPU, users see increasing throughput performance compared with running on CPUs alone. For the Gemma 2 27B model, performance goes from an anemic 2.1 tokens per second to increasingly usable speeds the more the GPU is used. This enables users to benefit from the performance of larger models that they otherwise would've been unable to run. On this particular model, even users with an 8GB GPU can enjoy a meaningful speedup versus running only on CPUs. Of course, an 8GB GPU can always run a smaller model that fits entirely in GPU memory and get full GPU acceleration.
Achieving Optimal Balance LM Studio's GPU offloading feature is a powerful tool for unlocking the full potential of LLMs designed for the data center, like Gemma 2 27B, locally on RTX AI PCs. It makes larger, more complex models accessible across the entire lineup of PCs powered by GeForce RTX and NVIDIA RTX GPUs.
Download LM Studio to try GPU offloading on larger models, or experiment with a variety of RTX-accelerated LLMs running locally on RTX AI PCs and workstations.
Generative AI is transforming gaming, videoconferencing and interactive experiences of all kinds. Make sense of what's new and what's next by subscribing to the AI Decoded newsletter.
More from Nvidia
26/12/2024
Cheers to 2024: GeForce NOW Recaps Year of Ultimate Cloud Gaming
This GFN Thursday wraps up another incredible year for cloud gaming. Take a look back at the top games and new features that made 2024 a standout for GeForce NO...
24/12/2024
From Generative to Agentic AI, Wrapping the Year's AI Advancements
Editor's note: This post is part of the AI Decoded series, which demystifies AI by making the technology more accessible, and showcases new hardware, softwa...
19/12/2024
AI's in Style: Ulta Beauty Helps Shoppers Virtually Try New Hairstyles
Shoppers pondering a new hairstyle can now try styles before committing to curls or a new color. An AI app by Ulta Beauty, the largest specialty beauty retailer...
19/12/2024
NieR Perfect: GeForce NOW Loops Square Enix's NieR:Automata' and NieR Replicant ver.1.22474487139' Into the Cloud
Stuck in a gaming rut? Get out of the loop this GFN Thursday with four new games...
18/12/2024
AI at Your Service: Digital Avatars With Speech Capabilities Offer Interactive Customer Experiences
Editor's note: This post is part of the AI On blog series, which explores th...
18/12/2024
Imbue's Kanjun Qiu Shares Insights on How to Build Smarter AI Agents
Imagine a future in which everyone is empowered to build and use their own AI agents. That future may not be far off, as new software is infused with intelligen...
18/12/2024
NVIDIA Awards up to $60,000 Research Fellowships to PhD Students
For more than two decades, the NVIDIA Graduate Fellowship Program has supported graduate students doing outstanding work relevant to NVIDIA technologies. Today,...
17/12/2024
AI in Your Own Words: NVIDIA Debuts NeMo Retriever Microservices for Multilingual Generative AI Fueled by Data
In enterprise AI, understanding and working across multiple languages is no long...
17/12/2024
NVIDIA Unveils Its Most Affordable Generative AI Supercomputer
NVIDIA is taking the wraps off a new compact generative AI supercomputer, offering increased performance at a lower price with a software upgrade. The new NVID...
16/12/2024
Tech Leader, AI Visionary, Endlessly Curious Jensen Huang to Keynote CES 2025
On Jan. 6 at 6:30 p.m. PT, NVIDIA founder and CEO Jensen Huang - with his trademark leather jacket and an unwavering vision - will step onto the CES 2025 stage....
12/12/2024
Ready Player Fun: GFN Thursday Brings Six New Adventures to the Cloud
From heart-pounding action games to remastered classics, there's something for everyone this GFN Thursday. Six new titles join the cloud this week, startin...
11/12/2024
Driving Mobility Forward, Vay Brings Advanced Automotive Solutions to Roads With NVIDIA DRIVE AGX
Vay, a Berlin-based provider of automotive-grade remote driving (teledriving) te...
11/12/2024
Built for the Era of AI, NVIDIA RTX AI PCs Enhance Content Creation, Gaming, Entertainment and More
Editor's note: This post is part of the AI Decoded series, which demystifies...
11/12/2024
Into the Omniverse: How OpenUSD-Based Simulation and Synthetic Data Generation Advance Robot Learning
Editor's note: This post is part of Into the Omniverse, a series focused on ...
10/12/2024
AI Pioneers Win Nobel Prizes for Physics and Chemistry
Artificial intelligence, once the realm of science fiction, claimed its place at the pinnacle of scientific achievement Monday in Sweden. In a historic ceremon...
10/12/2024
Turn Down the Noise: CUDA-Q Enables Industry-First Quantum Computing Demo With Logical Qubits
Quantum computing has the potential to transform industries ranging from drug di...
09/12/2024
Crowning Achievement: NVIDIA Research Model Enables Fast, Efficient Dynamic Scene Reconstruction
Content streaming and engagement are entering a new dimension with QUEEN, an AI ...
06/12/2024
Thailand and Vietnam Embrace Sovereign AI to Drive Economic Growth
Southeast Asia is embracing sovereign AI. The prime ministers of Thailand and Vietnam this week met with NVIDIA founder and CEO Jensen Huang to discuss initiat...
05/12/2024
2025 Predictions: Enterprises, Researchers and Startups Home In on Humanoids, AI Agents as Generative AI Crosses the Chasm
From boardroom to break room, generative AI took this year by storm, stirring di...
05/12/2024
Stream Indiana Jones and the Great Circle' at Launch With RTX Power in the Cloud at up to 50% Off
GeForce NOW is wrapping a sleigh-full of gaming gifts this month, stuffing membe...
04/12/2024
NVIDIA NIM on AWS Supercharges AI Inference
Generative AI is rapidly transforming industries, driving demand for secure, high-performance inference solutions to scale increasingly complex models efficient...
03/12/2024
NVIDIA Advances Physical AI With Accelerated Robotics Simulation on AWS
Field AI is building robot brains that enable robots to autonomously manage a wide range of industrial processes. Vention creates pretrained skills to ease deve...
03/12/2024
Latest NVIDIA AI, Robotics and Quantum Computing Software Comes to AWS
Expanding what's possible for developers and enterprises in the cloud, NVIDIA and Amazon Web Services are converging at AWS re:Invent in Las Vegas this week...
03/12/2024
How AI Can Enhance Disability Inclusion, Special Education
A recent survey from the Special Olympics Global Center for Inclusion in Education shows that while a majority of students with an intellectual and developmenta...
03/12/2024
New NVIDIA Certifications Expand Professionals' Credentials in AI Infrastructure and Operations
As generative AI continues to grow, implementing and managing the right infrastr...
02/12/2024
Siemens Healthineers Adopts MONAI Deploy for Medical Imaging AI
3.6 billion. That's about how many medical imaging tests are performed annually worldwide to diagnose, monitor and treat various conditions. Speeding up th...
28/11/2024
Get the Power of GeForce-Powered Gaming in the Cloud Half Off With Black Friday Deal
Turn Black Friday into Green Thursday with a new deal on GeForce NOW Ultimate an...
27/11/2024
How RTX AI PCs Unlock AI Agents That Solve Complex Problems Autonomously With Generative AI
Editor's note: This post is part of the AI Decoded series, which demystifies...
26/11/2024
Taste of Success: Zordi Plants AI and Robotics to Grow Flavorful Strawberries Indoors
With startup Zordi, founder Gilwoo Lee's enthusiasm for robotics, healthy ea...
25/11/2024
Why Workforce Development Is Key to Reaping AI Benefits
AI is changing industries and economies worldwide. Workforce development is central to ensuring the changes benefit all of us, as Louis Stewart, head of strate...
25/11/2024
Now Hear This: World's Most Flexible Sound Machine Debuts
A team of generative AI researchers created a Swiss Army knife for sound, one that allows users to control the audio output simply using text. While some AI mo...
21/11/2024
Efficiency Meets Personalization: How AI Agents Improve Customer Service
Editor's note: This post is the first in the AI On blog series, which explores the latest techniques and real-world applications of agentic AI, chatbots and...
21/11/2024
First Star Wars Outlaws' Story Pack Hits GeForce NOW
Get ready to dive deeper into the criminal underworld of a galaxy far, far away as GeForce NOW brings the first major story pack for Star Wars Outlaws to the cl...
21/11/2024
Into the Omniverse: How Generative AI Fuels Personalized, Brand-Accurate Visuals With OpenUSD
Editor's note: This post is part of Into the Omniverse, a blog series focuse...
20/11/2024
The Need for Speed: NVIDIA Accelerates Majority of World's Supercomputers to Drive Advancements in Science and Technology
Starting with the release of CUDA in 2006, NVIDIA has driven advancements in AI ...
19/11/2024
AI at COP29: Balancing Innovation and Sustainability
As COP29 attendees gather in Baku, Azerbaijan, to tackle climate change, the role AI plays in environmental sustainability is front and center. A panel hosted ...
19/11/2024
How the Department of Energy's AI Initiatives Are Transforming Science, Industry and Government
The U.S. Department of Energy oversees national energy policy and production. As...
19/11/2024
Microsoft and NVIDIA Supercharge AI Development on RTX AI PCs
Generative AI-powered laptops and PCs are unlocking advancements in gaming, content creation, productivity and development. Today, over 600 Windows apps and gam...
19/11/2024
NVIDIA and Microsoft Showcase Blackwell Preview, Omniverse Industrial AI and RTX AI PCs at Microsoft Ignite
NVIDIA and Microsoft today unveiled product integrations designed to advance ful...
18/11/2024
From Algorithms to Atoms: NVIDIA ALCHEMI NIM Catalyzes Sustainable Materials Research for EV Batteries, Solar Panels and More
More than 96% of all manufactured goods - ranging from everyday products, like l...
18/11/2024
Foxconn Expands Blackwell Testing and Production With New Factories in U.S., Mexico and Taiwan
To meet demand for Blackwell, now in full production, Foxconn, the world's l...
18/11/2024
Hopper Scales New Heights, Accelerating AI and HPC Applications for Mainstream Enterprise Servers
Since its introduction, the NVIDIA Hopper architecture has transformed the AI an...
18/11/2024
NVIDIA Releases cuPyNumeric, Enabling Scientists to Harness GPU Acceleration at Cluster Scale
Whether they're looking at nanoscale electron behaviors or starry galaxies c...
18/11/2024
Faster Forecasts: NVIDIA Launches Earth-2 NIM Microservices for 500x Speedup in Delivering Higher-Resolution Simulations
NVIDIA today at SC24 announced two new NVIDIA NIM microservices that can acceler...
18/11/2024
AI Will Drive Scientific Breakthroughs, NVIDIA CEO Says at SC24
NVIDIA kicked off SC24 in Atlanta with a wave of AI and supercomputing tools set to revolutionize industries like biopharma and climate science. The announceme...
14/11/2024
From Seed to Stream: Farming Simulator 25' Sprouts on GeForce NOW
Grab a pitchfork and fire up the tractor - the fields of GeForce NOW are about to get a whole lot greener with Farming Simulator 25. Whether looking for a time...
14/11/2024
Open for Development: NVIDIA Works With Cloud-Native Community to Advance AI and ML
Cloud-native technologies have become crucial for developers to create and imple...
14/11/2024
NVIDIA Ranks No. 1 as Forbes Debuts List of America's Best Companies 2025
NVIDIA ranked No. 1 on Forbes magazine's new list - America's Best Companies - based on more than 60 measures in nearly a dozen categories that cover fi...
14/11/2024
Keeping an AI on Diabetes Risk: Gen AI Model Predicts Blood Sugar Levels Four Years Out
Diabetics - or others monitoring their sugar intake - may look at a cookie and w...
13/11/2024
Indonesia Tech Leaders Team With NVIDIA and Partners to Launch Nation's AI
Working with NVIDIA and its partners, Indonesia's technology leaders have launched an initiative to bring sovereign AI to the nation's more than 277 mil...