From 15% to 90% GPU Utilization: Fix the Data Pipeline, Not the Model
Description
Your GPUs might be waiting on your data, not your model. This pipeline went from 15% to 90% GPU utilization. Tarun Sunkaraneni from Amazon AGI shows that the hardest part of fast multimodal training often isn't the GPU at all, but keeping it fed with data. Training a Qwen3-VL-style model on images stored in S3, the baseline pipeline spent about 85% of its time waiting on data, mostly loading, decoding and resizing images one at a time. He fixes the bottlenecks one by one: concurrency with asyncio and Ray actors, prefetching so data is ready before the trainer asks, and Ray's object store to stop copying big image tensors between processes. Then, at production scale, a new bottleneck appears on a single machine's network card, solved by spreading workers across nodes and using zero-copy reads, which gave another 50% throughput. In this talk: • Why multimodal training is often CPU- and IO-bound, not GPU-bound • Concurrency, prefetching and zero-copy transfer with Ray • Choosing between asyncio, threads and processes around the GIL • Why some settings only pay off at scale SPEAKER Tarun Sunkaraneni, Amazon AGI GitHub: https://github.com/TSunny007 Website: https://tsunny007.github.io/ LINKS Ray: https://www.ray.io CHAPTERS 0:00 Intro 0:45 Is training really GPU-bound? 1:10 Four bottlenecks 1:50 Why multimodal is CPU-heavy 2:45 The wait-time ratio 3:35 Our stack 4:10 The data 4:35 System layout 5:15 Baseline: 15% utilization 6:20 Fix 1: concurrency 7:05 Async, threads or processes? 8:10 Asyncio plus Ray actors 9:15 Fix 2: prefetching 10:40 Fix 3: zero-copy with Ray's object store 12:20 Recap: 85% to 20% wait time 12:55 Scaling up: a new bottleneck 13:25 The network card bottleneck 14:35 Spread scheduling and zero copy 15:35 Lessons Recorded at the AI Engineer World's Fair 2026 in San Francisco. Subscribe for more talks from the engineers building with AI. AI Engineer: https://ai.engineer YouTube: https://www.youtube.com/@aiDotEngineer X: https://x.com/aiDotEnginee
Summary
Generated by gpt-5.6-terraAt-a-Glance
- Verdict: Watch fully
- Core thesis: For multimodal SFT, GPU underutilization is usually a data-pipeline problem—IO, CPU preprocessing, queueing, serialization, and network placement—not a model or kernel problem.
- Why it matters: The speaker demonstrates a staged path from roughly 15% GPU utilization to 90% by removing pipeline wait time, then gains another 50% throughput at production scale through Ray scheduling and zero-copy retrieval.
- Best use: Use this as a practical design review for any GPU-backed multimodal, agent-evaluation, or large-scale inference/training pipeline where workers prepare data remotely and accelerate hardware appears inexplicably idle.
Executive Summary
The talk frames multimodal training throughput as a producer-consumer systems problem. Before a Qwen 3 VL-based training loop can run, the system must load images from S3, decode and resize them, normalize vision inputs, tokenize text, and transport tensors to Megatron data-parallel ranks. In the naive serial implementation, those upstream steps take more than 100 seconds per batch against 15-20 seconds of training, leaving GPUs at about 15% utilization.
The solution is layered rather than a single optimization. First, match concurrency to the actual bottleneck: async IO for object-store fetches and Ray actors/processes for independent CPU-side image and text processing. This reduces data-fetch time to roughly 40 seconds per batch and yields a reported 25% speedup, but it does not eliminate gaps because work only begins after the trainer asks for a batch.
Second, prefetch processed examples into a background queue so the producer stays ahead of the trainer. This makes batch data effectively available on demand, removing loading and transformation time from the critical path. But it exposes a new bottleneck: multimodal tensors are large, and Ray's default by-value returns cause repeated pickling and copies between worker, coordinator, and trainer, increasing communication overhead and risking generator OOMs.
The final design uses Ray object references to avoid needless tensor round trips, then revisits placement at production scale. Co-locating workers initially helped local transfer but eventually saturated a node's network interface when data-parallel ranks, streams, and batch size were increased fourfold. Spreading workers across nodes plus zero-copy retrieval produced a further 50% throughput improvement at scale, illustrating the central operating lesson: profile each scaling stage because the right setting can reverse as the bottleneck shifts.
Key Takeaways
- Claim: Measure pipeline wait time, not just GPU utilization or training-step time, because multimodal GPU starvation is often caused before the model receives a batch. | Evidence: The speaker defines wait time ratio as data preparation plus GPU-transfer time divided by total pipeline time. The naive path spent over 100 seconds fetching/preparing a batch versus 15-20 seconds training, implying an approximately 85% wait ratio and 15% GPU utilization. | Implication: Instrument end-to-end batch latency into load, transform, transfer, and train phases before spending engineering effort on kernels or model-level training optimization.
- Claim: Use different concurrency mechanisms for different work rather than applying threads, async, or processes indiscriminately. | Evidence: The workload separates S3 image retrieval from CPU-side decode, vision preprocessing, and text tokenization. The implementation uses async IO for network fetches and Ray actors as multiprocessing workers for processing independent samples; the speaker notes threads only help CPU tasks that actually release Python's GIL. | Implication: Build pipeline stages around resource type—network, CPU, memory, or GPU—and benchmark the specific libraries in use rather than adopting a generic concurrency template. | Caveat: Whether a library releases the GIL is operation-specific, so thread suitability must be validated rather than assumed; examples cited include Hugging Face tokenizers, PIL Transforms, and some Pandas operations.
- Claim: Prefetching is the mechanism that removes recurring trainer-visible data stalls after concurrent processing alone has improved throughput. | Evidence: After adding concurrency, fetch/prep still took about 40 seconds per batch and gaps accumulated across steps. A background thread then filled a queue ahead of the consumer at a producer rate above training consumption, resulting in close to zero seconds of fetching and processing on the per-batch critical path. | Implication: Treat prefetch depth, queue persistence, and resume behavior as first-class production design concerns; a fast worker pool is insufficient if it is request-driven by the trainer. | Caveat: Prefetch queues complicate checkpoint/resume semantics and impose a cold-start period while the queue fills.
- Claim: After eliminating IO and CPU stalls, process-boundary copies become a material multimodal bottleneck and can cause memory failures. | Evidence: Each image array was being pickled on the worker, copied to the coordinator, then re-pickled for the trainer. Since multimodal tensors can be megabytes per sample, default by-value returns created unnecessary memory copies per sample and per step, with the data generator capable of OOMing. | Implication: Audit serialization paths and object ownership whenever worker-produced payloads are large; throughput improvements upstream can merely shift pressure into memory and interprocess communication.
- Claim: Ray's object store and object references can reduce transport overhead by keeping tensors out of the driver/head-node round trip. | Evidence: The proposed pattern passes an object reference rather than returning each sample by value: the driver holds a pointer, the tensor does not round-trip through the head node, and Megatron data-parallel ranks retrieve it directly from the Ray store. The team also removed an extraneous object-store put introduced by its prefetcher. | Implication: For distributed training or evaluation systems, prefer reference-based handoff and direct consumer retrieval when payloads are large, while explicitly mapping where object-store puts and gets occur.
- Claim: A configuration that appears ineffective at small scale can be decisive at production scale because node-level network bottlenecks emerge only under higher fan-out. | Evidence: When the team increased data-parallel ranks fourfold, added 200 data streams, and increased batch size fourfold, co-located generator and worker pools saturated a node's NIC. Ray's default preference for co-locating workers amplified this. Zero-copy retrieval and spread scheduling did not help individually in small tests, but together delivered an additional 50% throughput at scale. | Implication: Run ablations across a scaling ladder, including placement policy and network telemetry; do not promote local benchmark winners directly into production topology. | Caveat: The transcript does not provide the exact Ray flag names, hardware topology, queue depth, node count, or absolute final samples-per-second, so the claimed gains should be treated as architecture-specific until replicated.
Detailed Brief
Final pipeline architecture
- Claims: The target system is described as concurrent, eager, and aware of data-access patterns.; The data generator fans out partitions to Megatron data-parallel ranks, which collate batches and perform forward/backward passes while Megatron handles model-weight parallelism.; The intended end state is not maximum nominal GPU utilization as an isolated metric, but stable training in which data does not gate accelerator work.
- Evidence: Training examples are JSONL records with image paths relative to the example location, backed by S3 object storage.; The example workload uses Qwen 3 VL with Chat VQA and multi-turn vision-language conversations.; The speaker reports moving wait ratio from 85% to 20% before the final scale-specific placement optimizations, and characterizes the overall run as moving from 15% to 90% GPU utilization.
- Caveats: The presentation assumes Megatron's model-parallel behavior is a functioning black box; it does not analyze interaction with gradient synchronization, storage-cache consistency, data determinism, or fault recovery.; The reported utilization and throughput improvements are not accompanied by dataset size, image-size distribution, model size, storage latency distribution, or cost-per-trained-token metrics.
- Implications: The architecture generalizes beyond multimodal SFT to pipelines where expensive, independently transformable artifacts must be produced ahead of a highly parallel consumer.; A useful operational metric is the fraction of wall-clock time the consumer waits for data, alongside GPU utilization, queue depth, object-store memory, NIC bandwidth, and host CPU saturation.
Bottleneck progression as an operating model
- Claims: Solving a bottleneck should be expected to reveal the next one rather than complete the optimization effort.; The speaker's observed progression was throughput/serial work, then trainer wait time, then memory pressure from copies, then retrieval and network costs.
- Evidence: Concurrency reduced serial S3 and preprocessing work but still left expanding gaps between training steps.; Prefetch removed preparation from the request path but made unnecessary object movement and memory duplication more visible.; Disaggregation became necessary only after higher data parallelism and stream count exposed NIC saturation.
- Caveats: There is no universal ordering: a different storage system, payload type, host CPU allocation, or model compute time can make the first binding constraint different.
- Implications: Optimization roadmaps should reserve time for repeated profiling after every material architecture change instead of treating an initial flame graph as a permanent diagnosis.
Notable Concepts & Terms
- Wait time ratio: The talk's core diagnostic: data preparation plus transfer time divided by total batch-pipeline time. It makes upstream starvation visible relative to actual training work.
- Ray actors: Stateful worker processes used here for parallel CPU-side image decoding, vision preprocessing, and tokenization without building interworker coordination primitives from scratch.
- Python GIL: The Global Interpreter Lock determines whether threads can provide meaningful CPU parallelism for a particular library call; it is why the speaker distinguishes threads from processes.
- Prefetch queue: A background producer buffer that prepares examples ahead of trainer demand so data preparation no longer sits on the training critical path.
- Ray object store / object reference: A reference-based data handoff mechanism intended to avoid returning large multimodal tensors by value through the coordinator or head node.
- Zero-copy retrieval: A scale-sensitive retrieval configuration that, in combination with spread scheduling, reduced data-path overhead in the production-scale experiment.
- Spread scheduling: Distributing Ray workers across nodes rather than accepting default co-location, used to avoid concentrating processing traffic on a single node's NIC.
- Scaling ladder: The practice of re-running configuration ablations at progressively larger deployment sizes because topology, network, and scheduling constraints change the optimum.
Operator Notes / Why Ken Should Care
- Add an end-to-end batch trace to GPU workloads that records S3/object-store fetch, decode/transform, tokenize, queue wait, serialization/copy, host-to-device transfer, train time, CPU saturation, object-store memory, and per-node NIC utilization.
- For any Ray-based high-payload pipeline, review whether task or actor returns are passed by value; replace avoidable coordinator-mediated payload movement with object references and direct consumer retrieval.
- Define prefetch checkpoint/resume semantics before enabling aggressive buffering, including what happens to queued examples after failure and how data ordering or epoch reproducibility is preserved.
- Create a scaling-ladder benchmark that varies data-parallel ranks, stream count, batch size, worker placement, and zero-copy settings; require node-level network metrics before selecting a production Ray scheduling policy.
- For agent or multimodal evaluation systems, separate IO-bound retrieval from CPU-bound preprocessing into independently observable and autoscalable stages instead of embedding both inside the model-serving worker.
Source/Metadata
- Title: From 15% to 90% GPU Utilization: Fix the Data Pipeline, Not the Model
- Transcript words: 3907
- Duration seconds: 1021
- Timestamp note: No usable timestamps or chapters were present in the supplied transcript; substantial portions of the latter half repeat earlier content.
Transcript
Hello everyone. Thank you for joining me here. Yeah, today I'm going to talk about Ray Actors, Vision Tokens, and the GIL. Engineering a multimodal SFT data pipeline that keeps the GPUs busy. So there's a lot of talk about how to optimize training paradigms, but I want to give a different perspective on the whole ecosystem of what it takes to get a model trained. And so the question I'm going to be asking here is: does your training loop really depend on the GPUs right now? Is it blocked on the GPUs? And I think we're going to learn that in this experiment, the hardest part of optimizing multimodal training throughput is not necessarily kernel optimization. It is making sure that the GPUs are constantly fed with data. So let's go over the overview of what this topic will be about. We will establish a baseline multimodal training pipeline. And then we will encounter bottlenecks and address them one at a time. Loosely they are: one, concurrency. How fast can you process one image before feeding it to the model? Two, prefetching. How can we make sure that we have data on demand? Three, how can we minimize data copies across different processes? And four, additional framework optimizations. Just tweaking your settings. So let's set up our premise. We all know that GPUs incur expensive costs and we generally want to maximize their utilization while we have them at hand. Multimodal processing is different than text only because there's a lot of CPU intensive operations that have to happen before you actually feed the model the data. So whether that is loading, resizing, or normalizing images using a library like PIL. For audio, you do a lot of loading and cropping using NumPy arrays. And then videos are some sort of combination of both. And it's also true that usually your training clusters have a lot more CPUs than GPUs at hand. And yet the GPU is what is starving in this pipeline. So today we're going to introduce this equation called wait time ratio, which I formulate as the time it takes to prep your data and transfer it to the GPUs, divided by the time it takes to do both of those and the train as well. So the denominator is your total pipeline. We're going to see that during our run we will go from a utilization of 15% to utilization of 90%. So our baseline spends 85% of its time on data acquisition, whereas after we do these optimizations less than 10%. And so for the scope of this talk, GPUs are not the goal. Making sure that data is never the bottleneck is the goal. And so here's a little bit of background as to what our stack will look like. We kind of take a QWEN 3 VL base model and try to train it on the paradigms of Chat VQA and multi-turn VLM conversations. So to recap, before the GPUs do any math, we have to load the data, we have to transform the data, and then we have to transport it to the GPUs. Okay, this is an overview of what our data actually looks like. So we will be using JSON-L files, and then images are linked relatively to where the example lives. And then we're going to assume that our data is just stored in S3. In this example, it seems like image 33471.jpg seems to be a picture of a blue bus. Yeah, so this is our system layout. On the left, we have a data generator, which is responsible for the data loading and data transporting. And that's labeled as fan out to the Megatron data parallel ranks. So the parallel ranks receive partitions of the data as decided by the coordinator. It collates it, performs forward pass and backward pass on this data. So Megatron takes care of optimizing the model weights across the DP ranks, and we're going to assume that it's working as a black box. So let's start with the naive baseline path. For each example, we fetch the images from object store. We tokenize it, we resize the images, normalize them, and then feed them to the model. Yeah, and then when we do that, we can see that there's serial operations in the red, which is namely getting all the images one by one and then processing them one by one. So if your trainer is asking for a batch size of 256, then you have to serially process all these images. And then we can see that our train time is somewhere between 15 to 20 seconds. However, the time spent to actually fetch the data is more than 100 seconds. So that's why we result in only 15% utilization of our GPUs. And then you can even see a profiling flame graph that we spend most of the time doing S3 loads. And then you can see a little tail at the end about loading the actual image on the PIL library. So okay, solution one. Let's try to add some concurrency to this. Instead of those red singular serial processes, let's try to parallelize it by having a worker pool. So when you request 256 examples, maybe let's just process all of those at once. Yeah. So for example, first sample, we have two costs. One is fetching the images. Two is processing. So that's decoding, vision pre-processing, and then tokenizing your text. Samples are very independent. So this just means it's embarrassingly parallelizable. And so yeah, you have design decisions here. What forms of concurrency do you want? So there's asynchronous programming, which is suitable for IO work, such as making SQL queries or performing network requests. There's threads, which you can use for CPU intensive workloads that relinquish the Python GIL, the global interpreter lock. So it's not straightforward what operations actually release the lock. So you have to do a little more investigation. But common uses are like using Hugging Face Transformers tokenizers, using the PIL Transforms API, or some Pandas operations. Processes are more heavyweight, but also provide total isolation between your workloads. So you can leverage multiple cores on your machine as you finish your work. Yeah, doing a deep dive on the right solution would warrant its own talk, but there's plenty of online resources that can help you decide for your use case. What's important for our solution is that we need to match our bottleneck, not simply going with a lever that's worked for us before. So we'll choose async IO for fetching images here, and then use Ray actors as our processors, as our multi-processing library. Ray actors are essentially the same as general processes, but they offer us APIs to communicate across workers that make it so we don't have to reinvent the wheel. So yeah, your process is only as slow as your slowest link. And we can see that our wait time ratio has gone down on the second example, which is in the pink. You can see that the time spent fetching data per batch has gone around 40 seconds. So this gives us a 25% speed up. However, as you can see, there's a huge gap that starts generating, especially as we're going through many steps. So can we somehow limit our bottleneck of waiting on the trainer to request before provisioning our worker pool to fetch the data? Can we just preemptively fetch our data? So we came up with solution two, which was that we have a background thread that fills up a queue ahead of time, and it always stays ahead of the consumer. This means that your producer is producing examples at a multiplier of your consumer, and so the trainer is never bottlenecked on actually requesting the data. When it requests data, it is available on demand. There's a caveat to prefetching. It makes your model and data loader checkpointing and resumption a little intricate process, and it can also suffer from a cold start period in which your queue is actually getting filled up so it can be ready for training. But if you work around those details, I think prefetching is a great idea. Yeah, so I think making sure your producer is always ahead of your consumer will pay great dividends for you here. Unsurprisingly, we achieved close to zero seconds of data fetching and processing per batch because we've already fetched data and processed it way before the trainer even needs it. And so we've effectively solved both the data load and the transform bottlenecks. So after these two mitigations, we thought we were done. Throughput up, GPUs fed. However, we observed that the data transport costs still linger. In fact, they've gone up. So every sample transfers a large amount of image arrays across process boundaries multiple times. Every sample is pickled on the worker, copied to the coordinator, and then re-pickled onto the trainer. Per sample, per step, we have a memory copy that nobody really asks for. So how this manifests is that your data generator can often OOM. And multimodal tensors are huge. They're megabytes per sample. And so by default, every sample is returned by value, which means that these expensive arrays are copied over from process to process. So a fix for this, you can come up with an object store. This is a nice convenience method that Ray provides you. Each sample carries an object reference, which is just a pointer to the data. And then the driver just holds the pointer. The tensor never round trips to the head node. And the Megatron data parallel ranks, they can just directly call the Ray store to fetch the data as they need. So with every choice of your parallelism and concurrency solution, you always have to think about the added communication costs. So plan wisely around that. Okay. Yeah. And we were able to eliminate an extraneous put object call that our prefetcher solution had that we did not have to deal with by using the Ray store. And we can see that our communication costs go down and the ratio of the time spent waiting also goes down. So to recap, we took a serial baseline. We added concurrency for data loading and processing. We added prefetching to stay ahead of training requests. And we added the Ray store to minimize data transfer. We went from a baseline wait ratio of 85% to 20%. And you can see that the sawtooth pattern that you see in the top graph is alleviated to a large extent, which means our utilization of the GPUs has gone up. So when we're scaling up, now that we have a good multimodal training pipeline, let's try to scale it up to a production run. While doing that, we observed our wait time ratio for the same pipeline went up when all we did was scale some numbers. So we just added four times the data parallel ranks. We added 200 data streams. And then batch size is X by four. So it turns out that since the data generator and the worker pool are co-located for fast data transfer, what happens is that there's a bottleneck on the network interface card of that node, which means that while we're packing all of this working and processing into specific nodes, their network throughput is not able to keep up with the demand of the training pipeline. So at this point, we did a little bit of digging into the frameworks that we are using. And we saw that by default, Ray schedules workers on this. It prefers to schedule workers on the same nodes and co-locate workers, which means that it's easy to bottleneck one machine before you move to another machine. So what we did was consider a possibility where we disaggregate this whole process, where workers are spread across multiple nodes, so they can do their own image processing and storing, and in a lazy, just-in-time manner are retrieved and used by our DP rings. So yeah, and then, so these are the two parameters that we kind of tuned. One is the zero-copy retrieval, and second is a spread scheduling mechanism. Neither of these actually helped in a small-scale experiment, but together they had a synergistic effect in a large-scale experiment. Yeah, so a config can do poorly at a small scale, but can do really well at a larger scale. So you should always think about how to ablate across your scaling ladders. And these were the two flags that ended up making a huge difference in how fast our data processing pipeline was. And so now, this is the final pipeline that we've accomplished: a concurrent, eager, and a data-access pattern-aware system that shares the training across loads and enables the GPU to stay warm while providing smoothness and stability in training. Overall, we achieved a 50% additional throughput at scale just from these two flags. It's the same knob, opposite verdict, set by the bottleneck. So these are the learnings we get from this talk, if nothing else. GPUs are expensive, but sometimes the biggest battles happen outside of the GPU. So first ask yourself: are you CPU-bound or GPU-bound? Are you IO-bound or compute-bound? And then solving one bottleneck often exposes another. So first it was throughput for us. Then it became wait time. Then it became memory. Then it became retrieval costs. Classic moves are not the end. You know, parallelism and prefetching matter, and I think a lot of content has covered this, but so do the semantics of the frameworks that you're using and the constraints that you're dealing with. And scale always changes the answer. Tuning parameters like zero copy waste and spreading workers become important only at larger scales, and they may not manifest as obvious improvements at smaller levels. Overall, profiling your baseline helps you move the needle. Yeah, thank you, everyone, for attending the talk. If you have any questions, I'm happy to answer them. Thanks. So, for example, first sample, we have two costs. One is fetching the images. Two is processing. So, that's like decoding, vision pre-processing, and then tokenizing your text. Samples are very independent. So, this just means it's like embarrassingly paralyzable. And so, yeah, you have a design decisions here. What forms of concurrency do you want? So, there's asynchronous programming, which is suitable for like IO work, such as making SQL queries or like performing network requests. There's threads, which you can use for like CPU intensive workloads that relinquish the Python guild, like the global interpreter lock. So, it's not straightforward what operations actually release the lock. So, you have to do a little more of your investigation. But common uses are like using Hugging Face Transformers tokenizers, using the Pill Transforms API, or like some Pandas operations. Processes are more heavyweight, but also provide total isolation between your workloads. So, you can leverage multiple cores on your machine as you finish your work. Yeah, doing a deep dive on the right solution would warrant its own talk, but like there's plenty of online resources that can help you decide for your use case. What's important for our solution is that we need to match our bottleneck, not simply going with a lever that's worked for us before. So, we'll choose async IO for fetching images here, and then use ray actors as our processors, as our process, multi-processing library. Reactors are essentially the same as like general processes, but they offer us APIs to communicate across workers that just make it so that we don't have to reinvent the wheel. So, yeah, your process is only as slow as your slowest link. And we can see that our wait time ratio has gone down on the second example, which is in the pink. You can see that the time spent fetching data per batch has gone basically, yeah, around like 40 seconds. So, this gives us a 25% speed up. However, yeah, as you can see, there's a huge gap that starts generating, especially as we're going through many steps. So, can we somehow limit our bottleneck of waiting on the trainer to request before provisioning our worker pool to fetch the data? So, can we just like preemptively fetch our data? So, we came up with solution two, which was that we have a background thread that fills up a queue ahead of time, and it always stays ahead of the consumer, which means that your producer is producing examples at a multiplier of your consumer, and so the trainer is never bottlenecked on actually requesting the data. When it requests data, it is available on demand. There's a caveat to prefetching. It makes your model and data loader checkpointing and resumption like a little intricate of a process, and it can also suffer from a cold start period in which your queue is actually getting filled up so it can be ready for training. But if you work around those details, I think prefetching is a great idea. Yeah, so I think making sure your producer is always ahead of your consumer will pay great dividends for you here. Unsurprisingly, we achieved close to zero seconds of data fetching and processing per batch because we've already fetched data and processed it way before the trainer even needs it. And so, we've effectively solved both the data load and the transform bottlenecks. So, after these two mitigations, we thought we were done. Throughput, up, GPUs, fed. However, we observed that the data transport costs still linger. In fact, they've gone up. So, every sample transfers a large amount of, like, image arrays across process boundaries multiple times. Every sample is pickled on the worker, copied to the coordinator, and then re-pickled onto the trainer. Per sample, per step, we have a mem copy that nobody really asks for. So, how this manifests is that your data generator can often oom. And so, multimodal tensors are huge. They're megabytes per sample. And so, by default, every sample is returned by value, which means that these expensive arrays are copied over from process to process. So, a fix for this, you can come up with an object store. This is a nice convenience method that Ray provides you. Each sample carries an object reference, which is just a pointer to the data. And then the driver just holds the pointer. The tensor never round trips to the head node. And the Megatron data parallel ranks, they can just directly call the race store to fetch the data as they need. So, with every choice of your parallelism and concurrency solution, you always have to think about the added communication costs. So, plan wisely around that. Okay. Okay. Yeah. And we were able to eliminate an extraneous put object kind of call that our prefetcher solution had that we did not have to deal with by using the Ray store. And we can see that our communication costs go down and the ratio of the time spent waiting also goes down. So, to recap, we took a serial baseline. We added concurrency for data loading and processing. We added prefetching to stay ahead of training requests. And we added the Ray store to minimize data transfer. We went from a baseline weight ratio of 85% to 20%. And you can see that the sawtooth pattern that you see in the top graph is alleviated to a large extent, which means our utilization of the GPUs has gone up. So, when we're scaling up, now that we have a good multimodal training pipeline, let's try to scale it up to a production run. While doing that, we observed our wait time ratio for the same pipeline went up when all we did was scale some numbers. So, we just added four times the data parallel rings. We added like 200 data streams. And then batch size is X by four. So, it turns out that since the data generator and the worker pool are co-located for fast data transfer, what happens is that there's a bottleneck on the network interface card of that node, which means that while we're packing all of this working and processing into specific nodes, that their network throughput is not able to keep up with the demand of the training pipeline. So, at this point, we did a little bit of digging into the frameworks that we are using. And we saw that by default, Ray schedules workers on this. It prefers to schedule workers on the same nodes and co-locate workers, which means that it's easy to bottleneck one machine before you move to another machine. So, what we did was consider a possibility where we disaggregate this whole process, where workers are spread across multiple nodes, so they can do their own image processing and storing, and in a lazy, just-in-time manner are retrieved and used by our DP rings. So, yeah, and then, so these are the two parameter, two flags that we kind of tuned. One is the zero-copy retrieval, and second is a spread scheduling mechanism. Neither of these actually helped in a small-scale experiment, but together they had a synergistic effect in a large-scale experiment. Yeah, so a config can lose, a config can do poorly at a small scale, but can do really good at a larger scale. So, you should always think about how to ablate across your scaling ladders. And these were the two flags that ended up making a huge difference in how fast our data processing pipeline was. And so now, this is the final pipeline that we've accomplished, a concurrent, eager, and a data-access pattern-aware system that shares the training across loads and enables that GPU stay warm while providing smoothness and stability in training. Overall, we achieved a 50% additional throughput at scale just from these two flags. It's the same knob, opposite verdict, set by the bottleneck. So, these are the learnings we get from this talk, if nothing else. GPUs are expensive, but sometimes the biggest battles happen outside of the GPU. So, first ask yourself, are you CPU-bound or GPU-bound? Are you IO-bound or compute-bound? And then solving one bottleneck often exposes another. So, first it was throughput for us. Then it became wait time. Then it became memory. Then it became retrieval costs. Classic moves are not the end. You know, parallelism and prefetching matter, and I think a lot of content has covered this, but so do the semantics of the frameworks that you're using and the constraints that you're dealing with. And scale always changes the answer. Tuning parameters like zero copy waste and spreading workers become important only at larger scales, and they may not manifest as obvious improvements at smaller levels. Overall, profiling your baseline helps you move the needle. Yeah, thank you, everyone, for attending the talk. If you have any questions, I'm happy to answer them. Thanks. Bye. Bye. Bye. Bye. Bye. Bye. Bye. Bye. ! Thank you.