Navaneeth Krishnan (@navaneethvb) header
Navaneeth Krishnan (@navaneethvb) profile picture

AI Infra & Evals @contextqa | Inference | Are you ready for this ?

Mumbai
Joined February 2024
Photo by Navaneeth Krishnan (@navaneethvb)Photo by Navaneeth Krishnan (@navaneethvb)Photo by Navaneeth Krishnan (@navaneethvb)Photo by Navaneeth Krishnan (@navaneethvb)Photo by Navaneeth Krishnan (@navaneethvb)Photo by Navaneeth Krishnan (@navaneethvb)Photo by Navaneeth Krishnan (@navaneethvb)Photo by Navaneeth Krishnan (@navaneethvb)Photo by Navaneeth Krishnan (@navaneethvb)Photo by Navaneeth Krishnan (@navaneethvb)
A lot of my LLM inference posts here were explaining how different parts of inference work. but i never really covered what implementing this stuff actually looks like in code. So I’m turning that into a repo. it’s for anyone who wants to learn inference hands-on from zero. check it out: github.com/navaneethkrishnan…
9
64
2
433
21,586
If you are still confused about the types of chips/processing units, this will solve it. It was a wonderful watch!
3
18
526
One interesting thing i found is how NVIDIA Blackwell GPUs allow CUDA thread blocks to steal work from other blocks that havent even started executing yet. And this is done using something called Cluster Launch Control (CLC). So let me put some light on how this works. firstly when we launch a CUDA kernel we specify how many thread blocks we want the GPU to execute so lets say we have 1000 tiles of data that need to be processed and we launch 1000 CUDA thread blocks where each block is responsible for processing one tile. So we have something like Block 0 → Tile 0 Block 1 → Tile 1 Block 2 → Tile 2 ... Block 999 → Tile 999 Now the thing here is that the GPU cannot necessarily run all 1000 blocks at the same time and each SM has limited resources like registers, shared memory and the maximum number of resident threads. So depending on how many resources our kernel uses, only a certain number of blocks can actually execute simultaneously. The remaining blocks are waiting to be scheduled. Normally when a block finishes its work, the hardware scheduler can launch another pending block but what if we could make an already running block take up the work of another block which hasnt even started yet? This is exactly what NVIDIA introduced with Cluster Launch Control on Blackwell. Lets say Block 0 is already running on an SM and processing Tile 0 and meanwhile Block 407 hasnt started executing yet. Now Block 0 can issue something called a cancellation request so basically it asks the GPU hardware to cancel the launch of one of the blocks that is still waiting to execute. And if the request succeeds, the hardware returns the ID of the cancelled block. For example Block 0 → Currently processing Tile 0 Cancellation request → Success Cancelled block ID → 407 Now Block 0 knows that Block 407 was supposed to process Tile 407 so instead of letting Block 407 launch separately, Block 0 can process Tile 407 itself. And since Block 407 has been cancelled, the GPU wont launch another block to process that same tile. So conceptually we have something like Block 0 → Tile 0 → Tile 407 And Block 407 never actually launches. Now here is another interesting part that is the cancellation request itself is asynchronous so the block can issue the request while its still performing useful computation. Once the result is ready, it uses a memory barrier to synchronize and check whether the cancellation succeeded. If it did, the block gets the cancelled block's coordinates and uses them to calculate which piece of work it should process next. And this can continue as long as there are pending blocks whose launches can be cancelled. Now u may ask why would we even wanna do this when the GPU already has its own hardware scheduler? well imagine a CUDA kernel where each thread block needs to perform some initialization before doing the actual computation. If we keep launching new blocks for every tile, we might end up repeating that setup work again and again. But with Cluster Launch Control, the blocks already running can keep processing additional tiles without launching a fresh block for each one. So depending on the kernel, we can reduce repeated initialization and thread block overhead. It also gives us a way to build work stealing into the kernel itself instead of relying on a fixed amount of work per block. Now there are some important limitations here too. Firstly, we cannot just cancel any random thread block which is already running. CLC only allows us to cancel a block or cluster that hasnt started executing yet. Also the cancellation request isnt guaranteed to succeed. For example if there are no eligible pending blocks left, or the GPU needs to schedule a higher priority kernel, the request can fail. And this also doesnt mean every CUDA kernel automatically becomes faster on Blackwell. The actual benefit depends on the workload, how much setup work each block performs and the overhead of the cancellation mechanism itself. Image Source: NVIDIA CUTLASS Documentation, Blackwell Cluster Launch Control
2
13
62
2,508
Apparently on NVIDIA Hopper and Blackwell GPUs u can load a piece of data from GPU global memory and send it to the shared memory of multiple CUDA thread blocks using just ONE memory transfer operation. And this is done using something called TMA Multicast. So let me put some light on how this works. Firstly TMA stands for Tensor Memory Accelerator, which NVIDIA introduced with its Hopper architecture. Its basically a hardware engine that can move large chunks of data between GPU global memory and shared memory asynchronously. Normally when we write a CUDA kernel, threads have to load the required data into registers or shared memory before performing computation. But with TMA, even a single thread can initiate a transfer of an entire tensor tile and let the hardware handle the actual data movement. Now here is where things get interesting. Lets say we are doing matrix multiplication on the GPU and we have two matrices A and B and wanna calculate C = A × B And we divide our output matrix C into smaller tiles so that different CUDA thread blocks can work on different parts of it. Lets take 4 thread blocks arranged in a 2×2 grid. Block 0 → C[0,0] Block 1 → C[0,1] Block 2 → C[1,0] Block 3 → C[1,1] Now to calculate C[0,0], Block 0 needs the corresponding tiles from matrices A and B. Block 0 and Block 1 are calculating different output tiles in the same row. So they actually need the SAME tile from matrix A for a given step of the matrix multiplication and similarly Block 0 and Block 2 need the same B tile since they are working on output tiles in the same column. Now without multicast, each block could independently load the data it needs into its own shared memory. So even if two blocks need the exact same A tile, both would issue their own memory transfer. Ofc the data might already be sitting in L2 cache, so this doesnt necessarily mean we are reading it from HBM twice. But we are still issuing separate transfers to the blocks. Now what if we could load that A tile once and deliver it to both Block 0 and Block 1? Thats where TMA Multicast comes in. On Hopper and newer NVIDIA GPUs, CUDA supports something called Thread Block Clusters. Basically multiple thread blocks can be grouped together so they can cooperate and access each other's shared memory through the cluster memory address space. And TMA has a multicast mode where one block can initiate a transfer from global memory and the hardware delivers that same tile into the shared memory of multiple blocks within the cluster. So in our example A tile 0 → Block 0 and Block 1 A tile 1 → Block 2 and Block 3 B tile 0 → Block 0 and Block 2 B tile 1 → Block 1 and Block 3 Instead of 8 separate tile transfers for these 4 blocks, we can do 4 multicast transfers. Now remember each block still has its own shared memory. We are not making all the blocks read from one single shared memory buffer. The TMA engine places the data into the participating blocks' own shared memory. But how does it know which blocks should receive the data? Well TMA Multicast uses something called a multicast mask. This mask basically tells the hardware which blocks within the cluster should receive the transferred tile. For example if we have a cluster of 4 blocks, a mask like 0011 can select Block 0 and Block 1 as the receivers. So one block initiates the multicast operation and both blocks receive the same tile. And since TMA transfers are asynchronous, the blocks need proper synchronization before they start using the data. The hardware uses memory barriers to signal when the transfers are complete. Now this obviously doesnt mean we can multicast data to any random CUDA block running anywhere on the GPU. The participating blocks need to belong to the same thread block cluster, and the hardware needs to support this feature. Also multicast isnt automatically faster for every workload. If blocks dont reuse the same data, or the extra cluster synchronization and resource requirements outweigh the saved memory transfers, there might not be much benefit. But for something like matrix multiplication where multiple blocks keep needing the same tiles from A and B, this can reduce redundant data movement. Image Source: Colfax Research, CUTLASS Tutorial: GEMM with Thread Block Clusters on NVIDIA Blackwell GPUs, Figure 2.
5
18
169
6,114
Apparently u can improve matrix multiplication performance on an A100 from around 220 TFLOPS to 245 TFLOPS just by changing how GPU thread blocks are mapped or arranged to the work. And this is done using something called 'Thread Block Swizzling' So let me put some light on this.... Lets say we are performing a matrix multiplication on the GPU and we have two matrices A and B where we wanna calculate: C = A × B. Now instead of making a single CUDA thread block calculate the entire output matrix, we divide C into smaller tiles. And each thread block is responsible for calculating one of these tiles. Lets say our output matrix C is divided into a grid of 4 rows and 4 columns of tiles. Normally we could map our thread blocks to these tiles in a simple row major order. So conceptually the work looks like Block 0 → C[0,0] Block 1 → C[0,1] Block 2 → C[0,2] Block 3 → C[0,3] Block 4 → C[1,0] And so on. Now here is where things get interesting coz to calculate C[0,0] the kernel needs data from the corresponding tiles of A and B and to calculate C[1,0] we still need the SAME column tiles of B but just with different row tiles from A. So there is actually an opportunity to reuse some of the data we already fetched into the GPU's L2 cache. But with our simple row major mapping, we process C[0,0], then C[0,1], C[0,2], C[0,3] before getting to C[1,0]. And by the time we get back to needing those earlier B tiles some of them might have already been evicted from L2 cache. Which means we may end up fetching the same data from HBM again. Now what if we changed our block mapping? Instead of going across the entire first row, we could group a few rows together and process tiles within that group. So something like Block 0 → C[0,0] Block 1 → C[1,0] Block 2 → C[0,1] Block 3 → C[1,1] And so on. Now blocks working on C[0,0] and C[1,0] need the same B tiles and so by keeping these operations close together we have a better chance of finding the required B data already sitting in L2 cache. And thats basically the idea behind thread block swizzling. We change how block IDs map to the output tiles so that blocks accessing overlapping data are more likely to execute close together. Ofc CUDA doesnt guarantee the exact physical execution order of thread blocks. We are changing the mapping of work to block IDs here, which can help improve cache locality. Triton's matrix multiplication tutorial actually shows an example where grouped block ordering improved performance from around 220 TFLOPS to 245 TFLOPS on an A100. Thats more than 10% improvement from getting better L2 cache reuse. Ofc swizzling isnt guaranteed to improve every kernel. It depends on the matrix sizes, cache capacity, tile layout and how much data can actually be reused. Image Source: Triton Documentation, Matrix Multiplication, L2 Cache Optimizations (Grouped vs Row-Major Ordering).
3
5
28
929
If you are learning CUDA or GPU computing this is a really great video to build intuition about how the hardware actually performs even the most basic binary operations from scratch. It goes from transistors to logic gates and eventually how they come together to build a CPU
1
5
1
61
1,326
Imagine 32 GPU threads accessing shared memory at the same time but instead of serving all 32 memory accesses together, the GPU ends up splitting them into 32 separate operations. This is something called Shared Memory Bank Conflicts in CUDA. So let me put some light on how this works and why its painfull for us. firstly CUDA shared memory is a small and fast on-chip memory that threads within the same block can use to share data. (this is not the DRAM) and the thing here is that shared memory is divided into something called memory banks. on modern NVIDIA GPUs we generally have 32 shared memory banks and consecutive 32-bit words are mapped to consecutive banks. So conceptually it looks something like Bank 0 → Word 0 Bank 1 → Word 1 Bank 2 → Word 2 ... Bank 31 → Word 31 And so on.... now the reason we have these banks is that different threads in a warp can access different banks at the same time and lets say we have 32 threads in a warp. Thread 0 accesses Bank 0 Thread 1 accesses Bank 1 Thread 2 accesses Bank 2 ... Thread 31 accesses Bank 31 so in this case its completely fine since every thread is accessing a different bank but you would wonder what happens if all 32 threads try to access different addresses that belong to the same bank? or most of them trying to access the same bank ? this usually results into bank conflics The hardware needs to split that memory request into multiple conflict free requests and in the worst case we can have a 32 way bank conflict. So even though we are using shared memory which is supposed to be extremely fast, our memory access pattern is making things much slower for our gpu and workload. Now lets understand this with an actual CUDA example. Suppose we are doing a matrix transpose and have a shared memory array like shared float tile[32][32]; Each float occupies 4 bytes and the matrix is stored in row major order and lets say 32 threads in a warp are trying to read the first column. Thread 0 → tile[0][0] Thread 1 → tile[1][0] Thread 2 → tile[2][0] ... Thread 31 → tile[31][0] Now here is where things get interesting. since each row contains 32 floats the distance between two consecutive elements in the same column is 32 × 4 = 128 bytes. And remember the shared memory bank mapping repeats every 32 words. So the bank index for these accesses becomes Thread 0 → Bank 0 Thread 1 → Bank 0 Thread 2 → Bank 0 ... Thread 31 → Bank 0 All 32 threads are accessing DIFFERENT memory addresses but every address maps to Bank 0. So we end up with a 32-way bank conflict. Now how do we fix this? We literally change our shared memory declaration from shared float tile[32][32]; to shared float tile[32][33]; Yes just one extra column. coz now each row contains 33 floats instead of 32 so the distance between consecutive rows becomes 33 words. And since the bank index is calculated modulo 32, moving by 33 words means moving to the next bank. So now Thread 0 → Bank 0 Thread 1 → Bank 1 Thread 2 → Bank 2 ... Thread 31 → Bank 31 All 32 threads are now accessing different banks. And the 32-way bank conflict disappears for this column access we are still processing the same 32×32 matrix and haven't changed the actual computation. We just allocated a little extra shared memory to change how the addresses map to the banks. Ofc this doesnt mean adding padding to every shared memory array will make ur CUDA kernel faster. It depends on how threads access the array and whether those accesses actually cause bank conflicts. Also if multiple threads read the exact same address, the hardware can broadcast that value without a bank conflict. Image source: NVIDIA CUDA C++ Programming Guide, Irregular Shared Memory Accesses diagram. (Lei Mao)
2
5
57
1,484
Part 05: 2D and 3D CUDA Implementation is out. (CUDA repo) I've covered how CUDA threads map to matrices and 3D grids using dim3 including thread and block coordinates, row-major memory indexing, 2D matrix addition. Repo: github.com/navaneethkrishnan…
1
4
38
980
i'm terrible at learning from my mistakes but still somehow convinced Id like sushi this time only to regret it again for the 10th+ time !! genuinely don't understand the hype. what do people even like about it?
3
198
When people think of CUDA threads on a GPU they usually imagine a single dimensional sequence of threads which is wrong! What if I told you that CUDA threads can actually be organized in multiple dimensions, using x, y, and z axes? And it doesn't stop at threads. CUDA blocks and grids can also be organized in 1D, 2D, or 3D. Let's understand how this works and why even we needed this in the first place In CUDA every thread has three built-in coordinates: (actual cuda notations) threadIdx.x. threadIdx.y threadIdx.z These identify a thread's position within its block. For eg: instead of organizing 256 threads in a single row we could arrange them as a 16 × 16 grid. Both configurations contain 256 threads but the way we index them is different. Now, blocks work similarly. Each block has its own coordinates, accessible through blockIdx.x, blockIdx.y, and blockIdx.z. We also have: blockDim: Dimensions of a block in threads. gridDim: Dimensions of the grid in blocks. For example, we could launch a kernel with: dim3 threads(16, 16, 1); dim3 blocks(4, 4, 1); kernel<<<blocks, threads>>>(); (this executes the kernel with the given configurations) This creates a 2D grid of 4 × 4 blocks, with each block containing 16 × 16 threads. That's 4,096 CUDA threads in total. Now imagine processing a 64 × 64 image. Instead of manually assigning every thread a pixel number, each thread can calculate its pixel coordinates using: int x = blockIdx.x * blockDim.x + threadIdx.x; int y = blockIdx.y * blockDim.y + threadIdx.y; The same concept extends to 3D indexing, which is useful when working with volumetric data or scientific computing One important thing to understand is that these dimensions are logical indexing coordinates. Threads aren't physically moving along x, y, or z axes inside the GPU. They simply provide a convenient way to organize parallel work and map CUDA threads to the shape of the data we're processing. If you are following my CUDA series tomorrow, I will put up the 2D , 3D and matrix addition code implementations. Image reference: Jeremiah van Oosten, CUDA Thread Execution Model , 3Dgep
1
9
36
828
Part 7A: Paged KV Cache Block Management is out! In this part, we implemented block allocation, free lists, per-request block tables, dynamic KV growth, and a block-aware continuous batching scheduler. Repo: github.com/navaneethkrishnan…
3
14
1
70
1,905
One thing I've noticed while debugging C++/CUDA for LLM inference is that figuring out which code actually compiles and runs is a headache, especially with templates, overloads, and different build configurations. @ByteAsk approaches this by using the actual build context rather than relying on text search. It can also run tools like gdb, sanitizers and perf to debug and validate changes. Their evaluations even include Tencent's ncnn inference framework. On a separate benchmark of 72 real C++ bugs, ByteAsk matched Codex CLI's fixes using the same model, with 78% fewer tokens and 68% lower cost. Would be interesting to see how this performs on larger inference codebases like vLLM or SGLang.
Introducing @ByteAsk Your AI C++ engineer, and a swarm of them > SOTA on multi SWE bench (C/C++) > 60% fewer tokens wrt cc/codex > auto debug/perf/optimize/test with native C/C++ tools Free plan. Open Source. github.com/ByteAsk/cli
1
3
29
1,602
Part 04: Scaling CUDA Kernels with Grid-Stride Loops is out. I've covered how to scale CUDA kernels for arbitrary input sizes using ceiling division, multi-block execution, bounds checking and grid-stride loops, including how fewer GPU threads can process more elements. Repo: github.com/navaneethkrishnan…
2
11
94
2,279
In LLM inference the exact same model running on the exact same gpu can go from being limited by gpu compute to being limited by memory bandwidth just coz it switched from prefill to decoding. And this has to do with how GEMM and GEMV operations work. So let me put some light on this. lets say we are serving an 8B parameter model on an H100 GPU and now when a user sends a prompt containing 2048 toks the model first needs to process all these tokens during the prefill phase. And since we have 2048 toks to process together the linear layers can perform something called GEMM (General Matrix Matrix Multiplication). basically instead of processing one token at a time, we take the hidden states of all these tokens as a matrix and multiply it with the model's weight matrix. Lets say our hidden dimension is 4096 and our input matrix would have a shape of X = [2048, 4096] and lets assume our weight matrix is W = [4096, 4096] So when we do X × W, we are performing a matrix matrix multiplication. Now why does this matter? Coz the gpu can load portions of the weight matrix and reuse those weights while doing computation for many different tokens and since there are a lot of multiply and accumulate operations happening, the GPU has enough work to keep its compute units busy. This is why prefill is often compute bound. But now lets say the prompt has been processed and the model starts generating tokens. We are now in the decode phase. And unlike prefill where we processed 2048 tokens together, for a single request we are only processing ONE new token per forward pass while reusing the previous KV cache. so our input to the same linear layer now looks like X = [1, 4096] W = [4096, 4096] now instead of multiplying two large matrices, this operation is basically GEMV (General Matrix Vector Multiplication) and here is where the problem starts. we still need to read the weight matrix from GPU memory but now we are doing computation for just one token so compared to prefill we have much less computation happening for the amount of weight data being loaded and the GPU might spend more time waiting for the weights to be fetched from HBM than actually doing the multiplication. so even if the GPU has absurd amounts of compute available, it cant fully use it coz the operation is limited by memory bandwidth and this is why single request decoding is often memory bandwidth bound. Now u may ask what happens if we have 64 users decoding at the same time? Well now the inference engine can batch those 64 requests together. So instead of having an input shape of [1, 4096], we might have X = [64, 4096] And suddenly we are back to doing GEMM for those linear layers. The same weight matrix can now be reused across 64 tokens from different requests instead of using it for just one token. So we get more computation done for each amount of weight data being loaded. Ofc this doesnt mean decoding is always compute bound with larger batches. It depends on the batch size, model, GPU and even the attention workload. But this is one of the reasons why continuous batching can improve inference throughput so much. Image source: USENIX, Wafer-Scale AI Compute: A System Software Perspective
12
7
70
1,552
Imagine running 100 copies of the same LLM just coz 100 different users wanna use their own fine tuned version of it and the funny thing here is that most of the weights in these models are literally the same but we are still loading them again and again into GPU memory. This is one of the problems Multi-LoRA Serving tries to solve. so let me put some light on how this actually works. Lets say we have a Llama 8B model and 100 different customers who have fine tuned it for their own tasks. One for coding, another for legal documents, another for customer support and so on..... now if we serve each of these as a completely separate model we would need to keep loading separate copies of the model weights which will be waste of resources and remember an 8B model in BF16 alone takes around 16GB just for the weights. So having 100 separate copies would mean around 1.6TB of raw model weights across our serving setup. But do we actually really need to do that?? Well not if those customers are using LoRA adapters on the same base model. During LoRA fine tuning we dont update all the original model weights. instead we keep the base weights frozen and train these much smaller matrices called A and B which are used to calculate an additional update to the output of certain layers. So now instead of storing an entirely different 8B model for every customer, we have - 1 shared base model - 100 different LoRA adapters And this is where Multi-LoRA Serving comes in. Lets say we have 3 requests coming in. - Request A wants LoRA 1 - Request B wants LoRA 2 - Request C wants LoRA 3 Instead of running 3 different copies of the model the inference engine can batch these requests together and process them using the same base model weights. But how does it make sure each request gets its own fine tuned behaviour? Each request is associated with its LoRA adapter. So during the forward pass the GPU computes the normal base model operations and also applies the low rank update belonging to that particular request. For example at a LoRA adapted linear layer we have something like output = xW + xAB Here W is the shared base weight matrix and A and B are the adapter matrices so all 3 requests use the same W but their A and B matrices are different and engines like vLLM and SGLang have kernels which can process different LoRA adapters within the same batch instead of having to run every adapter separately. Video source: Hugging Face, TGI Multi-LoRA: Deploy Once, Serve 30 Models
8
5
25
1,051
Part 03: Vector Addition in CUDA is out. I've covered how to perform vector addition on the GPU using CUDA threads, including device memory allocation, host to device transfers, global thread indexing, kernel launches and bounds checking. Repo: github.com/navaneethkrishnan…
2
7
42
1,286
A lot of my CUDA/GPU posts explain how kernels, threads and memory work. but i never explained how it looks like in code so im turning that into a repo with runnable CUDA C++ examples, from basics to GEMM, profiling and transformer kernels. check it out: github.com/navaneethkrishnan…
2
10
65
2,373
This is one of the brutal LLM inference problems i came across where even if u have already loaded the entire model weights into GPU memory a worker crash can make the server spend several mins loading the same model all over again. And this gets even worse when we are serving some 100B+ parameter model across multiple GPUs. But what if we could recover the inference engine without having to reload the model weights again? This is something NVIDIA has been working on with 'Shadow Engine Recovery' in Dynamo. So lets understand how exactly this works. Lets say we are serving a large model like GLM-5.2 across multiple B200 GPUs. now normally when we start an inference engine there are a bunch of things which needs to happen before it can actually start serving requests. we need to load the model weights into GPU memory, initialize CUDA contexts, setup NCCL communicators, compile kernels, capture CUDA Graphs and a bunch of other stuff and once all this is done the engine starts processing requests. But now imagine the inference process crashes coz of some software error but the GPU itself is completely fine and so is the machine. But the CUDA context owned by that process gets destroyed and normally the GPU allocations belonging to it are also released so now when we restart the worker, we have to initialize everything again including loading the model weights. And depending on how large the model is this can easily take minutes. Now how exactly does Shadow Engine Recovery deal with this? There are 2 things involved here. First is something called GPU Memory Service or GMS. Instead of having the inference process directly own the physical GPU memory where the model weights are stored, GMS manages these allocations separately using CUDA Virtual Memory Management. So even if our main inference process crashes, the physical memory holding the weights doesnt have to disappear with it so another process can map those same weights into its own GPU virtual address space. Now this solves the weight loading part but what about all those other initialization steps? This is where the Shadow Engine comes in. Instead of waiting for the main engine to crash and then starting another engine from scratch, we already keep a second engine initialized on the same GPUs. This shadow engine has its own CUDA context and has already gone through things like NCCL setup, kernel initialization and CUDA Graph capture. But it isnt actively serving requests. It just stays there while our main engine is doing the actual inference and important thing here is that both engines can use the same physical model weights through GMS. So we dont need another full copy of the model weights sitting in GPU memory just to keep the backup engine ready. Now lets say the main engine crashes. Instead of starting a completely new process and loading hundreds of GBs of weights again, the shadow engine can take over using the existing weights. It still needs to prepare its serving state and get registered with the router but most of the expensive startup work was already done. And NVIDIA actually benchmarked this with GLM-5.2 running on B200 GPUs. In their setup when one of the serving workers was killed, a normal cold restart took around 283 seconds. but with Shadow Engine Recovery the worker was serving again in just 7.3 seconds. so nearly 39x faster recovery. But there is one limitation here. The shadow engine doesnt preserve the crashed worker's KV cache or the requests which were already being processed. So even though we can recover the serving worker much faster, we arent exactly continuing the old requests from where they stopped. Image source: NVIDIA Technical Blog, 'Restore LLM Inference Capacity in Seconds with Shadow Engine Recovery in NVIDIA Dynamo'
7
4
1
54
2,414
Part 6: Code implementation of KV Cache Management is out I've covered KV memory allocation, growth and release along with capacity aware scheduling using real model inference and DynamicCache. github.com/navaneethkrishnan…
2
15
110
4,000