<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Partionining NON-MIG GPUs]]></title><description><![CDATA[Partionining NON-MIG GPUs]]></description><link>https://partitioning-gpu.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 19:02:17 GMT</lastBuildDate><atom:link href="https://partitioning-gpu.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Why Partitioning VRAM on Non-MIG GPUs Matters More Than Ever (and How to Actually Do It)]]></title><description><![CDATA[Most GPUs can’t multitask well due to non-MIG limitations. This article breaks down how VRAM partitioning improves stability, enables multi-tenant…]]></description><link>https://partitioning-gpu.hashnode.dev/why-partitioning-vram-on-non-mig-gpus-matters-more-than-ever-and-how-to-actually-do-it</link><guid isPermaLink="true">https://partitioning-gpu.hashnode.dev/why-partitioning-vram-on-non-mig-gpus-matters-more-than-ever-and-how-to-actually-do-it</guid><category><![CDATA[MIG]]></category><category><![CDATA[GPU]]></category><category><![CDATA[partition]]></category><dc:creator><![CDATA[Sudip Das]]></dc:creator><pubDate>Tue, 09 Dec 2025 18:25:56 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1765304039137/a14701dc-80eb-4df8-bc39-7fbabed802fa.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Modern GPUs are rarely dedicated to a single workload.<br />In real production and even personal environments, <strong>one GPU often runs multiple tasks at the same time</strong>, such as:</p>
<ul>
<li><p>An LLM serving interactive inference</p>
</li>
<li><p>An embedding pipeline powering semantic search</p>
</li>
<li><p>OCR or document AI jobs</p>
</li>
<li><p>Fine-tuning or continual learning</p>
</li>
<li><p>Background evaluation or batching tasks</p>
</li>
</ul>
<p>And with the rise of compute marketplaces, GPU-sharing platforms, and custom scheduling systems, you can even <strong>rent out your idle GPU time</strong> to solve compute jobs and earn revenue in platforms like <a target="_blank" href="https://salad.com/">Salad</a>.</p>
<p>This operational model only works efficiently if GPUs are used to their fullest potential — and that’s where VRAM partitioning becomes crucial.</p>
<p>Before we dive into the technical methods, let’s look at a real-world example that demonstrates why VRAM partitioning is not just useful, but <strong>economically important</strong>.</p>
<hr />
<h1 id="heading-1-a-real-world-example-how-vram-partitioning-directly-impacts-utilization-and-revenue"><strong>1. A Real-World Example: How VRAM Partitioning Directly Impacts Utilization and Revenue</strong></h1>
<p>Consider a setup where unused GPU systems are rented out to run <strong>medium-heavy compute jobs</strong> such as medium-scale training, document processing, or multistep inference pipelines.</p>
<p>Consider your infrastructure has three machines:</p>
<h3 id="heading-system-a-high-end"><strong>System A — High-End</strong></h3>
<ul>
<li><p>Very powerful GPU</p>
</li>
<li><p><strong>80GB VRAM</strong></p>
</li>
<li><p>Designed for extremely large models or heavy workloads</p>
</li>
</ul>
<h3 id="heading-system-b-mid-tier"><strong>System B — Mid-Tier</strong></h3>
<ul>
<li><p>Same GPU FLOPs as System C</p>
</li>
<li><p><strong>40GB VRAM</strong></p>
</li>
<li><p>High system RAM</p>
</li>
<li><p>Capable of running <strong>two medium-heavy jobs in parallel</strong></p>
</li>
</ul>
<h3 id="heading-system-c-entry-level"><strong>System C — Entry-Level</strong></h3>
<ul>
<li><p>Same GPU FLOPs as System B</p>
</li>
<li><p><strong>20GB VRAM</strong></p>
</li>
<li><p>Suitable for <strong>one medium-heavy job</strong></p>
</li>
</ul>
<hr />
<h2 id="heading-what-happens-without-vram-partitioning"><strong>What Happens <em>Without</em> VRAM Partitioning</strong></h2>
<p>When these systems are rented out:</p>
<ul>
<li><p>Each system receives <strong>one job</strong></p>
</li>
<li><p>System B receives the same type of medium-heavy job as System C</p>
</li>
<li><p>Yet System B’s extra VRAM and system RAM stay unused</p>
</li>
<li><p>In terms of job handling and revenue, System B behaves exactly like System C</p>
</li>
</ul>
<p>System B’s potential is wasted because:</p>
<ol>
<li><p>VRAM is treated as a monolithic block</p>
</li>
<li><p>The scheduler cannot safely place two jobs on System B</p>
</li>
<li><p>A single job’s memory spike could crash both workloads</p>
</li>
</ol>
<p>Thus, <strong>System B earns the same revenue as System C</strong> even though it could do more.</p>
<hr />
<h2 id="heading-what-happens-with-vram-partitioning"><strong>What Happens <em>With</em> VRAM Partitioning</strong></h2>
<p>When VRAM partitioning is applied:</p>
<ul>
<li><p>System B is effectively split into <strong>two logical GPU slices</strong>, each with ~20GB VRAM</p>
</li>
<li><p>Two jobs can run independently without affecting each other</p>
</li>
<li><p>Resource utilization increases dramatically</p>
</li>
<li><p>System B becomes equivalent to <strong>two System Cs</strong> in terms of throughput</p>
</li>
<li><p><strong>Revenue from System B nearly doubles</strong></p>
</li>
</ul>
<p>This is the key insight:</p>
<blockquote>
<p><strong>VRAM partitioning transforms hardware potential into actual throughput and revenue.</strong></p>
</blockquote>
<p>This is true whether you're running personal compute rentals, enterprise AI workloads, or shared GPU clusters.</p>
<hr />
<h1 id="heading-2-why-vram-partitioning-is-essential-for-modern-ai-workloads"><strong>2. Why VRAM Partitioning Is Essential for Modern AI Workloads</strong></h1>
<p>This section explains <em>why</em> partitioning is needed — keeping it clean and non-repetitive.</p>
<hr />
<h2 id="heading-21-gpus-are-now-multi-model-multi-workload-systems"><strong>2.1 GPUs Are Now Multi-Model, Multi-Workload Systems</strong></h2>
<p>Even on a single machine, AI teams commonly run:</p>
<ul>
<li><p>A main LLM for chat or API inference</p>
</li>
<li><p>Secondary LLMs for embeddings or retrieval</p>
</li>
<li><p>OCR / vision models</p>
</li>
<li><p>Data-processing or vectorization jobs</p>
</li>
<li><p>Fine-tuning / evaluation tasks</p>
</li>
</ul>
<p>All of these share the GPU's VRAM.</p>
<p>Partitioning ensures each model or pipeline gets guaranteed resources.</p>
<hr />
<h2 id="heading-22-multi-tenancy-is-the-new-default"><strong>2.2 Multi-Tenancy is the New Default</strong></h2>
<p>In modern environments:</p>
<ul>
<li><p>Multiple developers</p>
</li>
<li><p>Multiple microservices</p>
</li>
<li><p>Multiple users</p>
</li>
<li><p>Automated pipelines</p>
</li>
</ul>
<p>often share the same GPU.</p>
<p>Partitioning prevents:</p>
<ul>
<li><p>Memory starvation</p>
</li>
<li><p>Job crashes</p>
</li>
<li><p>Interference across workloads</p>
</li>
</ul>
<hr />
<h2 id="heading-23-gpus-lack-memory-virtualization"><strong>2.3 GPUs Lack Memory Virtualization</strong></h2>
<p>CPUs have:</p>
<ul>
<li><p>Virtual memory</p>
</li>
<li><p>Memory isolation</p>
</li>
<li><p>Swapping</p>
</li>
</ul>
<p>GPUs do <strong>not</strong>.</p>
<p>If VRAM hits 100%:</p>
<ul>
<li><p>The GPU throws an OOM</p>
</li>
<li><p>All processes may crash</p>
</li>
<li><p>The system may become unstable</p>
</li>
</ul>
<p>Partitioning provides a safety boundary.</p>
<hr />
<h2 id="heading-24-llms-introduce-dynamic-memory-behavior"><strong>2.4 LLMs Introduce Dynamic Memory Behavior</strong></h2>
<p>LLMs cause fluctuating VRAM usage due to:</p>
<ul>
<li><p>KV-cache growth</p>
</li>
<li><p>Varying sequence lengths</p>
</li>
<li><p>Batch merging</p>
</li>
<li><p>Token streaming</p>
</li>
</ul>
<p>Partitioning ensures one workload’s fluctuations don’t take others down.</p>
<hr />
<h1 id="heading-3-why-partitioning-is-hard-on-non-mig-gpus"><strong>3. Why Partitioning Is Hard on Non-MIG GPUs</strong></h1>
<p>Many GPUs widely used today <strong>do not support NVIDIA MIG</strong>, including:</p>
<ul>
<li><p>RTX 3090 / 4090</p>
</li>
<li><p>L40 / L40S</p>
</li>
<li><p>AWS T4 (g4dn), A10G (g5), V100 (p3), A100 (p4d without MIG)</p>
</li>
<li><p>Azure NCasT4_v3, NC6s_v3, ND-series (A100 non-MIG)</p>
</li>
</ul>
<p>These GPUs operate entirely on:</p>
<blockquote>
<p><strong>First-come, first-served VRAM allocation with no hardware isolation.</strong></p>
</blockquote>
<p>Frameworks like PyTorch/TensorFlow make this even harder because they pre-allocate VRAM aggressively and don’t release it immediately.</p>
<p>Thus, <strong>software-based VRAM partitioning</strong> is required.</p>
<hr />
<h1 id="heading-4-practical-vram-partitioning-techniques-for-non-mig-gpus"><strong>4. Practical VRAM Partitioning Techniques for Non-MIG GPUs</strong></h1>
<p>Here are the real, production-tested methods.</p>
<hr />
<h2 id="heading-41-framework-level-soft-vram-limits"><strong>4.1 Framework-Level Soft VRAM Limits</strong></h2>
<p><strong>PyTorch</strong></p>
<pre><code class="lang-plaintext">torch.cuda.set_per_process_memory_fraction(0.5, 0)
</code></pre>
<p><strong>TensorFlow</strong></p>
<pre><code class="lang-plaintext">config.gpu_options.per_process_gpu_memory_fraction = 0.4
</code></pre>
<p>Good for guardrails but not enforceable boundaries.</p>
<hr />
<h2 id="heading-42-logical-gpu-shrinking-environment-variables"><strong>4.2 Logical GPU Shrinking (Environment Variables)</strong></h2>
<pre><code class="lang-plaintext">XLA_PYTHON_CLIENT_MEM_FRACTION=0.3
</code></pre>
<p>Ideal for notebooks or dev setups.</p>
<hr />
<h2 id="heading-43-nvidia-mps-multi-process-service"><strong>4.3 NVIDIA MPS (Multi-Process Service)</strong></h2>
<pre><code class="lang-plaintext">export CUDA_MPS_ACTIVE_THREAD_PERCENTAGE=40
</code></pre>
<p>Improves scheduling fairness and reduces random spikes, but does <strong>not</strong> provide VRAM isolation.</p>
<hr />
<h2 id="heading-44-os-container-level-memory-boundaries"><strong>4.4 OS / Container-Level Memory Boundaries</strong></h2>
<pre><code class="lang-plaintext">docker run --memory=16g --gpus '"device=0"' app
</code></pre>
<p>Cgroups limit pinned RAM → indirectly enforce VRAM usage.</p>
<p>Most reliable in production clusters (AWS EKS, Azure AKS).</p>
<hr />
<h2 id="heading-45-custom-cuda-allocators-true-vram-partitioning"><strong>4.5 Custom CUDA Allocators (True VRAM Partitioning)</strong></h2>
<pre><code class="lang-plaintext">cudaMalloc(&amp;ptr, 8LL * 1024 * 1024 * 1024);
</code></pre>
<p>Used in:</p>
<ul>
<li><p>TensorRT</p>
</li>
<li><p>DeepSpeed</p>
</li>
<li><p>vLLM</p>
</li>
</ul>
<p>Provides precise control.</p>
<hr />
<h2 id="heading-46-llm-serving-framework-memory-schedulers"><strong>4.6 LLM Serving Framework Memory Schedulers</strong></h2>
<p>Frameworks like <strong>vLLM</strong>, <strong>Triton</strong>, <strong>TGI</strong> implement their own partitioning using:</p>
<ul>
<li><p>KV cache pools</p>
</li>
<li><p>Static memory slabs</p>
</li>
<li><p>Token schedulers</p>
</li>
</ul>
<p>This is currently the most efficient method for multi-tenant LLM workloads.</p>
<hr />
<h1 id="heading-5-monitoring-vram-per-process-critical"><strong>5. Monitoring VRAM per Process (Critical)</strong></h1>
<h3 id="heading-51-query-processes"><strong>5.1 Query processes</strong></h3>
<pre><code class="lang-plaintext">nvidia-smi --query-compute-apps=pid,process_name,used_gpu_memory --format=csv
</code></pre>
<h3 id="heading-52-real-time-monitoring"><strong>5.2 Real-time monitoring</strong></h3>
<pre><code class="lang-plaintext">watch -n 1 nvidia-smi
</code></pre>
<h3 id="heading-53-nvml-programmatic-approach"><strong>5.3 NVML programmatic approach</strong></h3>
<pre><code class="lang-plaintext">import pynvml
...
</code></pre>
<h3 id="heading-54-enforcement"><strong>5.4 Enforcement</strong></h3>
<pre><code class="lang-plaintext">if p.usedGpuMemory &gt; MAX_MB * 1024**2:
    kill
</code></pre>
<hr />
<h1 id="heading-6-summary-table-choosing-the-right-strategy"><strong>6. Summary Table — Choosing the Right Strategy</strong></h1>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Method</td><td>Strength</td><td>Best Use Case</td><td>GPU Types</td></tr>
</thead>
<tbody>
<tr>
<td>Framework Soft Limits</td><td>Simple guardrails</td><td>Multi-model inference</td><td>All GPUs</td></tr>
<tr>
<td>Logical GPU Shrinking</td><td>Easy to implement</td><td>Notebooks, dev</td><td>All GPUs</td></tr>
<tr>
<td>NVIDIA MPS</td><td>Better concurrency fairness</td><td>Shared inference</td><td>3090, 4090, T4, A10G</td></tr>
<tr>
<td>Cgroups/Containers</td><td>Strong isolation</td><td>Production workloads</td><td>AWS, Azure, On-Prem</td></tr>
<tr>
<td>Custom CUDA Allocators</td><td>True partitioning</td><td>High-performance serving</td><td>4090, L40S, A10G, A100</td></tr>
<tr>
<td>LLM Memory Schedulers</td><td>Most efficient</td><td>Multi-tenant LLM serving</td><td>All non-MIG GPUs</td></tr>
</tbody>
</table>
</div><hr />
<h1 id="heading-conclusion"><strong>Conclusion</strong></h1>
<p>The real-world example of Systems A, B, and C illustrates a deeper truth:</p>
<blockquote>
<p><strong>GPU VRAM partitioning directly translates into stability, fairness, higher utilization, and increased revenue.</strong></p>
</blockquote>
<p>In a world where GPUs are expensive and workloads are becoming multi-model and multi-tenant by default, <strong>software-driven VRAM partitioning is no longer optional</strong> — it is essential infrastructure.</p>
]]></content:encoded></item></channel></rss>