Gpu_ai_runtime_memory_proposal

1. Motivation

AI hardware is improving faster than the software stack that is supposed to use it.

NVIDIA, AMD, and Intel all produce increasingly capable GPUs with better matrix acceleration, lower-precision compute, higher memory bandwidth, and stronger AI-oriented hardware. However, users still often have to choose a GPU based on software compatibility first and hardware capability second.

In practice, the first question is often not:

Which GPU has the best VRAM capacity, bandwidth, compute performance, power efficiency, and price?

Instead, it is:

Does this model, extension, quantization library, or attention kernel work with CUDA?

That is not a healthy long-term situation for a multi-vendor GPU market.

The goal of this proposal is **not to replace CUDA**.

CUDA, ROCm, and Intel XPU / oneAPI should continue to exist as optimized vendor backends.

The goal is to build a stronger common execution and memory-management layer above them so that application code, model code, and common AI workloads do not have to be tightly coupled to one GPU vendor.


2. Current Problems

Local AI users repeatedly encounter the same classes of problems:

  • CUDA-only extensions
  • incomplete or inconsistent ROCm support
  • limited AMD support on Windows
  • backend-specific differences in FlashAttention, xformers, bitsandbytes, and other libraries
  • fragmented low-bit quantization implementations
  • manual device mapping and offloading
  • KV cache causing unexpected OOM failures
  • temporary buffers consuming several additional gigabytes of VRAM
  • dequantization buffers partially defeating the purpose of low-bit weights
  • memory fragmentation
  • GPUs with enough compute performance being unable to run a model because of VRAM limits
  • CPU or NVMe offloading allowing a model to run, but often at unacceptable performance

The problem is therefore not just raw GPU compute.

The software stack needs better control over **memory placement, low-bit execution, backend abstraction, and runtime planning**.


3. A Concrete Target: 13B-Class Models on 12 GB GPUs

A useful practical target would be:

Make 13B-class INT4 inference practical on 12 GB consumer GPUs without requiring users to manually combine many separate libraries and backend-specific workarounds.

Approximate model weight sizes for a 13B model are:

  • BF16: about 26 GB
  • INT8: about 13 GB
  • INT4: about 6.5 GB, plus scales and metadata

This means that INT4 weights can theoretically fit comfortably within 12 GB.

The real problem is everything else:

  • KV cache
  • activations
  • attention workspace
  • temporary tensors
  • dequantization buffers
  • kernel workspace
  • allocator fragmentation

So the main challenge is not merely quantizing the weights. It is controlling the **entire runtime memory footprint**.


4. Memory-Budget-Aware Execution

Instead of forcing users to manually tune `device_map`, `max_memory`, offload folders, quantization settings, and backend-specific flags, the runtime should accept a simple memory budget.

For example:

```python
model = load_model(
path=“model”,
device=“gpu”,
memory_budget=“11GB”,
weight_dtype=“int4”,
kv_cache_dtype=“int8”,
offload=“auto”,
)
```

The runtime should automatically decide:

  • which layers remain in local VRAM
  • which tensors can use lower precision
  • which tensors should be offloaded
  • whether some layers should use INT4, INT8, FP8, or BF16
  • which KV cache precision should be used
  • which attention implementation should be selected
  • which operations should be fused
  • how much workspace can be allocated
  • how temporary buffers should be reused
  • which vendor backend should be selected

The user should be able to say:

My GPU has 12 GB. Make the best execution plan that fits.

The framework should then perform the planning.


5. Stronger Vendor-Neutral Execution

An ideal architecture could look like this:

```text
Application / Transformers / Local LLM Runtime
|
v
PyTorch Graph
|
v
Common GPU Runtime / IR
|
±----------±----------+
| | |
v v v
CUDA ROCm XPU
NVIDIA AMD Intel
```

Again, this does not require removing CUDA.

CUDA would remain the NVIDIA backend.

ROCm would remain the AMD backend.

XPU / oneAPI would remain the Intel backend.

The difference is that more model logic, memory logic, quantization logic, and kernel definitions would exist **above** those vendor-specific layers.

Ideally, users could write:

```python
model.to(“gpu”)
```

and the runtime would internally choose:

```text
NVIDIA → CUDA
AMD → ROCm
Intel → XPU / oneAPI
```

without requiring major changes in application code.


6. Low-Bit Data Types Should Be First-Class Runtime Features

INT4, INT8, FP8, and mixed precision should not behave like optional tricks provided by unrelated third-party libraries.

They should be first-class execution and memory-management concepts.

Examples include:

  • INT4 weight-only quantization
  • INT8 KV cache
  • FP8 activations
  • per-layer mixed precision
  • per-block precision selection
  • keeping sensitive layers in BF16 while storing most weights in INT4
  • higher precision only for the output head or specific attention blocks

A critical point is that an INT4 model should not repeatedly allocate large BF16 copies of its weights during execution.

The preferred path should look more like:

```text
INT4 Weight
|
v
Fused Dequant + MatMul
|
v
BF16 / FP16 Output
```

rather than:

```text
INT4 Weight
|
v
Temporary BF16 Weight Copy
|
v
MatMul
```

The latter can destroy much of the memory advantage of quantization.


7. KV Cache Should Be Treated as a Core Memory Problem

Reducing weight size is not enough.

As context length grows, KV cache can become one of the largest consumers of VRAM.

A modern runtime should support:

  • FP16 KV cache
  • FP8 KV cache
  • INT8 KV cache
  • INT4 KV cache
  • paged KV cache
  • selective migration of old KV blocks to slower memory
  • attention-window-aware retention
  • prefix cache sharing
  • automatic KV precision adjustment based on VRAM budget

For example, when given an 11 GB memory budget, the runtime might automatically decide:

```text
Weights: INT4
KV Cache: INT8
Attention: memory-efficient implementation
Context Length: automatically limited to available memory
```

This should be planned before execution, not after an OOM crash.


8. Hierarchical Memory

Current consumer systems effectively look like this:

```text
GPU VRAM
|
PCIe
|
System RAM
|
Storage
```

For AI workloads, a more explicit hierarchical memory model would be useful:

```text
Tier 0: GPU Local VRAM
Tier 1: GPU-Side Expansion Memory
Tier 2: System RAM
Tier 3: NVMe / mmap Storage
```

Tier 0: GPU Local VRAM

The fastest memory.

Best suited for:

  • currently active layers
  • hot KV cache
  • attention working sets
  • frequently accessed tensors
  • temporary compute buffers

Tier 1: GPU-Side Expansion Memory

A future large-capacity memory tier physically close to the GPU.

Possible capacities:

  • 32 GB
  • 64 GB
  • 128 GB

It may be slower than local VRAM but much faster and lower-latency than system RAM over PCIe.

Possible uses:

  • inactive transformer layers
  • cold KV cache
  • adapters
  • multimodal encoder weights
  • rarely accessed blocks of a large model

Tier 2: System RAM

Large and relatively inexpensive, but slower and farther from the GPU.

Useful for less frequently accessed tensors and overflow capacity.

Tier 3: NVMe

A last-resort storage tier.

Useful for:

  • model startup
  • cold storage
  • rarely used weights
  • checkpoint data
  • emergency offloading

It should not be treated as a substitute for fast working memory.


9. GPU-Side Expansion Memory

Consumer GPUs continue to gain compute performance faster than they gain VRAM capacity.

This creates situations where a GPU has enough compute throughput for a model but cannot hold the model and its runtime state.

One possible hardware direction would be:

```text
GPU
|
±- 12 GB High-Speed VRAM
|
±- 32-64 GB Expansion Memory
|
±- Dedicated High-Speed Link
```

The expansion memory does not need to be as fast as local GDDR or HBM.

However, it should be significantly better than ordinary system RAM or NVMe for GPU access.

Useful properties would include:

  • high bandwidth
  • low latency
  • direct GPU access
  • unified addressing
  • coherent or semi-coherent memory management
  • asynchronous page migration
  • driver-level placement control
  • framework-visible memory tiers

In such a design, 12 GB of VRAM could act as the high-speed working set while a much larger pool stores the rest of the model.

This could be especially valuable for local AI workloads.


10. Why NVMe Offloading Is Not Enough

NVMe offloading can prevent complete failure when a model is too large.

It does not solve the performance problem.

If every layer requires data to be read from storage and transferred to the GPU, then execution becomes transfer-bound:

```text
Compute Time << Data Transfer Time
```

At that point, additional GPU compute performance is mostly wasted.

NVMe is useful for:

  • cold storage
  • startup loading
  • checkpoints
  • infrequently accessed blocks
  • emergency overflow

It is not an ideal primary memory tier for interactive inference.

The real solution is to reduce how much data must cross slow links during execution.


11. What PyTorch Could Improve

If PyTorch continues evolving toward a broader AI execution runtime, the following features could provide significant value.

11.1 Memory Budget API

Example:

```python
torch.set_memory_budget(“11GB”)
```

or a model-specific equivalent.

11.2 Hierarchical Tensor Placement

The runtime could understand placements such as:

```text
gpu_local
gpu_extended
system_ram
mmap
```

and move tensors automatically.

11.3 Native Low-Bit Tensor Support

Low-bit formats should be directly represented and optimized:

  • INT4
  • INT8
  • FP8
  • block quantization
  • quantized KV cache
  • mixed-precision tensors

11.4 Vendor-Neutral Kernel IR

An attention, quantization, or matrix-multiplication kernel could be defined once and compiled to:

  • NVIDIA
  • AMD
  • Intel

backend-specific implementations.

11.5 Automatic Kernel Selection

The runtime should automatically select between:

  • Flash-style attention
  • memory-efficient attention
  • fused MLP
  • fused dequantization + matrix multiplication
  • paged attention
  • low-bit GEMM

depending on available hardware and memory.

11.6 Automatic Replanning Before OOM

Instead of crashing first and forcing the user to change settings, the runtime could estimate memory requirements before execution.

For example:

```text
Expected Usage: 13.8 GB
Available Budget: 11.0 GB

Replanned Execution:

  • Layers 0-18 → local GPU memory
  • Layers 19-31 → expansion memory or system RAM
  • KV cache → INT8
  • Attention workspace → memory-efficient mode
  • Temporary buffer reuse → enabled
    ```

This is a better user experience than trial-and-error OOM debugging.


12. What Hugging Face Transformers Could Improve

From a Transformers user perspective, the ideal interface could be extremely simple:

```python
model = AutoModel.from_pretrained(
model_id,
device=“auto”,
memory_budget=“11GB”,
precision=“auto”,
)
```

Internally, the framework could coordinate:

  • PyTorch
  • torch.compile / Inductor
  • TorchAO
  • Triton
  • CUDA
  • ROCm
  • Intel XPU
  • quantization
  • offloading
  • KV cache
  • attention backend selection

Today, users often have to read documentation for several separate libraries and manually combine them.
That complexity should gradually move into the runtime itself.


13. The Goal Is Not to Eliminate CUDA

This point is important.

CUDA is a mature and highly optimized NVIDIA backend.

There is no need to remove it.

The problem is that CUDA compatibility is often treated as a requirement for using a model, extension, or kernel at all.

The ideal market would allow users to choose GPUs based mainly on:

  • VRAM capacity
  • memory bandwidth
  • compute performance
  • power efficiency
  • price

rather than mainly asking:

Does this require CUDA?

If NVIDIA provides the best hardware, users can choose NVIDIA.

If AMD provides more VRAM at a better price, users should be able to choose AMD without losing major software capabilities.

If Intel offers competitive hardware, it should also be a viable option.

That is healthier competition.


14. Expected Market Effect

A stronger common runtime could change how consumer GPUs compete.

Current situation:

```text
Software compatibility → GPU vendor decision
```

Preferred situation:

```text
Price / VRAM / Bandwidth / Efficiency / Performance → GPU vendor decision
```

This would encourage all three major GPU vendors to compete on actual hardware value while still maintaining their own optimized backend stacks.

The result should be better for users, developers, and the broader AI ecosystem.


15. Possible Roadmap

Stage 1

  • stronger INT4 / INT8 / FP8 tensor support
  • standard low-bit KV cache APIs
  • memory-budget APIs
  • backend-independent attention APIs

Stage 2

  • common kernel IR for CUDA / ROCm / XPU
  • vendor-neutral quantization kernels
  • automatic memory planning
  • OOM prediction before execution

Stage 3

  • hierarchical system-memory support
  • paged tensors
  • asynchronous tensor migration
  • improved direct memory access

Stage 4

  • standardized GPU-side expansion memory support
  • hardware memory-tier APIs
  • runtime-controlled tensor migration
  • stronger multi-vendor execution portability

16. Suggested Success Criteria

Test A

Run a 13B-class INT4 model on a 12 GB NVIDIA GPU.

Requirements:

  • minimal manual device mapping
  • automatic KV cache optimization
  • useful context length
  • no OOM during normal inference

Test B

Run the same model code on a 16 GB AMD GPU.

The application code should not require major modification.

Test C

Run the same model code on an Intel GPU.

Backend differences should remain mostly inside the framework.

Test D

When local VRAM is insufficient, automatically move selected tensors to another memory tier.

The user should not have to manually assign every layer.


17. Short Forum Version

Title

**Proposal: Vendor-neutral, memory-budget-aware execution for consumer GPUs**

Post

I would like to suggest a direction for PyTorch, Transformers, and local LLM runtimes.

Today, consumer GPU users face two major problems:

  1. Software support is fragmented between NVIDIA CUDA, AMD ROCm, and Intel XPU.
  2. VRAM is often the real bottleneck even when the GPU has enough compute performance.

A 12 GB GPU may have enough compute power for a 13B-class model, especially with INT4 weights, but KV cache, temporary buffers, backend-specific kernels, and fragmented memory allocation can still cause OOM.

I think frameworks should move toward a **memory-budget-aware execution model**.

For example:

```python
model = load_model(
path,
device=“gpu”,
memory_budget=“11GB”,
weight_dtype=“int4”,
kv_cache_dtype=“int8”,
offload=“auto”,
)
```

The runtime should automatically decide:

  • which layers stay in local VRAM
  • which tensors use lower precision
  • how KV cache is stored
  • which attention implementation is used
  • which kernels are fused
  • whether system RAM or another memory tier is used
  • which backend is selected for NVIDIA, AMD, or Intel

The goal is **not to replace CUDA**.

CUDA, ROCm, and XPU can remain optimized vendor backends.

The goal is to build a stronger common execution layer above them so that model code does not need to be heavily rewritten or restricted to one GPU vendor.

I also think frameworks should prepare for hierarchical GPU memory:

```text
Tier 0: GPU local VRAM
Tier 1: future GPU-side expansion memory
Tier 2: system RAM
Tier 3: NVMe / mmap
```

NVMe offloading alone is not a real performance solution because bandwidth and latency are much worse than local GPU memory.

A future GPU-side expansion-memory tier could allow a fast 12 GB consumer GPU to use a much larger model without relying on system RAM or SSD as the primary working memory.

A concrete target could be:

Make 13B-class INT4 inference practical on 12 GB consumer GPUs without requiring users to manually combine many separate libraries and backend-specific workarounds.

There are already many relevant technologies:

  • PyTorch
  • torch.compile / Inductor
  • TorchAO
  • Triton
  • Transformers
  • Accelerate
  • FlashAttention
  • bitsandbytes
  • llama.cpp-style quantization

However, these capabilities are still fragmented.

I think a future major version of the stack would be more valuable if it focused on unified memory management, low-bit inference, and hardware-neutral execution.

The end goal should be simple:

Users should choose GPUs based on VRAM, bandwidth, compute performance, power efficiency, and price — not primarily because a particular model or kernel only works on one vendor.

I would be interested to hear whether there are existing projects, RFCs, or research efforts moving in this direction.


18. One-Sentence Summary

**AI frameworks should hide GPU-vendor differences, automatically optimize models for a fixed VRAM budget, and prepare for future GPU-side expansion memory so that 12 GB consumer GPUs can run larger models efficiently.**

I read the clarification first. If I separate the idea into layers, from hardware up through software, it looks like parts of it are indeed already being explored:


Yes — there are several projects, RFCs, and research efforts that look quite close to different parts of what you are describing.

What I do not currently see is one established system that combines all of these into a single vendor-neutral planner:

  • a user-specified GPU memory budget,
  • automatic weight placement,
  • KV-cache placement,
  • temporary/workspace budgeting,
  • quantization / low-precision selection,
  • kernel/backend capability selection,
  • prefetch / migration policy,
  • and multiple memory tiers extending beyond local VRAM.

So I would not reduce the idea to “SSD as VRAM.” Your clarification makes the distinction much clearer: there is a hardware-side question about what memory tiers the GPU can efficiently access, and a software-side question about how a runtime should decide what belongs in each tier.

A useful default architecture might be to keep CUDA / ROCm / XPU as optimized vendor backends, but put a capability-aware planner above them:

model + workload requirements
          |
          v
   common runtime planner
   - memory budget
   - tensor/KV placement
   - precision choice
   - prefetch/migration
   - kernel choice
          |
          v
   backend capability query
   - available memory spaces
   - direct access / migration / async copy
   - supported dtypes
   - supported kernels
   - topology / bandwidth information
          |
     +----+----+
     |    |    |
   CUDA ROCm  XPU

That avoids requiring CUDA, ROCm, and XPU to behave identically. The common layer only needs to know what each backend can actually provide.

One thing I would separate early is what exactly gpu_extended means, because I think there are at least three materially different implementations:

1. GPU can directly load/store the expanded memory
   -> closest to a genuinely new GPU-side memory tier

2. GPU and host share an address space, with pages migrating as needed
   -> Unified Memory / HMM-like model

3. Data is explicitly staged into VRAM with asynchronous copies/prefetch
   -> software-managed capacity tier

All three can make a model larger than local VRAM practical, but the runtime design and performance behavior are very different.

Some existing work that seems closely related

1. Memory-budget-aware runtime planning already exists in partial forms

Hugging Face Accelerate is probably the most familiar example on the Python/model-loading side.

Its Big Model Inference path can calculate a device_map and place weights across GPU, CPU, and disk while respecting a max_memory budget.

So part of the idea already exists:

model sizes + available memory
        ->
automatic placement
        ->
GPU -> CPU -> disk

But its current automatic map is still mostly based on parameter sizes and dtypes. The documentation also explicitly notes that CPU/disk-offloaded weights are not prefetched before they are needed.

That leaves quite a bit of distance from a planner that also reasons about KV cache, temporary buffers, access frequency, topology, quantization, and kernel selection.


2. llama.cpp now has a particularly relevant --fit mechanism

Current llama.cpp has an automatic fitting system documented in fit-params.

The normal CLI also exposes:

  • --fit
  • --fit-target
  • --fit-ctx

and --fit is currently on by default.

It estimates projected device-memory use and can adjust parameters that the user did not explicitly specify so that execution fits the available device memory.

The original discussion is also useful because it explains the policy:

Automation for GPU layers, tensor split, tensor overrides, and context size

One design detail there seems especially relevant to your proposal: values explicitly chosen by the user stay under user control, while unset values can be planner-controlled.

That suggests a clean contract for a more general runtime:

hard user constraints
    VRAM <= 12 GiB
    context >= 8k
    precision >= <acceptable floor>

planner-owned choices
    weight placement
    KV placement
    tensor split
    prefetch distance
    kernel choice

This seems safer than allowing the planner to silently rewrite everything.


3. There is a very interesting current ExecuTorch RFC for weight offloading

The 2026 ExecuTorch proposal:

[RFC] Weight offloading for the CUDA backend

is quite close to the software side of your idea.

It proposes:

  • keeping weights outside GPU memory,
  • a capped CUDA memory pool controlled by a user GPU-byte budget,
  • recording the deterministic order in which compiled execution accesses weights,
  • asynchronously prefetching future weights,
  • overlapping transfers with kernel execution,
  • evicting weights as necessary,
  • and calculating a minimum safe GPU-memory budget at compile time.

I especially like the last part as a design reference.

Instead of accepting an arbitrarily tiny memory budget and silently becoming extremely slow, the proposed runtime can say, in effect:

requested GPU budget: X
minimum safe budget:  Y

X < Y -> fail early with a useful diagnostic

That distinction between “technically possible eventually” and “a valid execution configuration” may be important for a general planner.

This is currently an open RFC, not an established ExecuTorch feature, so I would treat it as a design direction rather than existing functionality.


4. Earlier research went further into automatic GPU/CPU/storage placement

FlexGen is an important older example.

It treats GPU memory, CPU memory, and disk as a combined resource and searches for efficient ways to store/access weights, activations, and attention cache under hardware constraints. It also combines that with compression.

Its target is different from interactive low-latency serving: FlexGen deliberately trades latency for throughput and large effective batch sizes.

Still, conceptually it demonstrates that:

placement + compression + execution schedule

can be optimized together rather than being independent user choices.

Another useful research connection is:

G10: Enabling An Efficient Unified GPU Memory and Storage Architecture with Smart Tensor Migrations

G10 treats tensor access patterns as information the system can use to schedule movement between GPU memory and slower storage rather than relying only on reactive page faults.

That seems relevant to the distinction between:

"move data after the GPU faults on it"

and:

"the runtime knows which tensor will be needed next and moves it beforehand"

For model execution, the second option can be much more interesting because much of the access sequence is predictable.


5. PyTorch itself has an RFC for heterogeneous memory inside a device

This one may be particularly relevant:

[RFC] Intra-Device Heterogeneous Memory Allocation Support

The RFC distinguishes:

inter-device memory heterogeneity
CPU vs CUDA vs XPU

from:

intra-device memory heterogeneity
different memory types belonging to the same logical device

and discusses memory types such as:

  • HBM,
  • DDR,
  • CXL,
  • PMEM,
  • disk,

with the idea that an allocator could choose the backing memory type of a tensor.

The proposal explicitly notes that the same mechanism could potentially apply to CUDA, XPU, and other devices if they acquire multiple memory types.

That is fairly close to the abstraction behind your:

gpu_local
gpu_extended
system_ram
storage

idea.

It is still an open RFC, though. I would not interpret it as a committed PyTorch roadmap.


6. JAX / OpenXLA show that “device” and “memory space” can be separate concepts

JAX already exposes memory spaces and host offloading.

A JAX sharding can carry a memory_kind, currently including "device" and "pinned_host" in the documented examples.

At a lower compiler level, OpenXLA’s HLO shape/layout representation has explicit memory-space identifiers:

S(0) -> device HBM
S(1) -> on-device VMEM
S(2+) -> additional device-specific memory spaces
S(5) -> host memory

That does not mean OpenXLA already provides the LLM runtime you are proposing.

But it is useful evidence that the abstraction:

logical device != one single type of physical memory

is already part of modern compiler design.


7. KV cache tiering is already becoming a real runtime feature

vLLM now has a TieringOffloadingSpec for multi-tier KV-cache offloading.

Its current design has:

GPU
  |
CPU primary offload tier
  |
+-------------------+
| filesystem        |
| network / object  |
| custom tier       |
+-------------------+

with configurable eviction policies such as LRU/ARC and extensible secondary-tier managers.

An important difference from your proposed Tier 1 is that vLLM’s secondary tiers do not directly access GPU memory; the CPU primary tier is the gateway.

So this is not the hardware architecture you are describing.

But it does show that the software problem of:

Which KV blocks are hot?
Which should be promoted?
Which should be evicted?
Which slower tier should hold them?

has already become concrete enough to appear in a production-oriented serving runtime.

That makes me think a future general planner may want to treat weights, KV cache, activations/workspace, and adapters as different object classes rather than applying one eviction policy to everything.


8. Low precision is also becoming something a planner could query rather than hard-code

PyTorch’s torchao quantized inference currently exposes multiple inference configurations including INT8, INT4, FP8 and newer formats.

But the supported combinations depend on hardware and backend.

That is another reason I would prefer a capability-oriented API:

planner asks backend:

Can you execute INT4 weight-only efficiently?
Can you execute FP8 here?
Which packing/layout is supported?
Which kernel will actually be selected?
What workspace does that kernel require?

rather than treating:

INT4
INT8
FP8

as globally interchangeable labels.

Your idea of including quantization and kernel selection in the planner therefore seems related to work that is already happening, but it also exposes why a vendor-neutral planner probably needs capability discovery rather than a lowest-common-denominator kernel API.

The hardware-side idea also has some surprisingly close research

The clarification about the additional memory tier made me think of this paper in particular:

CXL-GPU: Pushing GPU Memory Boundaries with the Integration of CXL Technologies

The researchers propose a GPU architecture with CXL root ports that can connect additional DRAM and/or SSD-backed endpoints, and they implemented a custom CXL controller in hardware.

That is much closer to:

GPU -> directly managed expansion

than normal:

GPU -> PCIe -> CPU memory/storage stack

It is research hardware, not a consumer-GPU feature or an established standard architecture, so I would not say “CXL already solves this.”

But it does mean the underlying hardware direction is not purely hypothetical.

There is a broader spectrum here:

fastest / smallest

local HBM or GDDR
        |
directly attached expansion memory
        |
coherent / managed shared memory
        |
explicitly prefetched host memory
        |
NVMe / remote storage

slowest / largest

Different systems can draw the boundary in different places.

CUDA Unified Memory is also worth keeping in the map, but mostly as a mechanism, not as the complete solution.

The CUDA Unified Memory documentation supports GPU-memory oversubscription and migration between processors. Modern systems can use page faults, access counters, memory advice and prefetch hints.

That solves an important lower-level problem:

How can memory larger than local VRAM remain addressable and move between processors?

It does not by itself solve the model-aware policy problem:

Which transformer layer, KV block, adapter, or temporary buffer should move, when should it move, and should the runtime change precision or execution strategy instead?

That distinction between mechanism and policy seems useful when comparing the proposal with existing systems.

Where I think there may still be an integration gap

From what I could find, the pieces are currently distributed across different projects:

Problem Examples
GPU/CPU/disk model placement Accelerate, FlexGen
Fit execution to available VRAM llama.cpp --fit
Predictive weight prefetch ExecuTorch RFC
Multi-tier KV cache vLLM
Explicit compiler memory spaces OpenXLA / JAX
Intra-device heterogeneous memory API PyTorch RFC
Low-bit tensor/kernel support torchao and backend-specific libraries
Managed oversubscription/page migration CUDA Unified Memory/HMM
Hardware-side expansion CXL-GPU research

What I have not found yet is a mature general-purpose runtime that takes something approximately like:

hardware:
  gpu_memory_budget: 12 GiB

workload:
  model: ...
  context: ...
  concurrency: ...

preferences:
  allow_int4: true
  allow_kv_int8: true
  allow_host_memory: true
  allow_storage: false
  latency_priority: high

and jointly solves:

weight placement
KV placement
workspace reservation
precision
kernel selection
prefetch schedule
eviction policy
backend-specific implementation

while remaining portable across CUDA / ROCm / XPU.

There may well be projects I missed, so I would phrase this as an apparent integration gap rather than claiming that nobody has built it.

That seems to be the part of your proposal that is hardest to point to as one existing thing.

A possible decision tree for the proposed Tier 1

I think this would help separate several discussions that otherwise sound similar.

Does Tier 1 have to be directly load/store addressable by GPU kernels?
|
+-- YES
|    |
|    +-> This becomes substantially a hardware / interconnect /
|        allocator / memory-space problem.
|
|        Relevant directions:
|        - CXL-GPU-like architectures
|        - intra-device heterogeneous-memory APIs
|        - compiler-visible memory spaces
|
+-- NO
     |
     +-> Can page migration provide acceptable behavior?
     |    |
     |    +-> Unified Memory / HMM-style mechanisms become relevant.
     |
     +-> Or can the runtime explicitly stage/prefetch objects?
          |
          +-> llama.cpp / ExecuTorch / FlexGen / G10-style
              software planning becomes much closer.

These options do not have to be mutually exclusive.

A future runtime could expose all of them as capabilities and choose differently for different hardware.

How I would evaluate a prototype

I think your “13B INT4 on a 12 GB GPU” target is useful as an easily understood demonstration, but I would attach a workload definition to it.

Otherwise two implementations can both “run the model” while having completely different performance characteristics.

For example:

model / quantization:
    fixed

VRAM cap:
    12 GiB

context:
    4k / 8k / 16k

batch or concurrency:
    fixed

compare:
    A. manual placement/offload
    B. existing automatic placement
    C. demand-migration / managed-memory approach
    D. planner-controlled placement + prefetch

Then collect at least:

  • peak local VRAM,
  • peak host RAM,
  • time to first token,
  • prefill throughput,
  • decode tokens/sec,
  • bytes transferred between tiers,
  • time waiting for transfers,
  • number/size of promotions and evictions.

That would separate four different claims:

Can it run?
Can it stay inside the requested memory budget?
How much performance is lost?
Is the planner actually better than a simpler fallback?

I would also keep model loading and steady-state inference as separate budgets.

A model can fit during normal decoding but still exceed the target during loading, quantization, kernel initialization, graph compilation, or temporary workspace allocation.

And for a runtime intended to hide this complexity from users, observability seems important. Something like:

Tensor/block        Tier       Reason
----------------------------------------------
layers.0-11         VRAM       active working set
layers.12-31        Tier 1     predicted later use
KV hot blocks       VRAM       recent/high reuse
KV cold blocks      Tier 1     capacity pressure
adapter_X           host       low access frequency

VRAM budget         12.0 GiB
planned peak        11.4 GiB
reserved workspace   0.6 GiB

would make an automatic planner much easier to debug than a black box that simply becomes slow when it makes a bad placement decision.

A few search terms that may also help connect this idea to existing work are:

  • heterogeneous memory
  • intra-device heterogeneous memory
  • memory space assignment
  • out-of-core inference
  • tiered KV cache
  • tensor migration
  • GPU memory oversubscription
  • GPU-orchestrated memory tiering
  • topology-aware tensor placement
  • CXL GPU memory expansion

So my current reading is: the individual ingredients are not isolated ideas — quite a few of them are already active research or implementation areas. The interesting unresolved part seems to be how far they can be pulled into one coherent, capability-aware runtime without pretending that every backend or every memory tier behaves the same way.