To reduce GPU memory use, first find out whether the pressure comes from model weights, the active workload, temporary attention allocations, another GPU process, or unused memory cached by the runtime. Then change one thing at a time: shorten the context, reduce the batch size, choose a smaller or quantized model, use a supported efficient-attention path, or offload some work to system RAM. The right fix depends on your model, backend, GPU, and whether you can accept slower output or a quality trade-off.
First identify what is using GPU memory
A high VRAM figure in a system monitor does not necessarily mean every byte is occupied by live model data. In PyTorch, memory_allocated() reports memory held by live tensors, while memory_reserved() reports memory managed by its caching allocator. Reserved memory can include unused blocks kept for reuse; it may appear occupied to external monitoring even when those blocks are not holding active tensors.
For a PyTorch workload, compare current and peak values while reproducing the memory problem:
import torch
print("allocated:", torch.cuda.memory_allocated())
print("reserved:", torch.cuda.memory_reserved())
print("peak allocated:", torch.cuda.max_memory_allocated())
print("peak reserved:", torch.cuda.max_memory_reserved())
Use memory_stats() or memory_snapshot() if you need to investigate allocator behavior in more detail. Also check which processes are using the GPU, and close applications you do not need. If another process accounts for the pressure, changing the model may not be the best first fix.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
What empty_cache() can and cannot do
torch.cuda.empty_cache() releases unused cached blocks so other GPU applications can use them. It does not free memory held by live tensors, and it does not create more room for those tensors inside PyTorch. Use it when unused cached memory is the issue, not as a substitute for reducing the model or workload.
Choose a change that addresses the memory pressure
| Change | Memory pressure it addresses | Main trade-off or condition |
|---|---|---|
| Shorten context or reduce batch size | Active workload and runtime memory | Less context or fewer simultaneous items; exact savings depend on the model and runtime. |
| Use a smaller model or checkpoint | Model weights and workload | Different capability or output quality may be acceptable or necessary. |
| Quantize weights or the KV cache | Weights, or KV-cache memory when that cache is quantized | Quality, speed, supported formats, and backend compatibility vary. |
| Use an efficient attention implementation | Temporary attention allocations | Lower-memory kernels are only used when supported by the installed stack and workload. |
| Offload or stream weights | GPU-resident model data | Requires more system RAM and can add latency; support is runtime-specific. |
Reduce the workload before tuning the runtime
Shorten the context and reduce the batch
Try a shorter prompt or context window and, where the application exposes the setting, a smaller batch. These changes reduce the active workload rather than changing the model’s stored weight representation. The size of the saving depends on the architecture, sequence length, and runtime, so measure with your actual prompt and generation settings.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Choose a smaller model when needed
If the model’s weights leave too little room for the workload, choose a smaller model or checkpoint suited to your target VRAM and performance needs. NVIDIA’s backend-specific starting suggestions include Q4_K_M checkpoints for llama.cpp and NVFP4 for vLLM or PyTorch. Confirm that the model format, quantization, GPU, and installed runtime work together; a format recommendation is not a guarantee of compatibility or a particular memory saving.
Use quantization with the right expectations
Quantization stores values in a more compact representation. Weight quantization can reduce weight memory; quantizing the KV cache can reduce cache memory. Do not assume that quantizing weights also quantizes the KV cache: these are separate choices and may have separate support in your application.
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Quality and speed can change. PyTorch Foundation notes that quantizing some layers can make them slower because of overhead, and warns that post-training quantization below 4-bit can cause serious accuracy loss. Test output quality and speed on your own task rather than treating a lower bit width as an automatic improvement.
Published results illustrate why the tested configuration matters. In a PyTorch Foundation report dated September 26, 2024, quantized KV cache reduced peak VRAM by 73% for Llama 3.1 8B inference at a 128K context length. That result is for that model, context, and method—not a general estimate for other local workloads. The same report describes a 97% inference speedup for Llama 3 8B using autoquant with int4 weight-only quantization and HQQ; that is a speed result, not a general VRAM-reduction figure. It also reports 30% lower peak VRAM for Llama 3 8B using 4-bit quantized optimizers, a training-related result rather than a recommendation for ordinary inference.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Try efficient attention if your stack supports it
Attention can create large temporary allocations, particularly as sequence length grows. PyTorch’s scaled-dot-product attention (SDPA) may dispatch to flash or memory-efficient attention implementations. For the implementation described by PyTorch, memory-efficient attention changes the attention intermediate’s allocation complexity from O(N²) in the traditional eager path to O(N). This describes that intermediate, not total model memory or a guaranteed reduction for every workload.
Kernel dispatch depends on the GPU, input shapes, and implementation support. Hardware, custom masks, head dimensions, and software version can affect whether a fused path is available. Check what your installed stack actually selects instead of assuming that enabling SDPA means a lower-memory kernel is running.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Consider CPU offloading only when GPU-side changes are not enough
Offloading moves some memory demand from VRAM to system RAM. It can make a model fit, but it is not a universal switch shared by all local inference apps, and transfers between CPU and GPU can affect performance.
Torch-TensorRT options
Torch-TensorRT documents CPU offloading during compilation, runtime weight streaming with a device-memory budget, and dynamic allocation for concurrent compiled models. Its v2.12.0 resource guidance says default compilation may consume up to 2× the model size in GPU memory; for the described compilation behavior, CPU offloading can lower that stated peak to about 1× model size while adding a model copy to CPU memory. These figures concern Torch-TensorRT compilation, not all inference runtimes.
Torch-TensorRT also says dynamic allocation can reduce peak GPU memory for concurrent compiled models at the cost of slightly higher per-call latency. Consider these features when you use Torch-TensorRT and have sufficient system RAM; do not look for a similarly named setting in another application unless that runtime documents it.
Apply changes in a controlled order
- Record a baseline. Use the same model, prompt and context length, batch size, and generation settings each time. Note peak GPU memory and either latency or tokens per second, along with whether the output remains suitable for your task.
- Check competing GPU use. Identify other GPU-heavy processes and close unnecessary ones. In PyTorch, compare allocated and reserved memory and inspect peak values; use allocator statistics or a memory snapshot if the difference needs investigation.
- Lower the active workload. Test a shorter context or smaller batch, changing one setting at a time so you can see which change helps.
- Change model size or representation. Try a smaller checkpoint or a supported quantized format. Verify compatibility with your GPU and backend, then check both output quality and performance.
- Check attention dispatch. If your PyTorch workload uses SDPA, establish whether a fused, lower-memory implementation is supported and selected for your hardware and input shapes.
- Offload only if necessary. For a runtime that documents offloading or weight streaming, check its system-RAM requirements and measure the latency cost.
- Compare results with the baseline. Keep the changes that solve the memory problem without unacceptable quality or speed loss. Do not extrapolate a published percentage from a different model, context, or backend.
When software changes are not enough
If the model and workload still exceed available VRAM after appropriate configuration changes, the remaining options are a smaller workload, a different model or runtime, offloading where supported, or hardware with more VRAM. Any hardware choice also needs to be compatible with the model software and fit the available budget; there is no universally suitable GPU recommendation for an unspecified workload.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

