This document is relevant for: Trn2, Trn3
Checkpoint Loading Framework Capability#
Overview#
The vLLM Neuron framework provides multi-process checkpoint loading capabilities that enable customers to quickly and efficiently load a SafeTensors checkpoint from disk, perform any transformations/sharding of weights, and send to each Neuron device.
Problem Statement#
There are a few challenges with checkpoint loading:
Memory Utilization - Naively in a multi-process setup, if each process loads a full checkpoint into memory, and then chooses its required slice from each tensor, this would result in high memory utilization across the system and be extremely slow (one exception for this is very small models).
Speed - Given that checkpoint loading is something that happens at server startup and while developers are iterating on model implementations, it is crucial to makes this run as fast as possible. Models such as Llama3.1 405B (~750 GB) currently take around 15-20 minutes to load from disk to device in the existing single-process NxDI.
Usability - We’d like the process of checkpoint loading to be intuitive to customers.
Solutions#
Memory utilization is the key problem that must be solved in order to run a large model using a multi-process setup. Fundamentally, we just need to have each process only load the weights it needs, rather than the full checkpoint. Below are two ways that we can achieve this:
Use Weight Format With Slicing - The Safetensors format allows for reading slices of weight tensors from disk.
Use Shared Memory - Another approach is to load the full checkpoint from disk to shared memory that each process can access.
With the approaches above, each process can specifically load only the portions of a weight that it needs into memory, solving the memory utilization problem.
Approach 1 - Weight Format With Slicing (w/ OS Page Cache)#
This approach requires each process (in parallel) to do the following for checkpoint loading:
Initialize Neuron Runtime in a parallel thread while loading OS page cache (this is a key optimization to enable fast sharding across non-contiguous dimensions)
Populate OS page cache with weights (this is an optimization)
Read the portion of each weight tensor needed (based on rank) from disk to memory
Process the tensor as needed (padding, fusing, etc.)
Send each weight tensor to device
Note: We can pipeline operations 2-5 to speed up checkpoint loading in some cases. The amount of pipelining that can be done depends on modeling code and checkpoint. For simple maximized pipelining, modeling code should match checkpoint.
Code#
For full examples, see the following examples:
weight_loading_page_cache.py- Optimized code that pipelines the execution of multi-process checkpoint loadingweight_loading_page_cache_ux.py- Example showing how weight transformations (padding, fusing) + sharding can be integrated into modeling code
# Shared Utility Function
def populate_os_page_cache(model_path: str, rank: int) -> None:
# Read through portion of model weights to load into OS page cache
System Resource Utilization#
To validate system resource usage is as expected with this approach, data was collected while running checkpoint loading for Llama3.1 405B.
We can see that the majority of time is spent loading data from disk to the OS page cache
We can also see that very little memory is used by the user processes thanks to the OS page cache

Benchmarking#
Below are some results from benchmarking (fully optimized setup), where E2E time is defined as the time it takes from the point when all processes have been spun up, till they have completed. Cold start is the first run (empty caches), while warm start is the second run (this reflects what loading times will look like when developing code)
Model |
TP Degree / Server Count |
Cold Start E2E Time |
Warm Start E2E Time |
|---|---|---|---|
GPT-OSS 120B |
64 / 1 |
12 seconds |
12 seconds |
GPT-OSS 120B |
8 / 8 |
25 seconds |
25 seconds |
Llama3 405B |
64 / 1 |
85 seconds |
61 seconds |
Llama3 405B |
32 / 2 |
100 seconds |
75 seconds |
For small models, we get bottlenecked by Neuron Runtime initialization. For large models, bottlenecks are disk reads and non-contiguous memory access (required for sharding)
Neuron Runtime Profiling#
From running with profiling enabled, we can see the pipelined execution in action. The blocks are a bunch of nrt_tensor_allocates and nrt_tensor_writes.

