<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>PCIe Lanes Archives &mdash; Tim Dettmers</title>
	<atom:link href="https://timdettmers.com/tag/pcie-lanes/feed/" rel="self" type="application/rss+xml" />
	<link>https://timdettmers.com/tag/pcie-lanes/</link>
	<description>Making deep learning accessible.</description>
	<lastBuildDate>Wed, 10 Dec 2025 15:06:20 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.0.11</generator>

<image>
	<url>https://i0.wp.com/timdettmers.com/wp-content/uploads/2025/12/cropped-profile_2026_400x400.png?fit=32%2C32&#038;ssl=1</url>
	<title>PCIe Lanes Archives &mdash; Tim Dettmers</title>
	<link>https://timdettmers.com/tag/pcie-lanes/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">106749684</site>	<item>
		<title>Which GPU(s) to Get for Deep Learning: My Experience and Advice for Using GPUs in Deep Learning</title>
		<link>https://timdettmers.com/2023/01/30/which-gpu-for-deep-learning/</link>
					<comments>https://timdettmers.com/2023/01/30/which-gpu-for-deep-learning/#comments</comments>
		
		<dc:creator><![CDATA[Tim Dettmers]]></dc:creator>
		<pubDate>Mon, 30 Jan 2023 15:50:00 +0000</pubDate>
				<category><![CDATA[Deep Learning]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[AMD]]></category>
		<category><![CDATA[CPU]]></category>
		<category><![CDATA[High Performance Computing]]></category>
		<category><![CDATA[Matrix Multiplication]]></category>
		<category><![CDATA[Parallel Computing]]></category>
		<category><![CDATA[PCIe Lanes]]></category>
		<category><![CDATA[Sparse Training]]></category>
		<guid isPermaLink="false">http://timdettmers.wordpress.com/?p=4</guid>

					<description><![CDATA[<p>Making the right choice when it comes to buying a GPU is critical. So how do you select the GPU which is right for you? This blog post will delve into that question and will lend you advice which will help you to make choice that is right for you.</p>
<p>The post <a rel="nofollow" href="https://timdettmers.com/2023/01/30/which-gpu-for-deep-learning/">Which GPU(s) to Get for Deep Learning: My Experience and Advice for Using GPUs in Deep Learning</a> appeared first on <a rel="nofollow" href="https://timdettmers.com">Tim Dettmers</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<div class="wp-container-1 wp-block-group eplus-nHlelL"><div class="wp-block-group__inner-container">
<p class="eplus-huy78r">Deep learning is a field with intense computational requirements, and your choice of GPU will fundamentally determine your deep learning experience. But what features are important if you want to buy a new GPU? GPU RAM, cores, tensor cores, caches? How to make a cost-efficient choice? This blog post will delve into these questions, tackle common misconceptions, give you an intuitive understanding of how to think about GPUs, and will lend you advice, which will help you to make a choice that is right for you.</p>



<span id="more-6"></span>



<p class="eplus-sxlaEI">This blog post is designed to give you different levels of understanding of GPUs and the new Ampere series GPUs from NVIDIA. You have the choice: (1) If you are not interested in the details of how GPUs work, what makes a GPU fast compared to a CPU, and what is unique about the new NVIDIA RTX 40 Ampere series, you can skip right to the performance and performance per dollar charts and the recommendation section. The cost/performance numbers form the core of the blog post and the content surrounding it explains the details of what makes up GPU performance.</p>



<p class="eplus-1g9jAa">(2) If you worry about specific questions, I have answered and addressed the most common questions and misconceptions in the later part of the blog post.</p>



<p class="eplus-ErgVnq">(3) If you want to get an in-depth understanding of how GPUs, caches, and Tensor Cores work, the best is to read the blog post from start to finish. You might want to skip a section or two based on your understanding of the presented topics.</p>





<h2 class="eplus-dYbLao"><strong>Overview</strong></h2>



<p class="eplus-xVYlmp">This blog post is structured in the following way. First, I will explain what makes a GPU fast. I will discuss CPUs vs GPUs, Tensor Cores, memory bandwidth, and the memory hierarchy of GPUs and how these relate to deep learning performance. These explanations might help you get a more intuitive sense of what to look for in a GPU. I discuss the unique features of the new NVIDIA RTX 40 Ampere GPU series that are worth considering if you buy a GPU. From there, I make GPU recommendations for different scenarios. After that follows a Q&amp;A section of common questions posed to me in Twitter threads; in that section, I will also address common misconceptions and some miscellaneous issues, such as cloud vs desktop, cooling, AMD vs NVIDIA, and others.&nbsp;</p>



<h2 class="eplus-TzWEWa">How do GPUs work?</h2>



<p class="eplus-YDMSkp">If you use GPUs frequently, it is useful to understand how they work. This knowledge will help you to undstand cases where are GPUs fast or slow. In turn, you might be able to understand better why you need a GPU in the first place and how other future hardware options might be able to compete. You can skip this section if you just want the useful performance numbers and arguments to help you decide which GPU to buy. The best high-level explanation for the question of how GPUs work is my following Quora answer:</p>



<span class="quora-content-embed" data-name="Why-are-GPUs-well-suited-to-deep-learning/answer/Tim-Dettmers-1">Read <a class="quora-content-link" data-width="560" data-height="260" href="https://www.quora.com/Why-are-GPUs-well-suited-to-deep-learning/answer/Tim-Dettmers-1" data-type="answer" data-id="21379913" data-key="bbb3732f88834d75dfa98d816eb9eccd" load-full-answer="False" data-embed="jqubkoa"></a><a href="https://www.quora.com/Tim-Dettmers-1">Tim Dettmers</a>&#8216; <a href="/Why-are-GPUs-well-suited-to-deep-learning?top_ans=21379913">answer</a> to <a href="/Why-are-GPUs-well-suited-to-deep-learning" ref="canonical"><span class="rendered_qtext">Why are GPUs well-suited to deep learning?</span></a> on <a href="https://www.quora.com">Quora</a><script type="text/javascript" src="https://www.quora.com/widgets/content"></script></span>



<p class="eplus-bfPm9F">This is a high-level explanation that explains quite well why GPUs are better than CPUs for deep learning. If we look at the details, we can understand what makes one GPU better than another.</p>



<h2 class="eplus-9AkYN1">The Most Important GPU Specs for Deep Learning Processing Speed</h2>



<p class="eplus-XflNML">This section can help you build a more intuitive understanding of how to think about deep learning performance. This understanding will help you to evaluate future GPUs by yourself. This section is sorted by the importance of each component. Tensor Cores are most important, followed by memory bandwidth of a GPU, the cache hierachy, and only then FLOPS of a GPU.</p>



<h3 class="eplus-YyGRdI">Tensor Cores</h3>



<p class="eplus-JKvKVO">Tensor Cores are tiny cores that perform very efficient matrix multiplication. Since the most expensive part of any deep neural network is matrix multiplication Tensor Cores are very useful. In fast, they are so powerful, that I do not recommend any GPUs that do not have Tensor Cores.</p>



<p class="eplus-JKvKVO">It is helpful to understand how they work to appreciate the importance of these computational units specialized for matrix multiplication. Here I will show you a simple example of A*B=C matrix multiplication, where all matrices have a size of 32&#215;32, what a computational pattern looks like with and without Tensor Cores. This is a simplified example, and not the exact way how a high performing matrix multiplication kernel would be written, but it has all the basics. A CUDA programmer would take this as a first “draft” and then optimize it step-by-step with concepts like double buffering, register optimization, occupancy optimization, instruction-level parallelism, and many others, which I will not discuss at this point. </p>



<p class="eplus-JQnNxT">To understand this example fully, you have to understand the concepts of cycles. If a processor runs at 1GHz, it can do 10^9 cycles per second. Each cycle represents an opportunity for computation. However, most of the time, operations take longer than one cycle. Thus we essentially have a queue where the next operations needs to wait for the next operation to finish. This is also called the latency of the operation.</p>



<p class="eplus-Nh32jj">Here are some important latency cycle timings for operations. These times can change from GPU generation to GPU generation. <a href="https://www.nvidia.com/en-us/on-demand/session/gtcspring21-s33322/">These numbers are for Ampere GPUs</a>, which have relatively slow caches.</p>



<ul class="eplus-yOHNRh"><li>Global memory access (up to 80GB): ~380 cycles</li><li>L2 cache: ~200 cycles</li><li>L1 cache or Shared memory access (up to 128 kb per Streaming Multiprocessor): ~34 cycles</li><li>Fused multiplication and addition, a*b+c (FFMA): 4 cycles</li><li>Tensor Core matrix multiply: 1 cycle</li></ul>



<p class="eplus-xmhx78">Each operation is always performed by a pack of 32 threads. This pack is termed a warp of threads. Warps usually operate in a synchronous pattern — threads within a warp have to wait for each other. All memory operations on the GPU are optimized for warps. For example, loading from global memory happens at a granularity of 32*4 bytes, exactly 32 floats, exactly one float for each thread in a warp. We can have up to 32 warps = 1024 threads in a streaming multiprocessor (SM), the GPU-equivalent of a CPU core. The resources of an SM are divided up among all active warps. This means that sometimes we want to run fewer warps to have more registers/shared memory/Tensor Core resources per warp.</p>



<p class="eplus-5GehcT">For both of the following examples, we assume we have the same computational resources. For this small example of a 32&#215;32 matrix multiply, we use 8 SMs (about 10% of an RTX 3090) and 8 warps per SM.</p>



<p class="eplus-G9pv5H">To understand how the cycle latencies play together with resources like threads per SM and shared memory per SM, we now look at examples of matrix multiplication. While the following example roughly follows the sequence of computational steps of matrix multiplication for both with and without Tensor Cores, please note that these are very simplified examples. Real cases of matrix multiplication involve much larger shared memory tiles and slightly different computational patterns.</p>



<h4 class="eplus-Lj4Hjc">Matrix multiplication without Tensor Cores</h4>



<p class="eplus-eBAn6w">If we want to do an A*B=C matrix multiply, where each matrix is of size 32&#215;32, then we want to load memory that we repeatedly access into shared memory because its latency is about five times lower (200 cycles vs 34 cycles). A memory block in shared memory is often referred to as a memory tile or just a tile. Loading two 32&#215;32 floats into a shared memory tile can happen in parallel by using 2*32 warps. We have 8 SMs with 8 warps each, so due to parallelization, we only need to do a single sequential load from global to shared memory, which takes 200 cycles.</p>



<p class="eplus-bSRgVT">To do the matrix multiplication, we now need to load a vector of 32 numbers from shared memory A and shared memory B and perform a fused multiply-and-accumulate (FFMA). Then store the outputs in registers C. We divide the work so that each SM does 8x dot products (32&#215;32) to compute 8 outputs of C. Why this is exactly 8 (4 in older algorithms) is very technical. I recommend Scott Gray’s blog post on <a href="https://github.com/NervanaSystems/maxas/wiki/SGEMM">matrix multiplication</a> to understand this. This means we have 8x shared memory accesses at the cost of 34 cycles each and 8 FFMA operations (32 in parallel), which cost 4 cycles each. In total, we thus have a cost of:</p>



<p class="eplus-UJKQje">200 cycles (global memory) + 8*34 cycles (shared memory) + 8*4 cycles (FFMA) = 504 cycles</p>



<p class="eplus-G6zbco">Let&#8217;s look at the cycle cost of using Tensor Cores.</p>



<h4 class="eplus-dS0Vu0">Matrix multiplication with Tensor Cores</h4>



<p class="eplus-8bWcQj">With Tensor Cores, we can perform a 4&#215;4 matrix multiplication in one cycle. To do that, we first need to get memory into the Tensor Core. Similarly to the above, we need to read from global memory (200 cycles) and store in shared memory. To do a 32&#215;32 matrix multiply, we need to do 8&#215;8=64 Tensor Cores operations. A single SM has 8 Tensor Cores. So with 8 SMs, we have 64 Tensor Cores — just the number that we need! We can transfer the data from shared memory to the Tensor Cores with 1 memory transfers (34 cycles) and then do those 64 parallel Tensor Core operations (1 cycle). This means the total cost for Tensor Cores matrix multiplication, in this case, is:</p>



<p class="eplus-ZzxYmo">200 cycles (global memory) + 34 cycles (shared memory) + 1 cycle (Tensor Core) = 235 cycles.</p>



<p class="eplus-KVQYN0">Thus we reduce the matrix multiplication cost significantly from 504 cycles to 235 cycles via Tensor Cores. In this simplified case, the Tensor Cores reduced the cost of both shared memory access and FFMA operations.&nbsp;</p>



<p class="eplus-KVQYN0">This example is simplified, for example, usually each thread needs to calculate which memory to read and write to as you transfer data from global memory to shared memory. With the new Hooper (H100) architectures we additionally have the Tensor Memory Accelerator (TMA) compute these indices in hardware and thus help each thread to focus on more computation rather than computing indices.</p>



<h4>Matrix multiplication with Tensor Cores and Asynchronous copies (RTX 30/RTX 40) and TMA (H100)</h4>



<p>The RTX 30 Ampere and RTX 40 Ada series GPUs additionally have support to perform asynchronous transfers between global and shared memory. The H100 Hopper GPU extends this further by introducing the Tensor Memory Accelerator (TMA) unit. the TMA unit combines asynchronous copies and index calculation for read and writes simultaneously — so each thread no longer needs to calculate which is the next element to read and each thread can focus on doing more matrix multiplication calculations. This looks as follows.</p>



<p>The TMA unit fetches memory from global to shared memory (200 cycles). Once the data arrives, the TMA unit fetches the next block of data asynchronously from global memory. While this is happening, the threads load data from shared memory and perform the matrix multiplication via the tensor core. Once the threads are finished they wait for the TMA unit to finish the next data transfer, and the sequence repeats. </p>



<p>As such, due to the asynchronous nature, the second global memory read by the TMA unit is already progressing as the threads process the current shared memory tile.  This means, the second read takes only 200 &#8211; 34 &#8211; 1 = 165 cycles. </p>



<p>Since we do many reads, only the first memory access will be slow and all other memory accesses will be partially overlapped with the TMA unit. Thus on average, we reduce the time by 35 cycles.</p>



<p>165 cycles (wait for async copy to finish) + 34 cycles (shared memory) + 1 cycle (Tensor Core) = 200 cycles.</p>



<p>Which accelerates the matrix multiplication by another 15%.</p>



<p class="eplus-2785xF">From these examples, it becomes clear why the next attribute, memory bandwidth, is so crucial for Tensor-Core-equipped GPUs. Since global memory is the by far the largest cycle cost for matrix multiplication with Tensor Cores, we would even have faster GPUs if the global memory latency could be reduced. We can do this by either increasing the clock frequency of the memory (more cycles per second, but also more heat and higher energy requirements) or by increasing the number of elements that can be transferred at any one time (bus width).</p>


<div class="crp_related   crp_related_block  mobile-only crp-rounded-thumbs"><ul><li><a href="https://timdettmers.com/2025/12/10/why-agi-will-not-happen/"     class="crp_link post-1233"><figure><img loading="lazy"  width="150" height="150"  src="https://i0.wp.com/timdettmers.com/wp-content/plugins/contextual-related-posts/default.png?resize=150%2C150&#038;ssl=1" class="crp_thumb crp_default_thumb" alt="Why AGI Will Not Happen" title="Why AGI Will Not Happen" data-recalc-dims="1" /></figure><span class="crp_title">Why AGI Will Not Happen</span></a></li><li><a href="https://timdettmers.com/2026/01/13/use-agents-or-be-left-behind/"     class="crp_link post-1238"><figure><img loading="lazy"  width="150" height="150"  src="https://i0.wp.com/timdettmers.com/wp-content/plugins/contextual-related-posts/default.png?resize=150%2C150&#038;ssl=1" class="crp_thumb crp_default_thumb" alt="Use Agents or Be Left Behind? A Personal Guide to Automating Your Own Work" title="Use Agents or Be Left Behind? A Personal Guide to Automating Your Own Work" data-recalc-dims="1" /></figure><span class="crp_title">Use Agents or Be Left Behind? A Personal Guide to Automating&hellip;</span></a></li><li><a href="https://timdettmers.com/2026/01/23/my-journey-towards-coding-agents-building-sera/"     class="crp_link post-1248"><figure><img loading="lazy"  width="150" height="150"  src="https://i0.wp.com/timdettmers.com/wp-content/plugins/contextual-related-posts/default.png?resize=150%2C150&#038;ssl=1" class="crp_thumb crp_default_thumb" alt="My Journey Towards Coding Agents: Building SERA" title="My Journey Towards Coding Agents: Building SERA" data-recalc-dims="1" /></figure><span class="crp_title">My Journey Towards Coding Agents: Building SERA</span></a></li></ul><div class="crp_clear"></div></div>


<h3 class="eplus-7uVl7z">Memory Bandwidth</h3>



<p class="eplus-Sc9M0X">From the previous section, we have seen that Tensor Cores are very fast. So fast, in fact, that they are idle most of the time as they are waiting for memory to arrive from global memory. For example, during GPT-3-sized training, which uses huge matrices — the larger, the better for Tensor Cores — we have a Tensor Core TFLOPS utilization of about 45-65%, meaning that even for the large neural networks about 50% of the time, Tensor Cores are idle.</p>



<p class="eplus-RsGhaC">This means that when comparing two GPUs with Tensor Cores, one of the single best indicators for each GPU’s performance is their memory bandwidth. For example, The A100 GPU has 1,555 GB/s memory bandwidth vs the 900 GB/s of the V100. As such, a basic estimate of speedup of an A100 vs V100 is 1555/900 = 1.73x.</p>



<h3 class="eplus-Nd29of">L2 Cache / Shared Memory / L1 Cache / Registers</h3>



<p class="eplus-Qs2qZL">Since memory transfers to the Tensor Cores are the limiting factor in performance, we are looking for other GPU attributes that enable faster memory transfer to Tensor Cores. L2 cache, shared memory, L1 cache,  and amount of registers used are all related. To understand how a memory hierarchy enables faster memory transfers, it helps to understand how matrix multiplication is performed on a GPU.</p>



<p class="eplus-ecxtvX">To perform matrix multiplication, we exploit the memory hierarchy of a GPU that goes from slow global memory, to faster L2 memory, to fast local shared memory, to lightning-fast registers. However, the faster the memory, the smaller it is. </p>



<p>While logically, L2 and L1 memory are the same, L2 cache is larger and thus the average physical distance that need to be traversed to retrieve a cache line is larger. You can see the L1 and L2 caches as organized warehouses where you want to retrieve an item. You know where the item is, but to go there takes on average much longer for the larger warehouse. This is the essential difference between L1 and L2 caches. Large = slow, small = fast.</p>



<p class="eplus-ecxtvX">For matrix multiplication we can use this hierarchical separate into smaller and smaller and thus faster and faster chunks of memory to perform very fast matrix multiplications. For that, we need to chunk the big matrix multiplication into smaller sub-matrix multiplications. These chunks are called memory tiles, or often for short just tiles.</p>



<p class="eplus-ecxtvX">We perform matrix multiplication across these smaller tiles in local shared memory that is fast and close to the streaming multiprocessor (SM) — the equivalent of a CPU core. With Tensor Cores, we go a step further: We take each tile and load a part of these tiles into Tensor Cores which is directly addressed by registers. A matrix memory tile in L2 cache is 3-5x faster than global GPU memory (GPU RAM), shared memory is ~7-10x faster than the global GPU memory, whereas the Tensor Cores’ registers are ~200x faster than the global GPU memory.&nbsp;</p>



<p class="eplus-ifo0Kt">Having larger tiles means we can reuse more memory. I wrote about this in detail in my <a href="https://timdettmers.com/2018/10/17/tpus-vs-gpus-for-transformers-bert/">TPU vs GPU</a> blog post. In fact, you can see TPUs as having very, very, large tiles for each Tensor Core. As such, TPUs can reuse much more memory with each transfer from global memory, which makes them a little bit more efficient at matrix multiplications than GPUs.</p>



<p class="eplus-h6CECa">Each tile size is determined by how much memory we have per streaming multiprocessor (SM) and how much we L2 cache we have across all SMs. We have the following shared memory sizes on the following architectures:</p>



<ul class="eplus-CmF7pW"><li>Volta (Titan V): 128kb shared memory / 6 MB L2</li><li>Turing (RTX 20s series): 96 kb shared memory / 5.5 MB L2</li><li>Ampere (RTX 30s series): 128 kb shared memory / 6 MB L2</li><li>Ada (RTX 40s series): 128 kb shared memory / 72 MB L2</li></ul>



<p class="eplus-mGR5cO">We see that Ada has a much larger L2 cache allowing for larger tile sizes, which reduces global memory access. For example, for BERT large during training, the input and weight matrix of any matrix multiplication fit neatly into the L2 cache of Ada (but not other Us). As such, data needs to be loaded from global memory only once and then data is available throught the L2 cache, making matrix multiplication about 1.5 &#8211; 2.0x faster for this architecture for Ada. For larger models the speedups are lower during training but certain sweetspots exist which may make certain models much faster. Inference, with a batch size larger than 8 can also benefit immensely from the larger L2 caches.</p>



<h2 class="eplus-Uq5SHY">Estimating Ada / Hopper Deep Learning Performance</h2>



<p class="eplus-gsZ188">This section is for those who want to understand the more technical details of how I derive the performance estimates for Ampere GPUs. If you do not care about these technical aspects, it is safe to skip this section.</p>



<h3 class="eplus-t3NVr4">Practical Ada / Hopper Speed Estimates</h3>



<p class="eplus-H6ehT0">Suppose we have an estimate for one GPU of a GPU-architecture like Hopper, Ada, Ampere, Turing, or Volta. It is easy to extrapolate these results to other GPUs from the same architecture/series. Luckily, NVIDIA already <a href="https://developer.nvidia.com/deep-learning-performance-training-inference">benchmarked the A100 vs V100 vs H100</a> across a wide range of computer vision and natural language understanding tasks. Unfortunately, NVIDIA made sure that these numbers are not directly comparable by using different batch sizes and the number of GPUs whenever possible to favor results for the H100 GPU. So in a sense, the benchmark numbers are partially honest, partially marketing numbers. In general, you could argue that using larger batch sizes is fair, as the H100/A100 GPU has more memory. Still, to compare GPU architectures, we should evaluate unbiased memory performance with the same batch size.</p>



<p class="eplus-3xKGXX">To get an unbiased estimate, we can scale the data center GPU results in two ways: (1) account for the differences in batch size, (2) account for the differences in using 1 vs 8 GPUs. We are lucky that we can find such an estimate for both biases in the data that NVIDIA provides.&nbsp;</p>



<p class="eplus-LO0cd2">Doubling the batch size increases throughput in terms of images/s (CNNs) by 13.6%. I benchmarked the same problem for transformers on my RTX Titan and found, surprisingly, the very same result: 13.5% — it appears that this is a robust estimate.</p>



<p class="eplus-obwQUJ">As we parallelize networks across more and more GPUs, we lose performance due to some networking overhead. The A100 8x GPU system has better networking (NVLink 3.0) than the V100 8x GPU system (NVLink 2.0) — this is another confounding factor. Looking directly at the data from NVIDIA, we can find that for CNNs, a system with 8x A100 has a 5% lower overhead than a system of 8x V100. This means if going from 1x A100 to 8x A100 gives you a speedup of, say, 7.00x, then going from 1x V100 to 8x V100 only gives you a speedup of 6.67x.&nbsp; For transformers, the figure is 7%.&nbsp;</p>



<p class="eplus-M8lGMx">Using these figures, we can estimate the speedup for a few specific deep learning architectures from the direct data that NVIDIA provides. The Tesla A100 offers the following speedup over the Tesla V100:</p>



<ul class="eplus-2N544K"><li>SE-ResNeXt101: 1.43x</li><li>Masked-R-CNN: 1.47x</li><li>Transformer (12 layer, Machine Translation, WMT14 en-de): 1.70x</li></ul>



<p class="eplus-hLEvfM">Thus, the figures are a bit lower than the theoretical estimate for computer vision. This might be due to smaller tensor dimensions, overhead from operations that are needed to prepare the matrix multiplication like img2col or Fast Fourier Transform (FFT), or operations that cannot saturate the GPU (final layers are often relatively small). It could also be artifacts of the specific architectures (grouped convolution).</p>



<p class="eplus-K95gae">The practical transformer estimate is very close to the theoretical estimate. This is probably because algorithms for huge matrices are very straightforward. I will use these practical estimates to calculate the cost efficiency of GPUs.</p>



<h3 class="eplus-CUQjZa">Possible Biases in Estimates</h3>



<p class="eplus-UQWjwg">The estimates above are for H100, A100 , and V100 GPUs. In the past, NVIDIA sneaked unannounced performance degradations into the “gaming” RTX GPUs: (1) Decreased Tensor Core utilization, (2) gaming fans for cooling, (3) disabled peer-to-peer GPU transfers. It might be possible that there are unannounced performance degradations in the RTX 40 series compared to the full Hopper H100. </p>



<p class="eplus-IQX3ZD">As of now, one of these degradations was found for Ampere GPUs: Tensor Core performance was decreased so that RTX 30 series GPUs are not as good as Quadro cards for deep learning purposes. This was also done for the RTX 20 series, so it is nothing new, but this time it was also done for the Titan equivalent card, the RTX 3090. The RTX Titan did not have performance degradation enabled.</p>



<p>Currently, no degradation for Ada GPUs are known, but I update this post with news on this and let my followers on <a href="https://twitter.com/Tim_Dettmers">twitter</a> know.</p>



<h2 class="eplus-hICahu"><strong>Advantages and Problems for RTX40 and RTX 30 Series</strong></h2>



<p class="eplus-0zpF2c">The new NVIDIA Ampere RTX 30 series has additional benefits over the NVIDIA Turing RTX 20 series, such as sparse network training and inference. Other features, such as the new data types, should be seen more as an ease-of-use-feature as they provide the same performance boost as Turing does but without any extra programming required. </p>



<p>The Ada RTX 40 series has even further advances like 8-bit Float (FP8) tensor cores. The RTX 40 series also has similar power and temperature issues compared to the RTX 30. The issue of melting power connector cables in the RTX 40 can be easily prevented by connecting the power cable correctly.</p>



<h3 class="eplus-2ZdClk">Sparse Network Training</h3>



<p class="eplus-vRUUJh">Ampere allows for fine-grained structure automatic sparse matrix multiplication at dense speeds. How does this work? Take a weight matrix and slice it into pieces of 4 elements. Now imagine 2 elements of these 4 to be zero. Figure 1 shows how this could look like. </p>


<div class="wp-block-image eplus-IiM2y7">
<figure class="aligncenter size-large is-resized"><img data-attachment-id="935" data-permalink="https://timdettmers.com/sparse_matrix_ampere/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/sparse_matrix_ampere.png?fit=321%2C387&amp;ssl=1" data-orig-size="321,387" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Ampere Sparse Matrix Multiplication Tensor Cores Matrix" data-image-description="&lt;p&gt;Figure X: Structure supported by the sparse matrix multiplication feature in Ampere GPUs. Figure is taken from Jeff Pool&#8217;s GTC 2020 presentation on  &lt;a href=&quot;https://developer.download.nvidia.com/video/gputechconf/gtc/2020/presentations/s22085-accelerating-sparsity-in-the-nvidia-ampere-architecture%E2%80%8B.pdf&quot; rel=&quot;noopener noreferrer&quot; target=&quot;_blank&quot;&gt;Accelerating Sparsity in the NVIDIA Ampere Architecture&lt;/a&gt; by the courtesy of NVIDIA.&lt;/p&gt;
" data-image-caption="&lt;p&gt;Figure X: Structure supported by the sparse matrix multiplication feature in Ampere GPUs. Figure is taken from Jeff Pool&#8217;s GTC 2020 presentation on  &lt;a href=&quot;https://developer.download.nvidia.com/video/gputechconf/gtc/2020/presentations/s22085-accelerating-sparsity-in-the-nvidia-ampere-architecture%E2%80%8B.pdf&quot; rel=&quot;noopener noreferrer&quot; target=&quot;_blank&quot;&gt;Accelerating Sparsity in the NVIDIA Ampere Architecture&lt;/a&gt; by the courtesy of NVIDIA.&lt;/p&gt;
" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/sparse_matrix_ampere.png?fit=249%2C300&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/sparse_matrix_ampere.png?fit=321%2C387&amp;ssl=1" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/sparse_matrix_ampere.png?resize=258%2C311&#038;ssl=1" alt="Figure 1: Structure supported by the sparse matrix multiplication feature in Ampere GPUs. The figure is taken from Jeff Pool's GTC 2020 presentation on  Accelerating Sparsity in the NVIDIA Ampere Architecture by the courtesy of NVIDIA." class="wp-image-935" width="258" height="311" srcset="https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/sparse_matrix_ampere.png?w=321&amp;ssl=1 321w, https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/sparse_matrix_ampere.png?resize=249%2C300&amp;ssl=1 249w" sizes="(max-width: 258px) 100vw, 258px" data-recalc-dims="1" /><figcaption>Figure 1: Structure supported by the sparse matrix multiplication feature in Ampere GPUs. The figure is taken from Jeff Pool&#8217;s GTC 2020 presentation on <a href="https://developer.download.nvidia.com/video/gputechconf/gtc/2020/presentations/s22085-accelerating-sparsity-in-the-nvidia-ampere-architecture%E2%80%8B.pdf" rel="noreferrer noopener" target="_blank">Accelerating Sparsity in the NVIDIA Ampere Architecture</a> by the courtesy of NVIDIA.</figcaption></figure></div>


<p class="eplus-JGsMdm">When you multiply this sparse weight matrix with some dense inputs, the sparse matrix tensor core feature in Ampere automatically compresses the sparse matrix to a dense representation that is half the size as can be seen in Figure 2. After this compression, the densely compressed matrix tile is fed into the tensor core which computes a matrix multiplication of twice the usual size. This effectively yields a 2x speedup since the bandwidth requirements during matrix multiplication from shared memory are halved.</p>



<figure class="wp-block-image size-large eplus-O3WVqX"><img data-attachment-id="934" data-permalink="https://timdettmers.com/sparse_matmul/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/sparse_matmul.png?fit=1055%2C638&amp;ssl=1" data-orig-size="1055,638" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Sparse Matrix Multiplication in Ampere" data-image-description="&lt;p&gt;Figure X: The sparse matrix is compressed to a dense representation before the matrix multiplication is performed. Figure is taken from Jeff Pool&#8217;s GTC 2020 presentation on  &lt;a href=&quot;https://developer.download.nvidia.com/video/gputechconf/gtc/2020/presentations/s22085-accelerating-sparsity-in-the-nvidia-ampere-architecture%E2%80%8B.pdf&quot; rel=&quot;noopener noreferrer&quot; target=&quot;_blank&quot;&gt;Accelerating Sparsity in the NVIDIA Ampere Architecture&lt;/a&gt; by the courtesy of NVIDIA.&lt;/p&gt;
" data-image-caption="&lt;p&gt;Figure X: The sparse matrix is compressed to a dense representation before the matrix multiplication is performed. Figure is taken from Jeff Pool&#8217;s GTC 2020 presentation on  &lt;a href=&quot;https://developer.download.nvidia.com/video/gputechconf/gtc/2020/presentations/s22085-accelerating-sparsity-in-the-nvidia-ampere-architecture%E2%80%8B.pdf&quot; rel=&quot;noopener noreferrer&quot; target=&quot;_blank&quot;&gt;Accelerating Sparsity in the NVIDIA Ampere Architecture&lt;/a&gt; by the courtesy of NVIDIA.&lt;/p&gt;
" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/sparse_matmul.png?fit=300%2C181&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/sparse_matmul.png?fit=1024%2C619&amp;ssl=1" width="1024" height="619" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/sparse_matmul.png?resize=1024%2C619&#038;ssl=1" alt="Figure 2: The sparse matrix is compressed to a dense representation before the matrix multiplication is performed. " class="wp-image-934" srcset="https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/sparse_matmul.png?resize=1024%2C619&amp;ssl=1 1024w, https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/sparse_matmul.png?resize=300%2C181&amp;ssl=1 300w, https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/sparse_matmul.png?resize=768%2C464&amp;ssl=1 768w, https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/sparse_matmul.png?w=1055&amp;ssl=1 1055w" sizes="(max-width: 1000px) 100vw, 1000px" data-recalc-dims="1" /><figcaption>Figure 2: The sparse matrix is compressed to a dense representation before the matrix multiplication is performed. The figure is taken from Jeff Pool&#8217;s GTC 2020 presentation on  <a href="https://developer.download.nvidia.com/video/gputechconf/gtc/2020/presentations/s22085-accelerating-sparsity-in-the-nvidia-ampere-architecture%E2%80%8B.pdf" rel="noopener noreferrer" target="_blank">Accelerating Sparsity in the NVIDIA Ampere Architecture</a> by the courtesy of NVIDIA.</figcaption></figure>



<p class="eplus-dCX1Ah">I was working on <a href="https://arxiv.org/abs/1907.04840">sparse network training</a> in my research and I also wrote a <a href="https://timdettmers.com/2019/07/11/sparse-networks-from-scratch/">blog post about sparse training</a>. One criticism of my work was that “You reduce the FLOPS required for the network, but it does not yield speedups because GPUs cannot do fast sparse matrix multiplication.” Well, with the addition of the sparse matrix multiplication feature for Tensor Cores, my algorithm, or <a href="https://arxiv.org/abs/2002.03231" rel="nofollow">other</a> <a href="https://arxiv.org/abs/2002.07376" rel="nofollow">sparse</a> <a href="https://arxiv.org/abs/1911.11134" rel="nofollow">training</a> <a href="https://arxiv.org/abs/1902.05967" rel="nofollow">algorithms</a>, now actually provide speedups of up to 2x during training.</p>



<figure class="wp-block-image size-large eplus-uspqxA"><a href="https://arxiv.org/abs/1907.04840"><img data-attachment-id="779" data-permalink="https://timdettmers.com/2019/07/11/sparse-networks-from-scratch/sparse_momentum/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2019/07/sparse_momentum.png?fit=1096%2C528&amp;ssl=1" data-orig-size="1096,528" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Sparse Momentum Dettmers &#038; Zettlemoyer 2019" data-image-description="&lt;p&gt;Figure X: The sparse training algorithm developed has three stages: (1) Determine the importance of each layer. (2) Remove the smallest, unimportant weights. (3) Grow new weights proportional to the importance of each layers.&lt;/p&gt;
" data-image-caption="&lt;p&gt;Figure X: The sparse training algorithm developed has three stages: (1) Determine the importance of each layer. (2) Remove the smallest, unimportant weights. (3) Grow new weights proportional to the importance of each layers.&lt;/p&gt;
" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2019/07/sparse_momentum.png?fit=300%2C145&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2019/07/sparse_momentum.png?fit=1024%2C493&amp;ssl=1" width="1024" height="493" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2019/07/sparse_momentum.png?resize=1024%2C493&#038;ssl=1" alt="Figure 3: The sparse training algorithm that I developed has three stages: (1) Determine the importance of each layer. (2) Remove the smallest, unimportant weights. (3) Grow new weights proportional to the importance of each layer. Read more about my work in my sparse training blog post." class="wp-image-779" srcset="https://i0.wp.com/timdettmers.com/wp-content/uploads/2019/07/sparse_momentum.png?resize=1024%2C493&amp;ssl=1 1024w, https://i0.wp.com/timdettmers.com/wp-content/uploads/2019/07/sparse_momentum.png?resize=300%2C145&amp;ssl=1 300w, https://i0.wp.com/timdettmers.com/wp-content/uploads/2019/07/sparse_momentum.png?resize=768%2C370&amp;ssl=1 768w, https://i0.wp.com/timdettmers.com/wp-content/uploads/2019/07/sparse_momentum.png?w=1096&amp;ssl=1 1096w" sizes="(max-width: 1000px) 100vw, 1000px" data-recalc-dims="1" /></a><figcaption>Figure 3: The <a href="https://arxiv.org/abs/1907.04840">sparse training algorithm</a> that I developed has three stages: (1) Determine the importance of each layer. (2) Remove the smallest, unimportant weights. (3) Grow new weights proportional to the importance of each layer. Read more about my work in my <a href="https://timdettmers.com/2019/07/11/sparse-networks-from-scratch/">sparse training blog post</a>.</figcaption></figure>



<p class="eplus-9YQAyM">While this feature is still experimental and training sparse networks are not commonplace yet, having this feature on your GPU means you are ready for the future of sparse training.</p>



<h3 class="eplus-uvNoM4">Low-precision Computation</h3>



<p class="eplus-AgG4J1">In my work, I’ve previously shown that new data types can improve stability during <a href="https://arxiv.org/abs/1511.04561">low-precision backpropagation</a>. </p>



<figure class="wp-block-image size-large eplus-4aBkKy"><img data-attachment-id="941" data-permalink="https://timdettmers.com/2023/01/30/which-gpu-for-deep-learning/8-bit_data_types/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/8-bit_data_types.png?fit=869%2C268&amp;ssl=1" data-orig-size="869,268" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="8-bit_data_types" data-image-description="&lt;p&gt;Figure X: Low-precision deep learning 8-bit datatypes that I developed. Deep learning training benefits from highly specialized data types. My dynamic tree datatype uses a dynamic bit that indicates the beginning of a binary bisection tree that quantized the range [0, 0.9] while all previous bits are used for the exponent. This allows to dynamically represent large numbers and small numbers with high precision.&lt;/p&gt;
" data-image-caption="&lt;p&gt;Figure X: Low-precision deep learning 8-bit datatypes that I developed. Deep learning training benefits from highly specialized data types. My dynamic tree datatype uses a dynamic bit that indicates the beginning of a binary bisection tree that quantized the range [0, 0.9] while all previous bits are used for the exponent. This allows to dynamically represent large numbers and small numbers with high precision.&lt;/p&gt;
" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/8-bit_data_types.png?fit=300%2C93&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/8-bit_data_types.png?fit=869%2C268&amp;ssl=1" width="869" height="268" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/8-bit_data_types.png?resize=869%2C268&#038;ssl=1" alt="Figure 4: Low-precision deep learning 8-bit datatypes that I developed. Deep learning training benefits from highly specialized data types. My dynamic tree datatype uses a dynamic bit that indicates the beginning of a binary bisection tree that quantized the range [0, 0.9] while all previous bits are used for the exponent. This allows to dynamically represent numbers that are both large and small with high precision." class="wp-image-941" srcset="https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/8-bit_data_types.png?w=869&amp;ssl=1 869w, https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/8-bit_data_types.png?resize=300%2C93&amp;ssl=1 300w, https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/8-bit_data_types.png?resize=768%2C237&amp;ssl=1 768w" sizes="(max-width: 869px) 100vw, 869px" data-recalc-dims="1" /><figcaption>Figure 4: Low-precision deep learning 8-bit datatypes that I developed. Deep learning training benefits from highly specialized data types. My dynamic tree datatype uses a dynamic bit that indicates the beginning of a binary bisection tree that quantized the range [0, 0.9] while all previous bits are used for the exponent. This allows to dynamically represent numbers that are both large and small with high precision.</figcaption></figure>



<p class="eplus-3DDVFs">Currently, if you want to have stable backpropagation with 16-bit floating-point numbers (FP16), the big problem is that ordinary FP16 data types only support numbers in the range [-65,504, 65,504]. If your gradient slips past this range, your gradients explode into NaN values. To prevent this during FP16 training, we usually perform loss scaling where you multiply the loss by a small number before backpropagating to prevent this gradient explosion.&nbsp;</p>



<p class="eplus-WQx9qD">The BrainFloat 16 format (BF16) uses more bits for the exponent such that the range of possible numbers is the same as for FP32: [-3*10^38, 3*10^38]. BF16 has less precision, that is significant digits, but gradient precision is not that important for learning. So what BF16 does is that you no longer need to do any loss scaling or worry about the gradient blowing up quickly. As such, we should see an increase in training stability by using the BF16 format as a slight loss of precision.</p>



<p class="eplus-NLJqlG">What this means for you: With BF16 precision, training might be more stable than with FP16 precision while providing the same speedups. With 32-bit TensorFloat (TF32) precision, you get near FP32 stability while giving the speedups close to FP16. The good thing is, to use these data types, you can just replace FP32 with TF32 and FP16 with BF16 — no code changes required!</p>



<p class="eplus-S1SD30">Overall, though, these new data types can be seen as lazy data types in the sense that you could have gotten all the benefits with the old data types with some additional programming efforts (proper loss scaling, initialization, normalization, using Apex). As such, these data types do not provide speedups but rather improve ease of use of low precision for training.</p>


<div class="crp_related   crp_related_block  mobile-only crp-rounded-thumbs"><ul><li><a href="https://timdettmers.com/2026/01/23/my-journey-towards-coding-agents-building-sera/"     class="crp_link post-1248"><figure><img loading="lazy"  width="150" height="150"  src="https://i0.wp.com/timdettmers.com/wp-content/plugins/contextual-related-posts/default.png?resize=150%2C150&#038;ssl=1" class="crp_thumb crp_default_thumb" alt="My Journey Towards Coding Agents: Building SERA" title="My Journey Towards Coding Agents: Building SERA" data-recalc-dims="1" /></figure><span class="crp_title">My Journey Towards Coding Agents: Building SERA</span></a></li><li><a href="https://timdettmers.com/2026/01/13/use-agents-or-be-left-behind/"     class="crp_link post-1238"><figure><img loading="lazy"  width="150" height="150"  src="https://i0.wp.com/timdettmers.com/wp-content/plugins/contextual-related-posts/default.png?resize=150%2C150&#038;ssl=1" class="crp_thumb crp_default_thumb" alt="Use Agents or Be Left Behind? A Personal Guide to Automating Your Own Work" title="Use Agents or Be Left Behind? A Personal Guide to Automating Your Own Work" data-recalc-dims="1" /></figure><span class="crp_title">Use Agents or Be Left Behind? A Personal Guide to Automating&hellip;</span></a></li><li><a href="https://timdettmers.com/2025/12/10/why-agi-will-not-happen/"     class="crp_link post-1233"><figure><img loading="lazy"  width="150" height="150"  src="https://i0.wp.com/timdettmers.com/wp-content/plugins/contextual-related-posts/default.png?resize=150%2C150&#038;ssl=1" class="crp_thumb crp_default_thumb" alt="Why AGI Will Not Happen" title="Why AGI Will Not Happen" data-recalc-dims="1" /></figure><span class="crp_title">Why AGI Will Not Happen</span></a></li></ul><div class="crp_clear"></div></div>


<h3 class="eplus-UXUbWi">Fan Designs  and GPUs Temperature Issues</h3>



<p class="eplus-yw9sMm">While the new fan design of the RTX 30 series performs very well to cool the GPU, different fan designs of non-founders edition GPUs might be more problematic. If your GPU heats up beyond 80C, it will throttle itself and slow down its computational speed / power. This overheating can happen in particular if you stack multiple GPUs next to each other. A solution to this is to use PCIe extenders to create space between GPUs.</p>



<p class="eplus-CTvlva">Spreading GPUs with PCIe extenders is very effective for cooling, and other fellow PhD students at the University of Washington and I use this setup with great success. It does not look pretty, but it keeps your GPUs cool! This has been running with no problems at all for 4 years now. It can also help if you do not have enough space to fit all GPUs in the PCIe slots. For example, if you can find the space within a desktop computer case, it might be possible to buy standard 3-slot-width RTX 4090 and spread them with PCIe extenders within the case. With this, you might solve both the space issue and cooling issue for a 4x RTX 4090 setup with a single simple solution.</p>


<div class="wp-block-image eplus-dDY0Kb">
<figure class="aligncenter size-large"><img data-attachment-id="861" data-permalink="https://timdettmers.com/4x_rtx2080ti_desktop_extenders/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/4x_RTX2080Ti_desktop_extenders-scaled.jpg?fit=1920%2C2560&amp;ssl=1" data-orig-size="1920,2560" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;1.9&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;Redmi Note 5&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1557156443&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;3.94&quot;,&quot;iso&quot;:&quot;1250&quot;,&quot;shutter_speed&quot;:&quot;0.05&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}" data-image-title="4x_RTX2080Ti_desktop_extenders" data-image-description="&lt;p&gt;4x GPUs with PCIe extenders&lt;/p&gt;
" data-image-caption="&lt;p&gt;4x GPUs with PCIe extenders&lt;/p&gt;
" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/4x_RTX2080Ti_desktop_extenders-scaled.jpg?fit=225%2C300&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/4x_RTX2080Ti_desktop_extenders-scaled.jpg?fit=768%2C1024&amp;ssl=1" width="768" height="1024" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/4x_RTX2080Ti_desktop_extenders.jpg?resize=768%2C1024&#038;ssl=1" alt="Figure 5: 4x GPUs with PCIe extenders. It looks like a mess, but it is very effective for cooling. I used this rig for 2 years and cooling is excellent despite problematic RTX 2080 Ti Founders Edition GPUs." class="wp-image-861" srcset="https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/4x_RTX2080Ti_desktop_extenders-scaled.jpg?resize=768%2C1024&amp;ssl=1 768w, https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/4x_RTX2080Ti_desktop_extenders-scaled.jpg?resize=225%2C300&amp;ssl=1 225w, https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/4x_RTX2080Ti_desktop_extenders-scaled.jpg?resize=1152%2C1536&amp;ssl=1 1152w, https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/4x_RTX2080Ti_desktop_extenders-scaled.jpg?resize=1536%2C2048&amp;ssl=1 1536w, https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/4x_RTX2080Ti_desktop_extenders-scaled.jpg?w=1920&amp;ssl=1 1920w" sizes="(max-width: 768px) 100vw, 768px" data-recalc-dims="1" /><figcaption>Figure 5: 4x GPUs with PCIe extenders. It looks like a mess, but it is very effective for cooling. I used this rig for 4 years and cooling is excellent despite problematic RTX 2080 Ti Founders Edition GPUs.</figcaption></figure></div>


<h3 class="eplus-JbBDhp">3-slot Design and Power Issues</h3>



<p class="eplus-DovhM1">The RTX 3090 and RTX 4090 are 3-slot GPUs, so one will not be able to use it in a 4x setup with the default fan design from NVIDIA. This is kind of justified because it runs at over 350W TDP, and it will be difficult to cool in a multi-GPU 2-slot setting. The RTX 3080 is only slightly better at 320W TDP, and cooling a 4x RTX 3080 setup will also be very difficult.</p>



<p class="eplus-pfi9QE">It is also difficult to power a 4x 350W = 1400W or 4x 450W = 1800W system in the 4x RTX 3090 or 4x RTX 4090 case. Power supply units (PSUs) of 1600W are readily available, but having only 200W to power the <a href="https://timdettmers.com/2018/12/16/deep-learning-hardware-guide/">CPU and motherboard</a> can be too tight. The components’ maximum power is only used if the components are fully utilized, and in deep learning, the CPU is usually only under weak load. With that, a 1600W PSU might work quite well with a 4x RTX 3080 build, but for a 4x RTX 3090 build, it is better to look for high wattage PSUs (+1700W). Some of my followers have had great success with cryptomining PSUs — have a look in the comment section for more info about that. Otherwise, it is important to note that not all outlets support PSUs above 1600W, especially in the US. This is the reason why in the US, there are currently few standard desktop PSUs above 1600W on the market. If you get a server or cryptomining PSUs, beware of the form factor — make sure it fits into your computer case.</p>



<h3 class="eplus-wvweIn">Power Limiting: An Elegant Solution to Solve the Power Problem?</h3>



<p class="eplus-eq3oCc">It is possible to set a power limit on your GPUs. So you would be able to programmatically set the power limit of an RTX 3090 to 300W instead of their standard 350W. In a 4x GPU system, that is a saving of 200W, which might just be enough to build a 4x RTX 3090 system with a 1600W PSU feasible. It also helps to keep the GPUs cool. So setting a power limit can solve the two major problems of a 4x RTX 3080 or 4x RTX 3090 setups, cooling, and power, at the same time. For a 4x setup, you still need effective blower GPUs (and the standard design may prove adequate for this), but this resolves the PSU problem.</p>



<figure class="wp-block-image size-large eplus-uDERbv"><img data-attachment-id="933" data-permalink="https://timdettmers.com/power_limit_nvidia_smi/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/power_limit_nvidia_smi.png?fit=1187%2C1195&amp;ssl=1" data-orig-size="1187,1195" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Power Limit Cooling Effect NVIDIA SMI" data-image-description="&lt;p&gt;Figure X: Reducing the power limit has a slight cooling effect. Reducing the RTX 2080 Ti power limit by 50-60 W decreases temperatures slightly and fans run more silent.&lt;/p&gt;
" data-image-caption="&lt;p&gt;Figure X: Reducing the power limit has a slight cooling effect. Reducing the RTX 2080 Ti power limit by 50-60 W decreases temperatures slightly and fans run more silent.&lt;/p&gt;
" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/power_limit_nvidia_smi.png?fit=298%2C300&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/power_limit_nvidia_smi.png?fit=1017%2C1024&amp;ssl=1" width="1017" height="1024" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/power_limit_nvidia_smi.png?resize=1017%2C1024&#038;ssl=1" alt="Figure 6: Reducing the power limit has a slight cooling effect. Reducing the RTX 2080 Ti power limit by 50-60 W decreases temperatures slightly and fans run more silent." class="wp-image-933" srcset="https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/power_limit_nvidia_smi.png?resize=1017%2C1024&amp;ssl=1 1017w, https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/power_limit_nvidia_smi.png?resize=298%2C300&amp;ssl=1 298w, https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/power_limit_nvidia_smi.png?resize=150%2C150&amp;ssl=1 150w, https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/power_limit_nvidia_smi.png?resize=768%2C773&amp;ssl=1 768w, https://i0.wp.com/timdettmers.com/wp-content/uploads/2020/09/power_limit_nvidia_smi.png?w=1187&amp;ssl=1 1187w" sizes="(max-width: 1000px) 100vw, 1000px" data-recalc-dims="1" /><figcaption>Figure 6: Reducing the power limit has a slight cooling effect. Reducing the RTX 2080 Ti power limit by 50-60 W decreases temperatures slightly and fans run more silent.</figcaption></figure>



<p class="eplus-dIRoAn">You might ask, “Doesn’t this slow down the GPU?” Yes, it does, but the question is by how much. I benchmarked the 4x RTX 2080 Ti system shown in Figure 5 under different power limits to test this. I benchmarked the time for 500 mini-batches for BERT Large during inference (excluding the softmax layer). I choose BERT Large inference since, from my experience, this is the deep learning model that stresses the GPU the most. As such, I would expect power limiting to have the most massive slowdown for this model. As such, the slowdowns reported here are probably close to the maximum slowdowns that you can expect. The results are shown in Figure 7. </p>



<figure class="wp-block-image size-large eplus-WIGOOF"><img data-attachment-id="939" data-permalink="https://timdettmers.com/rtx-2080-ti-slowdown-vs-power-limit/" data-orig-file="https://timdettmers.com/wp-content/uploads/2020/09/RTX-2080-Ti-Slowdown-vs-Power-Limit.svg" data-orig-size="853,703" data-comments-opened="1" data-image-meta="[]" data-image-title="RTX 2080 Ti Slowdown vs Power Limit" data-image-description="&lt;p&gt;Figure 6: Measured slowdown for a given power limit on an RTX 2080 Ti. Measurements taken are mean processing times for 500 mini-batches of BERT Large during inference (excluding softmax layer).&lt;/p&gt;
" data-image-caption="&lt;p&gt;Figure 6: Measured slowdown for a given power limit on an RTX 2080 Ti. Measurements taken are mean processing times for 500 mini-batches of BERT Large during inference (excluding softmax layer).&lt;/p&gt;
" data-medium-file="https://timdettmers.com/wp-content/uploads/2020/09/RTX-2080-Ti-Slowdown-vs-Power-Limit.svg" data-large-file="https://timdettmers.com/wp-content/uploads/2020/09/RTX-2080-Ti-Slowdown-vs-Power-Limit.svg" width="853" height="703" src="https://timdettmers.com/wp-content/uploads/2020/09/RTX-2080-Ti-Slowdown-vs-Power-Limit.svg" alt="Figure 7: Measured slowdown for a given power limit on an RTX 2080 Ti. Measurements taken are mean processing times for 500 mini-batches of BERT Large during inference (excluding softmax layer)." class="wp-image-939"/><figcaption>Figure 7: Measured slowdown for a given power limit on an RTX 2080 Ti. Measurements taken are mean processing times for 500 mini-batches of BERT Large during inference (excluding softmax layer).</figcaption></figure>



<p class="eplus-FATkvQ">As we can see, setting the power limit does not seriously affect performance. Limiting the power by 50W — more than enough to handle 4x RTX 3090 — decreases performance by only 7%.</p>



<p></p>



<h3>RTX 4090s and Melting Power Connectors: How to Prevent Problems</h3>



<p>There was a misconception that RTX 4090 power cables melt because they were bent. However, it was found that only 0.1% of users had this problem and the problem occured due to user error. Here a video that shows that the main problem is that <a href="https://www.youtube.com/watch?v=ig2px7ofKhQ&amp;t=1065s">cables were not inserted correctly</a>.</p>



<p>So using RTX 4090 cards is perfectly safe if you follow the following install instructions:</p>



<ol><li>If you use an old cable or old GPU make sure the contacts are free of debri / dust.</li><li>Use the power connector and stick it into the socket until you hear a *click* — this is the most important part.</li><li>Test for good fit by wiggling the power cable left to right. The cable should not move.</li><li>Check the contact with the socket visually, there should be no gap between cable and socket.</li></ol>



<h3>8-bit Float Support in H100 and RTX 40 series GPUs</h3>



<p>The support of the 8-bit Float (FP8) is a huge advantage for the RTX 40 series and H100 GPUs. With 8-bit inputs it allows you to load the data for matrix multiplication twice as fast, you can store twice as much matrix elements in your caches which in the Ada and Hopper architecture are very large, and now with FP8 tensor cores you get 0.66 PFLOPS of compute for a RTX 4090 — this is more FLOPS then the entirety of the worlds fastest supercomputer in year 2007. 4x RTX 4090 with FP8 compute rival the faster supercomputer in the world in year 2010 (deep learning started to work just in 2009).</p>



<p>The main problem with using 8-bit precision is that transformers can get very unstable with so few bits and crash during training or generate non-sense during inference. I have written a <a href="https://arxiv.org/abs/2208.07339">paper about the emergence of instabilities in large language models</a> and I also written a more accessible <a href="https://timdettmers.com/2022/08/17/llm-int8-and-emergent-features/">blog post</a>.</p>



<p>The main take-way is this: Using 8-bit instead of 16-bit makes things very unstable, but if you keep a couple of dimensions in high precision everything works just fine.</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/LLM_int8_zeroshot_emergence.png?ssl=1"><img data-attachment-id="1146" data-permalink="https://timdettmers.com/llm_int8_zeroshot_emergence/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/LLM_int8_zeroshot_emergence.png?fit=1808%2C1462&amp;ssl=1" data-orig-size="1808,1462" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="LLM_int8_zeroshot_emergence" data-image-description="" data-image-caption="&lt;p&gt;Main results from my work on 8-bit matrix multiplication for Large Language Models (LLMs). We can see that the best 8-bit baseline fails to deliver good zero-shot performance. The method that I developed, LLM.int8(), can perform Int8 matrix multiplication with the same results as the 16-bit baseline.&lt;/p&gt;
" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/LLM_int8_zeroshot_emergence.png?fit=300%2C243&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/LLM_int8_zeroshot_emergence.png?fit=1024%2C828&amp;ssl=1" width="1024" height="828" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/LLM_int8_zeroshot_emergence.png?resize=1024%2C828&#038;ssl=1" alt="" class="wp-image-1146" srcset="https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/LLM_int8_zeroshot_emergence.png?resize=1024%2C828&amp;ssl=1 1024w, https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/LLM_int8_zeroshot_emergence.png?resize=300%2C243&amp;ssl=1 300w, https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/LLM_int8_zeroshot_emergence.png?resize=768%2C621&amp;ssl=1 768w, https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/LLM_int8_zeroshot_emergence.png?resize=1536%2C1242&amp;ssl=1 1536w, https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/LLM_int8_zeroshot_emergence.png?w=1808&amp;ssl=1 1808w" sizes="(max-width: 1000px) 100vw, 1000px" data-recalc-dims="1" /></a><figcaption>Main results from my work on 8-bit matrix multiplication for Large Language Models (LLMs). We can see that the best 8-bit baseline fails to deliver good zero-shot performance. The method that I developed, LLM.int8(), can perform Int8 matrix multiplication with the same results as the 16-bit baseline.</figcaption></figure>



<p>But Int8 was already supported by the RTX 30 / A100 / Ampere generation GPUs, why is FP8 in the RTX 40 another big upgrade? The FP8 data type is much more stable than the Int8 data type and its easy to use it in functions like layer norm or non-linear functions, which are difficult to do with Integer data types. This will make it very straightforward to use it in training and inference. I think this will make FP8 training and inference relatively common in a couple of months. </p>



<p>If you want to read more about the advantages of Float vs Integer data types you can read my recent paper about <a href="https://arxiv.org/abs/2212.09720">k-bit inference scaling laws</a>. Below you can see one relevant main result for Float vs Integer data types from this paper. We can see that bit-by-bit, the FP4 data type preserve more information than Int4 data type and thus improves the mean LLM zeroshot accuracy across 4 tasks.</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/pythia_4bit_datatypes2.png?ssl=1"><img data-attachment-id="1151" data-permalink="https://timdettmers.com/pythia_4bit_datatypes2/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/pythia_4bit_datatypes2.png?fit=1159%2C875&amp;ssl=1" data-orig-size="1159,875" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="pythia_4bit_datatypes2" data-image-description="" data-image-caption="&lt;p&gt;4-bit Inference scaling laws for Pythia Large Language Models for different data types. We see that bit-by-bit, 4-bit float data types have better zeroshot accuracy compared to the Int4 data types.&lt;/p&gt;
" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/pythia_4bit_datatypes2.png?fit=300%2C226&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/pythia_4bit_datatypes2.png?fit=1024%2C773&amp;ssl=1" width="1024" height="773" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/pythia_4bit_datatypes2.png?resize=1024%2C773&#038;ssl=1" alt="" class="wp-image-1151" srcset="https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/pythia_4bit_datatypes2.png?resize=1024%2C773&amp;ssl=1 1024w, https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/pythia_4bit_datatypes2.png?resize=300%2C226&amp;ssl=1 300w, https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/pythia_4bit_datatypes2.png?resize=768%2C580&amp;ssl=1 768w, https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/pythia_4bit_datatypes2.png?w=1159&amp;ssl=1 1159w" sizes="(max-width: 1000px) 100vw, 1000px" data-recalc-dims="1" /></a><figcaption>4-bit Inference scaling laws for Pythia Large Language Models for different data types. We see that bit-by-bit, 4-bit float data types have better zeroshot accuracy compared to the Int4 data types.</figcaption></figure>



<h2 class="eplus-A4G25G">Raw Performance Ranking of GPUs</h2>



<p class="eplus-xyHWc1">Below we see a chart of raw relevative performance across all GPUs. We see that there is a gigantic gap in 8-bit performance of H100 GPUs and old cards that are optimized for 16-bit performance.</p>



<p></p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/GPUS_Ada_raw_performance3.png?ssl=1"><img data-attachment-id="1160" data-permalink="https://timdettmers.com/gpus_ada_raw_performance3/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/GPUS_Ada_raw_performance3.png?fit=1703%2C1673&amp;ssl=1" data-orig-size="1703,1673" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="GPUS_Ada_raw_performance3" data-image-description="" data-image-caption="&lt;p&gt;Shown is raw relative performance of GPUs. For example, an RTX 4090 has about 0.33x performance of a H100 SMX for 8-bit inference. In other words, a H100 SMX is three times faster for 8-bit inference compared to a RTX 4090.&lt;/p&gt;
" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/GPUS_Ada_raw_performance3.png?fit=300%2C295&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/GPUS_Ada_raw_performance3.png?fit=1024%2C1006&amp;ssl=1" width="1024" height="1006" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/GPUS_Ada_raw_performance3.png?resize=1024%2C1006&#038;ssl=1" alt="" class="wp-image-1160" srcset="https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/GPUS_Ada_raw_performance3.png?resize=1024%2C1006&amp;ssl=1 1024w, https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/GPUS_Ada_raw_performance3.png?resize=300%2C295&amp;ssl=1 300w, https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/GPUS_Ada_raw_performance3.png?resize=768%2C754&amp;ssl=1 768w, https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/GPUS_Ada_raw_performance3.png?resize=1536%2C1509&amp;ssl=1 1536w, https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/GPUS_Ada_raw_performance3.png?w=1703&amp;ssl=1 1703w" sizes="(max-width: 1000px) 100vw, 1000px" data-recalc-dims="1" /></a><figcaption>Shown is raw relative transformer performance of GPUs. For example, an RTX 4090 has about 0.33x performance of a H100 SMX for 8-bit inference. In other words, a H100 SMX is three times faster for 8-bit inference compared to a RTX 4090.</figcaption></figure>



<p class="eplus-gzQ71E">For this data, I did not model 8-bit compute for older GPUs.  I did so, because 8-bit Inference and training are much more effective on Ada/Hopper GPUs because of the 8-bit Float data type and Tensor Memory Accelerator (TMA) which saves the overhead of computing read/write indices which is particularly helpful for 8-bit matrix multiplication. Ada/Hopper also have FP8 support, which makes in particular 8-bit training much more effective.</p>



<p class="eplus-gzQ71E">I did not model numbers for 8-bit training because to model that I need to know the latency of L1 and L2 caches on Hopper/Ada GPUs, and they are unknown and I do not have access to such GPUs. On Hopper/Ada, 8-bit training performance can well be 3-4x of 16-bit training performance if the caches are as fast as rumored. </p>



<p class="eplus-gzQ71E">But even with the new FP8 tensor cores there are some additional issues which are difficult to take into account when modeling GPU performance. For example, FP8 tensor cores do not support transposed matrix multiplication which means backpropagation needs either a separate transpose before multiplication or one needs to hold two sets of weights — one transposed and one non-transposed — in memory. I used two sets of weight when I experimented with Int8 training in my <a href="https://arxiv.org/abs/2208.07339">LLM.int8()</a> project and this reduced the overall speedups quite significantly. I think one can do better with the right algorithms/software, but this shows that missing features like a transposed matrix multiplication for tensor cores can affect performance.</p>



<p class="eplus-gzQ71E">For old GPUs, Int8 inference performance is close to the 16-bit inference performance for models below 13B parameters. Int8 performance on old GPUs is only relevant if you have relatively large models with 175B parameters or more. If you are interested in 8-bit performance of older GPUs, you can read the Appendix D of my <a href="https://arxiv.org/abs/2208.07339">LLM.int8() paper</a> where I benchmark Int8 performance.</p>



<h2 class="eplus-1SzBFE">GPU Deep Learning Performance per Dollar</h2>



<p>Below we see the chart for the performance per US dollar for all GPUs sorted by 8-bit inference performance. How to use the chart to find a suitable GPU for you is as follows:</p>



<ol><li>Determine the amount of GPU memory that you need (rough heuristic: at least 12 GB for image generation; at least 24 GB for work with transformers)</li><li>While 8-bit inference and training is experimental, it will become standard within 6 months. You might need to do some extra difficult coding to work with 8-bit in the meantime. Is that OK for you? If not, select for 16-bit performance.</li><li>Using the metric determined in (2), find the GPU with the highest relative performance/dollar  that has the amount of memory you need.</li></ol>



<p>We can see that the RTX 4070 Ti is most cost-effective for 8-bit and 16-bit inference while the RTX 3080 remains most cost-effective for 16-bit training. While these GPUs are most cost-effective, they are not necessarily recommended as they do not have sufficient memory for many use-cases. However, it might be the ideal cards to get started on your deep learning journey. Some of these GPUs are excellent for Kaggle competition where one can often rely on smaller models. Since to do well in  Kaggle competitions the method of how you work is more important than the models size, many of these smaller GPUs are excellent for Kaggle competitions. </p>



<p>The best GPUs for academic and startup servers seem to be A6000 Ada GPUs (not to be confused with A6000 Turing). The H100 SXM GPU is also very cost effective and has high memory and very strong performance. If I would build a small cluster for a company/academic lab, I would use 66-80% A6000 GPUs and 20-33% H100 SXM GPUs. If I get a good deal on L40 GPUs, I would also pick them instead of A6000, so you can always ask for a quote on these.</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/GPUs_Ada_performance_per_dollar6.png?ssl=1"><img data-attachment-id="1192" data-permalink="https://timdettmers.com/gpus_ada_performance_per_dollar6/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/GPUs_Ada_performance_per_dollar6.png?fit=1703%2C1673&amp;ssl=1" data-orig-size="1703,1673" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="GPUs_Ada_performance_per_dollar6" data-image-description="" data-image-caption="&lt;p&gt;Shown is relative performance per US Dollar of GPUs normalized by the cost for a desktop computer and the average Amazon and eBay price for each GPU. Additionally, the electricity cost of ownership for 5 years is added with an electricity price of 0.175 USD per kWh and a 15% GPU utilization rate. The electricity cost for a RTX 4090 is about $100 per year. How to read and interpret the chart: a desktop computer with RTX 4070 Ti cards owned for 5 years yields about 2x more 8-bit inference performance per dollar compared to a RTX 3090 GPU.&lt;/p&gt;
" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/GPUs_Ada_performance_per_dollar6.png?fit=300%2C295&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/GPUs_Ada_performance_per_dollar6.png?fit=1024%2C1006&amp;ssl=1" width="1024" height="1006" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/GPUs_Ada_performance_per_dollar6.png?resize=1024%2C1006&#038;ssl=1" alt="" class="wp-image-1192" srcset="https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/GPUs_Ada_performance_per_dollar6.png?resize=1024%2C1006&amp;ssl=1 1024w, https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/GPUs_Ada_performance_per_dollar6.png?resize=300%2C295&amp;ssl=1 300w, https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/GPUs_Ada_performance_per_dollar6.png?resize=768%2C754&amp;ssl=1 768w, https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/GPUs_Ada_performance_per_dollar6.png?resize=1536%2C1509&amp;ssl=1 1536w, https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/GPUs_Ada_performance_per_dollar6.png?w=1703&amp;ssl=1 1703w" sizes="(max-width: 1000px) 100vw, 1000px" data-recalc-dims="1" /></a><figcaption>Shown is relative performance per US Dollar of GPUs normalized by the cost for a desktop computer and the average Amazon and eBay price for each GPU. Additionally, the electricity cost of ownership for 5 years is added with an electricity price of 0.175 USD per kWh and a 15% GPU utilization rate. The electricity cost for a RTX 4090 is about $100 per year. How to read and interpret the chart: a desktop computer with RTX 4070 Ti cards owned for 5 years yields about 2x more 8-bit inference performance per dollar compared to a RTX 3090 GPU.</figcaption></figure>



<p></p>


<div class="crp_related   crp_related_block  mobile-only crp-rounded-thumbs"><ul><li><a href="https://timdettmers.com/2026/01/23/my-journey-towards-coding-agents-building-sera/"     class="crp_link post-1248"><figure><img loading="lazy"  width="150" height="150"  src="https://i0.wp.com/timdettmers.com/wp-content/plugins/contextual-related-posts/default.png?resize=150%2C150&#038;ssl=1" class="crp_thumb crp_default_thumb" alt="My Journey Towards Coding Agents: Building SERA" title="My Journey Towards Coding Agents: Building SERA" data-recalc-dims="1" /></figure><span class="crp_title">My Journey Towards Coding Agents: Building SERA</span></a></li><li><a href="https://timdettmers.com/2026/01/13/use-agents-or-be-left-behind/"     class="crp_link post-1238"><figure><img loading="lazy"  width="150" height="150"  src="https://i0.wp.com/timdettmers.com/wp-content/plugins/contextual-related-posts/default.png?resize=150%2C150&#038;ssl=1" class="crp_thumb crp_default_thumb" alt="Use Agents or Be Left Behind? A Personal Guide to Automating Your Own Work" title="Use Agents or Be Left Behind? A Personal Guide to Automating Your Own Work" data-recalc-dims="1" /></figure><span class="crp_title">Use Agents or Be Left Behind? A Personal Guide to Automating&hellip;</span></a></li><li><a href="https://timdettmers.com/2025/12/10/why-agi-will-not-happen/"     class="crp_link post-1233"><figure><img loading="lazy"  width="150" height="150"  src="https://i0.wp.com/timdettmers.com/wp-content/plugins/contextual-related-posts/default.png?resize=150%2C150&#038;ssl=1" class="crp_thumb crp_default_thumb" alt="Why AGI Will Not Happen" title="Why AGI Will Not Happen" data-recalc-dims="1" /></figure><span class="crp_title">Why AGI Will Not Happen</span></a></li></ul><div class="crp_clear"></div></div>


<h2 class="eplus-RwDsYV">GPU Recommendations</h2>



<p>I have a create a recommendation flow-chart that you can see below (click here for <a href="https://nanx.me/gpu/">interactive app</a> from Nan Xiao). While this chart will help you in 80% of cases, it might not quite work for you because the options might be too expensive. In that case, try to look at the benchmarks above and pick the most cost effective GPU that still has enough GPU memory for your use-case. You can estimate the GPU memory needed by running your problem in the vast.ai or Lambda Cloud for a while so you know what you need. The vast.ai or Lambda Cloud might also work well if you only need a GPU very sporadically (every couple of days for a few hours) and you do not need to download and process large dataset to get started. However, cloud GPUs are usually not a good option if you use your GPU for many months with a high usage rate each day (12 hours each day). You can use the example in the &#8220;When is it better to use the cloud vs a dedicated GPU desktop/server?&#8221; section below to determine if cloud GPUs are good for you.</p>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/gpu_recommendations.png?ssl=1"><img data-attachment-id="1173" data-permalink="https://timdettmers.com/gpu_recommendations/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/gpu_recommendations.png?fit=845%2C686&amp;ssl=1" data-orig-size="845,686" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="gpu_recommendations" data-image-description="" data-image-caption="&lt;p&gt;GPU recommendation chart for Ada/Hopper GPUs. Follow the answers to the Yes/No questions to find the GPU that is most suitable for you. While this chart works well in about 80% of cases, you might end up with a GPU that is too expensive. Use the cost/performance charts above to make a selection instead.&lt;/p&gt;
" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/gpu_recommendations.png?fit=300%2C244&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/gpu_recommendations.png?fit=845%2C686&amp;ssl=1" width="845" height="686" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/gpu_recommendations.png?resize=845%2C686&#038;ssl=1" alt="" class="wp-image-1173" srcset="https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/gpu_recommendations.png?w=845&amp;ssl=1 845w, https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/gpu_recommendations.png?resize=300%2C244&amp;ssl=1 300w, https://i0.wp.com/timdettmers.com/wp-content/uploads/2023/01/gpu_recommendations.png?resize=768%2C623&amp;ssl=1 768w" sizes="(max-width: 845px) 100vw, 845px" data-recalc-dims="1" /></a><figcaption>GPU recommendation chart for Ada/Hopper GPUs. Follow the answers to the Yes/No questions to find the GPU that is most suitable for you. While this chart works well in about 80% of cases, you might end up with a GPU that is too expensive. Use the cost/performance charts above to make a selection instead. [<a href="https://nanx.me/gpu/">interactive app</a>]</figcaption></figure>



<p class="eplus-CQxjtd"></p>



<h3 class="eplus-pb5gym">Is it better to wait for future GPUs for an upgrade? The future of GPUs.</h3>



<p class="eplus-CD5XWA">To understand if it makes sense to skip this generation and buy the next generation of GPUs, it makes sense to talk a bit about what improvements in the future will look like. </p>



<p class="eplus-CD5XWA">In the past it was possible to shrink the size of transistors to improve speed of a processor. This is coming to an end now. For example, while shrinking SRAM increased its speed (smaller distance, faster memory access), this is no longer the case. Current improvements in SRAM do not improve its performance anymore and might even be negative. While logic such as Tensor Cores get smaller, this does not necessarily make GPU faster since the main problem for matrix multiplication is to get memory to the tensor cores which is dictated by SRAM and GPU RAM speed and size. GPU RAM still increases in speed if we stack memory modules into high-bandwidth modules (HBM3+), but these are too expensive to manufacture for consumer applications. The main way to improve raw speed of GPUs is to use more power and more cooling as we have seen in the RTX 30s and 40s series. But this cannot go on for much longer.</p>



<p>Chiplets such as used by AMD CPUs are another straightforward way forward. AMD beat Intel by developing CPU chiplets. Chiplets are small chips that are fused together with a high speed on-chip network. You can think about them as two GPUs that are so physically close together that you can almost consider them a single big GPU. They are cheaper to manufacture, but more difficult to combine into one big chip. So you need know-how and fast connectivity between chiplets. AMD has a lot of experience with chiplet design. AMD&#8217;s next generation GPUs are going to be chiplet designs, while NVIDIA currently has no public plans for such designs. This may mean that the next generation of AMD GPUs might be better in terms of cost/performance compared to NVIDIA GPUs.</p>



<p>However, the main performance boost for GPUs is currently specialized logic. For example, the asynchronous copy hardware units on the Ampere generation (RTX 30 / A100 / RTX 40) or the extension, the Tensor Memory Accelerator (TMA), both reduce the overhead of copying memory from the slow global memory to fast shared memory (caches) through specialized hardware and so each thread can do more computation. The TMA also reduces overhead by performing automatic calculations of read/write indices which is particularly important for 8-bit computation where one has double the elements for the same amount of memory compared to 16-bit computation. So specialized hardware logic can accelerate matrix multiplication further.<br>Low-bit precision is another straightforward way forward for a couple of years. We will see widespread adoption of 8-bit inference and training in the next months. We will see widespread 4-bit inference in the next year. Currently, the technology for 4-bit training does not exists, but research looks promising and I expect the first high performance FP4 Large Language Model (LLM) with competitive predictive performance to be trained in 1-2 years time.</p>



<p>Going to 2-bit precision for training currently looks pretty impossible, but it is a much easier problem than shrinking transistors further. So progress in hardware mostly depends on software and algorithms that make it possible to use specialized features offered by the hardware.</p>



<p>We will probably be able to still improve the combination of algorithms + hardware to the year 2032, but after that will hit the end of GPU improvements (similar to smartphones). The wave of performance improvements after 2032 will come from better networking algorithms and mass hardware. It is uncertain if consumer GPUs will be relevant at this point. It might be that you need an RTX 9090 to run run Super HyperStableDiffusion Ultra Plus 9000 Extra or OpenChatGPT 5.0, but it might also be that some company will offer a high-quality API that is cheaper than the electricity cost for a RTX 9090 and you want to use a laptop + API for image generation and other tasks.</p>



<p>Overall, I think investing into a 8-bit capable GPU will be a very solid investment for the next 9 years. Improvements at 4-bit and 2-bit are likely small and other features like Sort Cores would only become relevant once sparse matrix multiplication can be leveraged well. We will probably see some kind of other advancement in 2-3 years which will make it into the next GPU 4 years from now, but we are running out of steam if we keep relying on matrix multiplication. This makes investments into new GPUs last longer.</p>



<h2 class="eplus-rZBwp1">Question &amp; Answers &amp; Misconceptions</h2>



<h3 class="eplus-BKkk3i">Do I need PCIe 4.0 or PCIe 5.0?</h3>



<p class="eplus-9ByauH">Generally, no. PCIe 5.0 or 4.0 is great if you have a GPU cluster. It is okay if you have an 8x GPU machine, but otherwise, it does not yield many benefits. It allows better parallelization and a bit faster data transfer. Data transfers are not a bottleneck in any application. In computer vision, in the data transfer pipeline, the data storage can be a bottleneck, but not the PCIe transfer from CPU to GPU. So there is no real reason to get a PCIe 5.0 or 4.0 setup for most people. The benefits will be maybe 1-7% better parallelization in a 4 GPU setup.</p>



<h3 class="eplus-iAnpcZ">Do I need 8x/16x PCIe lanes?&nbsp;</h3>



<p class="eplus-4e3Zwd">Same as with PCIe 4.0 — generally, no. <a href="https://timdettmers.com/2018/12/16/deep-learning-hardware-guide/">PCIe lanes</a> are needed for parallelization and fast data transfers, which are seldom a bottleneck. Operating GPUs on 4x lanes is fine, especially if you only have 2 GPUs. For a 4 GPU setup, I would prefer 8x lanes per GPU, but running them at 4x lanes will probably only decrease performance by around 5-10% if you parallelize across all 4 GPUs.</p>



<h3 class="eplus-5dLLUU">How do I fit 4x RTX 4090 or 3090 if they take up 3 PCIe slots each?</h3>



<p class="eplus-ZiOIiH">You need to get one of the two-slot variants, or you can try to spread them out with PCIe extenders. Besides space, you should also immediately think about cooling and a suitable PSU.</p>



<p class="eplus-hKh4h6">PCIe extenders might also solve both space and cooling issues, but you need to make sure that you have enough space in your case to spread out the GPUs. Make sure your PCIe extenders are long enough!</p>



<h3 class="eplus-2ceRV0">How do I cool 4x RTX 3090 or 4x RTX 3080?</h3>



<p class="eplus-Fchmll">See the previous section.</p>



<h3 class="eplus-hlYdEC">Can I use multiple GPUs of different GPU types?</h3>



<p class="eplus-cOwKhd">Yes, you can! But you cannot parallelize efficiently across GPUs of different types since you will often go at the speed of the slowest GPU (data and fully sharded parallelism).  So different GPUs work just fine, but parallelization across those GPUs will be inefficient since the fastest GPU will wait for the slowest GPU to catch up to a synchronization point (usually gradient update).</p>



<h3 class="eplus-YbZb25">What is NVLink, and is it useful?</h3>



<p class="eplus-kZZzbt">Generally, NVLink is not useful. NVLink is a high speed interconnect between GPUs. It is useful if you have a GPU cluster with +128 GPUs. Otherwise, it yields almost no benefits over standard PCIe transfers.</p>



<h3 class="eplus-pqooRC">I do not have enough money, even for the cheapest GPUs you recommend. What can I do?</h3>



<p class="eplus-ClLhtz">Definitely buy used GPUs. You can buy a small cheap GPU for prototyping and testing and then roll out for full experiments to the cloud like vast.ai or Lambda Cloud. This can be cheap if you train/fine-tune/inference on large models only every now and then and spent more time protoyping on smaller models.</p>



<h3 class="eplus-OqapSw">What is the carbon footprint of GPUs? How can I use GPUs without polluting the environment?</h3>



<p class="eplus-zai7Ps">I built a <a href="https://github.com/TimDettmers/carbonneutral">carbon calculator</a> for calculating your carbon footprint for academics (carbon from flights to conferences + GPU time). The calculator can also be used to calculate a pure GPU carbon footprint. You will find that GPUs produce much, much more carbon than international flights. As such, you should make sure you have a green source of energy if you do not want to have an astronomical carbon footprint. If no electricity provider in our area provides green energy, the best way is to buy carbon offsets. Many people are skeptical about carbon offsets. Do they work? Are they scams?</p>



<p class="eplus-EWsGx0">I believe skepticism just hurts in this case, because not doing anything would be more harmful than risking the probability of getting scammed. If you worry about scams, just invest in a portfolio of offsets to minimize risk.</p>



<p class="eplus-69USNG">I worked on a project that produced carbon offsets about ten years ago. The carbon offsets were generated by burning leaking methane from mines in China. UN officials tracked the process, and they required clean digital data and physical inspections of the project site. In that case, the carbon offsets that were produced were highly reliable. I believe many other projects have similar quality standards.</p>



<h3 class="eplus-3vCLFD">What do I need to parallelize across two machines?</h3>



<p class="eplus-fTOuun">If you want to be on the safe side, you should get at least +50Gbits/s network cards to gain speedups if you want to parallelize across machines. I recommend having at least an EDR Infiniband setup, meaning a network card with at least 50 GBit/s bandwidth. Two EDR cards with cable are about $500 on eBay.</p>



<p class="eplus-9X2IIc">In some cases, you might be able to get away with 10 Gbit/s Ethernet, but this is usually only the case for special networks (certain convolutional networks) or if you use certain algorithms (Microsoft DeepSpeed).</p>



<h3 class="eplus-PgjlVt">Is the sparse matrix multiplication features suitable for sparse matrices in general?</h3>



<p class="eplus-R0OltN">It does not seem so. Since the granularity of the sparse matrix needs to have 2 zero-valued elements, every 4 elements, the sparse matrices need to be quite structured. It might be possible to adjust the algorithm slightly, which involves that you pool 4 values into a compressed representation of 2 values, but this also means that precise arbitrary sparse matrix multiplication is not possible with Ampere GPUs.</p>



<h3 class="eplus-MYBgIz">Do I need an Intel CPU to power a multi-GPU setup?</h3>



<p class="eplus-ILUHTD">I do not recommend Intel CPUs unless you heavily use CPUs in Kaggle competitions (heavy linear algebra on the CPU). Even for Kaggle competitions AMD CPUs are still great, though. AMD CPUs are cheaper and better than Intel CPUs in general for deep learning. For a 4x GPU built, my go-to CPU would be a Threadripper. We built dozens of systems at our university with Threadrippers, and they all work great — no complaints yet. For 8x GPU systems, I would usually go with CPUs that your vendor has experience with. CPU and PCIe/system reliability is more important in 8x systems than straight performance or straight cost-effectiveness.</p>



<h3 class="eplus-V6H8gS">Does computer case design matter for cooling?</h3>



<p class="eplus-rSzCnL">No. GPUs are usually perfectly cooled if there is at least a small gap between GPUs. Case design will give you 1-3 C better temperatures, space between GPUs will provide you with 10-30 C improvements. The bottom line, if you have space between GPUs, cooling does not matter. If you have no space between GPUs, you need the right cooler design (blower fan) or another solution (water cooling, PCIe extenders), but in either case, case design and case fans do not matter.</p>



<h3 class="eplus-Umve55">Will AMD GPUs + ROCm ever catch up with NVIDIA GPUs + CUDA?</h3>



<p class="eplus-sOjnl6">Not in the next 1-2 years. It is a three-way problem: Tensor Cores, software, and community.&nbsp;</p>



<p class="eplus-NfDW5K">AMD GPUs are great in terms of pure silicon: Great FP16 performance, great memory bandwidth. However, their lack of Tensor Cores or the equivalent makes their deep learning performance poor compared to NVIDIA GPUs. Packed low-precision math does not cut it. Without this hardware feature, AMD GPUs will never be competitive. Rumors show that <a href="https://wccftech.com/amd-cdna-architecture-radeon-instinct-arcturus-gpu-120-cu-7680-cores/">some data center card</a> with Tensor Core equivalent is planned for 2020, but no new data emerged since then. Just having data center cards with a Tensor Core equivalent would also mean that few would be able to afford such AMD GPUs, which would give NVIDIA a competitive advantage.</p>



<p class="eplus-O3Dvhx">Let’s say AMD introduces a Tensor-Core-like-hardware feature in the future. Then many people would say, “But there is no software that works for AMD GPUs! How am I supposed to use them?” This is mostly a misconception. The AMD software via ROCm has come to a long way, and support via PyTorch is excellent. While I have not seen many experience reports for AMD GPUs + PyTorch, all the software features are integrated. It seems, if you pick any network, you will be just fine running it on AMD GPUs. So here AMD has come a long way, and this issue is more or less solved.</p>



<p class="eplus-OTgr4r">However, if you solve software and the lack of Tensor Cores, AMD still has a problem: the lack of community. If you have a problem with NVIDIA GPUs, you can Google the problem and find a solution. That builds a lot of trust in NVIDIA GPUs. You have the infrastructure that makes using NVIDIA GPUs easy (any deep learning framework works, any scientific problem is well supported). You have the hacks and tricks that make usage of NVIDIA GPUs a breeze (e.g., apex). You can find experts on NVIDIA GPUs and programming around every other corner while I knew much less AMD GPU experts.</p>



<p class="eplus-9AWxYr">In the community aspect, AMD is a bit like Julia vs Python. Julia has a lot of potential, and many would say, and rightly so, that it is the superior programming language for scientific computing. Yet, Julia is barely used compared to Python. This is because the Python community is very strong. Numpy, SciPy, Pandas are powerful software packages that a large number of people congregate around. This is very similar to the NVIDIA vs AMD issue.</p>



<p class="eplus-o6eRO8">Thus, it is likely that AMD will not catch up until Tensor Core equivalent is introduced (1/2 to 1 year?) and a strong community is built around ROCm (2 years?). AMD will always snatch a part of the market share in specific subgroups (e.g., cryptocurrency mining, data centers). Still, in deep learning, NVIDIA will likely keep its monopoly for at least a couple more years.</p>



<h3 class="eplus-OkbBy3">When is it better to use the cloud vs a dedicated GPU desktop/server?</h3>



<p class="eplus-eFDtSu">Rule-of-thumb: If you expect to do deep learning for longer than a year, it is cheaper to get a desktop GPU. Otherwise, cloud instances are preferable unless you have extensive cloud computing skills and want the benefits of scaling the number of GPUs up and down at will.</p>



<p>Numbers in the following paragraphs are going to change, but it serves as a scenario that helps you to understand the rough costs. You can use similar math to determine if cloud GPUs are the best solution for you.</p>



<p class="eplus-i5Jvrp">For the exact point in time when a cloud GPU is more expensive than a desktop depends highly on the service that you are using, and it is best to do a little math on this yourself. Below I do an example calculation for an AWS V100 spot instance with 1x V100 and compare it to the price of a desktop with a single RTX 3090 (similar performance). The desktop with RTX 3090 costs $2,200 (<a ref="https://pcpartpicker.com/user/tim_dettmers/saved/#view=mZ2rD3">2-GPU barebone</a> + RTX 3090). Additionally, assuming you are in the US, there is an additional $0.12 per kWh for electricity. This compares to $2.14 per hour for the AWS on-demand instance.</p>



<p class="eplus-sF5f8X">At 15% utilization per year, the desktop uses:&nbsp;</p>



<p class="eplus-jfhFj2">(350 W (GPU) + 100 W (CPU))*0.15 (utilization) * 24 hours * 365 days = 591 kWh per year</p>



<p class="eplus-uZPGyz">So 591 kWh of electricity per year, that is an additional $71.</p>



<p class="eplus-EqZNc1">The break-even point for a desktop vs a cloud instance at 15% utilization (you use the cloud instance 15% of time during the day), would be about 300 days ($2,311 vs $2,270):</p>



<p class="eplus-WO1NL4">$2.14/h * 0.15 (utilization) * 24 hours * 300 days = $2,311</p>



<p class="eplus-3brSoQ">So if you expect to run deep learning models after 300 days, it is better to buy a desktop instead of using AWS on-demand instances.</p>



<p class="eplus-CmY2qr">You can do similar calculations for any cloud service to make the decision if you go for a cloud service or a desktop.</p>



<p class="eplus-6m3gGS">Common utilization rates are the following:</p>



<ul class="eplus-sNwMkX"><li>PhD student personal desktop: &lt; 15%</li><li>PhD student slurm GPU cluster: &gt; 35%</li><li>Company-wide slurm research cluster: &gt; 60%</li></ul>



<p class="eplus-deH52E">In general, utilization rates are lower for professions where thinking about cutting edge ideas is more important than developing practical products. Some areas have low utilization rates (interpretability research), while other areas have much higher rates (machine translation, language modeling). In general, the utilization of personal machines is almost always overestimated. Commonly, most personal systems have a utilization rate between 5-10%. This is why I would highly recommend slurm GPU clusters for research groups and companies instead of individual desktop GPU machines.</p>



<h2 class="eplus-bXPSts">Version History</h2>



<ul class="eplus-xnXOsk"><li>2023-01-30: Improved font and recommendation chart. Added 5 years cost of ownership electricity perf/USD chart. Updated Async copy and TMA functionality. Slight update to FP8 training. General improvements.</li><li>2023-01-16: Added Hopper and Ada GPUs. Added GPU recommendation chart. Added information about the TMA unit and L2 cache.</li><li>2020-09-20: Added discussion of using power limiting to run 4x RTX 3090 systems. Added older GPUs to the performance and cost/performance charts. Added figures for sparse matrix multiplication.</li><li>2020-09-07: Added NVIDIA Ampere series GPUs. Included lots of good-to-know GPU details.</li><li>2019-04-03: Added RTX Titan and GTX 1660 Ti. Updated TPU section. Added startup hardware discussion.</li><li>2018-11-26: Added discussion of overheating issues of RTX cards.</li><li>2018-11-05: Added RTX 2070 and updated recommendations. Updated charts with hard performance data. Updated TPU section.</li><li>2018-08-21: Added RTX 2080 and RTX 2080 Ti; reworked performance analysis</li><li>2017-04-09: Added cost-efficiency analysis; updated recommendation with NVIDIA Titan Xp</li><li>2017-03-19: Cleaned up blog post; added GTX 1080 Ti</li><li>2016-07-23: Added Titan X Pascal and GTX 1060; updated recommendations</li><li>2016-06-25: Reworked multi-GPU section; removed simple neural network memory section as no longer relevant; expanded convolutional memory section; truncated AWS section due to not being efficient anymore; added my opinion about the Xeon Phi; added updates for the GTX 1000 series</li><li>2015-08-20: Added section for AWS GPU instances; added GTX 980 Ti to the comparison relation</li><li>2015-04-22: GTX 580 no longer recommended; added performance relationships between cards</li><li>2015-03-16: Updated GPU recommendations: GTX 970 and GTX 580</li><li>2015-02-23: Updated GPU recommendations and memory calculations</li><li>2014-09-28: Added emphasis for memory requirement of CNNs</li></ul>



<h2 class="eplus-qkgeNA">Acknowledgments</h2>



<p>I thank Suhail for making me aware of outdated prices on H100 GPUs, Gjorgji Kjosev for pointing out font issues, Anonymous for pointing out that the TMA unit does not exist on Ada GPUs, Scott Gray for pointing out that FP8 tensor cores have no transposed matrix multiplication, and reddit and HackerNews users for pointing out many other improvements.</p>



<p class="eplus-kKOsc0">For past updates of this blog post, I want to thank Mat Kelcey for helping me to debug and test custom code for the GTX 970; I want to thank Sander Dieleman for making me aware of the shortcomings of my GPU memory advice for convolutional nets; I want to thank Hannes Bretschneider for pointing out software dependency problems for the GTX 580; and I want to thank Oliver Griesel for pointing out notebook solutions for AWS instances. I want to thank Brad Nemire for providing me with an RTX Titan for benchmarking purposes. I want to thank Agrin Hilmkil, Ari Holtzman, Gabriel Ilharco, Nam Pho for their excellent feedback on the previous version of this blog post.</p>
</div></div>
<p>The post <a rel="nofollow" href="https://timdettmers.com/2023/01/30/which-gpu-for-deep-learning/">Which GPU(s) to Get for Deep Learning: My Experience and Advice for Using GPUs in Deep Learning</a> appeared first on <a rel="nofollow" href="https://timdettmers.com">Tim Dettmers</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://timdettmers.com/2023/01/30/which-gpu-for-deep-learning/feed/</wfw:commentRss>
			<slash:comments>1665</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">6</post-id>	</item>
		<item>
		<title>A Full Hardware Guide to Deep Learning</title>
		<link>https://timdettmers.com/2018/12/16/deep-learning-hardware-guide/</link>
					<comments>https://timdettmers.com/2018/12/16/deep-learning-hardware-guide/#comments</comments>
		
		<dc:creator><![CDATA[Tim Dettmers]]></dc:creator>
		<pubDate>Sun, 16 Dec 2018 18:25:41 +0000</pubDate>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[AMD]]></category>
		<category><![CDATA[CPU]]></category>
		<category><![CDATA[GPU]]></category>
		<category><![CDATA[Intel]]></category>
		<category><![CDATA[PCIe Lanes]]></category>
		<guid isPermaLink="false">https://timdettmers.wordpress.com/?p=121</guid>

					<description><![CDATA[<p>Here I will guide you step by step through the hardware you will need for a cheap high performance system for deep learning.</p>
<p>The post <a rel="nofollow" href="https://timdettmers.com/2018/12/16/deep-learning-hardware-guide/">A Full Hardware Guide to Deep Learning</a> appeared first on <a rel="nofollow" href="https://timdettmers.com">Tim Dettmers</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="eplus-Jtk1uQ">Deep Learning is very computationally intensive, so you will need a fast CPU with many cores, right? Or is it maybe wasteful to buy a fast CPU? One of the worst things you can do when building a deep learning system is to waste money on hardware that is unnecessary. Here I will guide you step by step through the hardware you will need for a cheap high-performance system.</p>



<span id="more-121"></span>



<p class="eplus-UTx6Bt">Over the years, I build a total of 7 different deep learning workstations and despite careful research and reasoning, I made my fair share of mistake in selecting hardware parts. In this guide, I want to share my experience that I gained over the years so that you do not make the same mistakes that I did before.</p>



<p class="eplus-LmAMuN">The blog post is ordered by mistake severity. This means the mistakes where people usually waste the most money come first.</p>




<h2><strong>GPU</strong></h2>
<p>This blog post assumes that you will use a GPU for deep learning. If you are building or upgrading your system for deep learning, it is not sensible to leave out the GPU. The GPU is just the heart of deep learning applications – the improvement in processing speed is just too huge to ignore.</p>
<p>I talked at length about GPU choice in <a href="https://timdettmers.com/2020/09/07/which-gpu-for-deep-learning/">my GPU recommendations blog post</a>, and the choice of your GPU is probably the most critical choice for your deep learning system. There are three main mistakes that you can make when choosing a GPU: (1) bad cost/performance, (2) not enough memory, (3) poor cooling.</p>
<p>For good cost/performance, I generally recommend an RTX 2070 or an RTX 2080 Ti. If you use these cards you should use 16-bit models. Otherwise, GTX 1070, GTX 1080, GTX 1070 Ti, and GTX 1080 Ti from eBay are fair choices and you can use these GPUs with 32-bit (but not 16-bit).</p>
<p>Be careful about the memory requirements when you pick your GPU. RTX cards, which can run in 16-bits, can train models which are twice as big with the same memory compared to GTX cards. As such RTX cards have a memory advantage and picking RTX cards and learn how to use 16-bit models effectively will carry you a long way. In general, the requirements for memory are roughly the following:</p>
<ul>
<li>Research that is hunting state-of-the-art scores: &gt;=11 GB</li>
<li>Research that is hunting for interesting architectures: &gt;=8 GB</li>
<li>Any other research: 8 GB</li>
<li>Kaggle: 4 &#8211; 8 GB</li>
<li>Startups: 8 GB (but check the specific application area for model sizes)</li>
<li>Companies: 8 GB for prototyping, &gt;=11 GB for training</li>
</ul>
<p>Another problem to watch out for, especially if you buy multiple RTX cards is cooling. If you want to stick GPUs into PCIe slots which are next to each other you should make sure that you get GPUs with a blower-style fan. Otherwise you might run into temperature issues and your GPUs will be slower (about 30%) and die faster.</p>
<figure id="attachment_124" aria-describedby="caption-attachment-124" style="width: 700px" class="wp-caption aligncenter"><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/suspectlineup.jpg"><img data-attachment-id="124" data-permalink="https://timdettmers.com/2018/12/16/deep-learning-hardware-guide/suspectlineup/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/suspectlineup.jpg?fit=3264%2C1836&amp;ssl=1" data-orig-size="3264,1836" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;2.4&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;U9200&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1403265762&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;4.13&quot;,&quot;iso&quot;:&quot;122&quot;,&quot;shutter_speed&quot;:&quot;0.016666&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}" data-image-title="suspectlineup" data-image-description="" data-image-caption="" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/suspectlineup.jpg?fit=300%2C169&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/suspectlineup.jpg?fit=1024%2C576&amp;ssl=1" class="wp-image-124 size-full" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/suspectlineup.jpg?resize=700%2C394" alt="" width="700" height="394" border="None" data-recalc-dims="1" /></a><figcaption id="caption-attachment-124" class="wp-caption-text"><strong>Suspect line-up</strong><br />Can you identify the hardware part which is at fault for bad performance? One of these GPUs? Or maybe it is the fault of the CPU after all?</figcaption></figure>
<h2>RAM</h2>
<p>The main mistakes with RAM is to buy RAM with a too high clock rate. The second mistake is to buy not enough RAM to have a smooth prototyping experience.</p>
<h3>Needed RAM Clock Rate</h3>
<p>RAM clock rates are marketing stints where RAM companies lure you into buying &#8220;faster&#8221; RAM which actually yields little to no performance gains. This is best explained by &#8220;<a href="https://www.youtube.com/watch?v=D_Yt4vSZKVk">Does RAM speed REALLY matter?</a>&#8221; video on RAM von Linus Tech Tips.</p>
<p>Furthermore, it is important to know that RAM speed is pretty much irrelevant for fast CPU RAM-&gt;GPU RAM transfers. This is so because (1) if you used <a href="https://pytorch.org/docs/stable/notes/cuda.html#use-pinned-memory-buffers">pinned memory</a>, your mini-batches will be transferred to the GPU without involvement from the CPU, and (2) if you do not use pinned memory the performance gains of fast vs slow RAMs is about 0-3% &#8212; spend your money elsewhere!</p>
<h3>RAM Size</h3>
<p>RAM size does not affect deep learning performance. However, it might hinder you from executing your GPU code comfortably (without swapping to disk). You should have enough RAM to comfortable work with your GPU. This means you should have at least the amount of RAM that matches your biggest GPU. For example, if you have a Titan RTX with 24 GB of memory you should have at least 24 GB of RAM. However, if you have more GPUs you do not necessarily need more RAM.</p>
<p>The problem with this &#8220;match largest GPU memory in RAM&#8221; strategy is that you might still fall short of RAM if you are processing large datasets. The best strategy here is to match your GPU and if you feel that you do not have enough RAM just buy some more.</p>
<p>A different strategy is influenced by psychology: Psychology tells us that concentration is a resource that is depleted over time. RAM is one of the few hardware pieces that allows you to conserve your concentration resource for more difficult programming problems. Rather than spending lots of time on circumnavigating RAM bottlenecks, you can invest your concentration on more pressing matters if you have more RAM.  With a lot of RAM you can avoid those bottlenecks, save time and increase productivity on more pressing problems. Especially in Kaggle competitions, I found additional RAM very useful for feature engineering. So if you have the money and do a lot of pre-processing then additional RAM might be a good choice. So with this strategy, you want to have more, cheap RAM now rather than later.</p>
<h2>CPU</h2>
<p>The main mistake that people make is that people pay too much attention to PCIe lanes of a CPU. You should not care much about PCIe lanes. Instead, just look up if your CPU and motherboard combination supports the number of GPUs that you want to run. The second most common mistake is to get a CPU which is too powerful.</p>
<h3>CPU and PCI-Express</h3>
<p>People go crazy about PCIe lanes! However, the thing is that it has almost no effect on deep learning performance. If you have a single GPU, PCIe lanes are only needed to transfer data from your CPU RAM to your GPU RAM quickly. However, an ImageNet batch of 32 images (32x225x225x3) and 32-bit needs 1.1 milliseconds with 16 lanes, 2.3 milliseconds with 8 lanes, and 4.5 milliseconds with 4 lanes. These are theoretic numbers, and in practice you often see PCIe be twice as slow — but this is still lightning fast! PCIe lanes often have a latency in the nanosecond range and thus latency can be ignored.</p>
<p>Putting this together we have for an ImageNet mini-batch of 32 images and a ResNet-152 the following timing:</p>
<ul>
<li>Forward and backward pass: 216 milliseconds (ms)</li>
<li>16 PCIe lanes CPU-&gt;GPU transfer: About 2 ms (1.1 ms theoretical)</li>
<li>8 PCIe lanes CPU-&gt;GPU transfer: About 5 ms (2.3 ms)</li>
<li>4 PCIe lanes CPU-&gt;GPU transfer: About 9 ms (4.5 ms)</li>
</ul>
<p>Thus going from 4 to 16 PCIe lanes will give you a performance increase of roughly 3.2%. However, if you use <a href="https://pytorch.org/docs/stable/data.html#torch.utils.data.DataLoader">PyTorch&#8217;s data loader</a> with pinned memory you gain exactly 0% performance. So do not waste your money on PCIe lanes if you are using a single GPU!</p>
<p>When you select CPU PCIe lanes and motherboard PCIe lanes make sure that you select a combination which supports the desired number of GPUs. If you buy a motherboard that supports 2 GPUs, and you want to have 2 GPUs eventually, make sure that you buy a CPU that supports 2 GPUs, but do not necessarily look at PCIe lanes.</p>
<h3>PCIe Lanes and Multi-GPU Parallelism</h3>
<p>Are PCIe lanes important if you train networks on multiple GPUs with data parallelism? I have <a href="https://arxiv.org/abs/1511.04561">published a paper on this at ICLR2016</a>, and I can tell you if you have 96 GPUs then PCIe lanes are really important. However, if you have 4 or fewer GPUs this does not matter much. If you parallelize across 2-3 GPUs, I would not care at all about PCIe lanes. With 4 GPUs, I would make sure that I can get a support of 8 PCIe lanes per GPU (32 PCIe lanes in total). Since almost nobody runs a system with more than 4 GPUs as a rule of thumb: Do not spend extra money to get more PCIe lanes per GPU — it does not matter!</p>
<h3>Needed CPU Cores</h3>
<p>To be able to make a wise choice for the CPU we first need to understand the CPU and how it relates to deep learning. What does the CPU do for deep learning? The CPU does little computation when you run your deep nets on a GPU. Mostly it (1) initiates GPU function calls, (2) executes CPU functions.</p>
<p>By far the most useful application for your CPU is data preprocessing. There are two different common data processing strategies which have different CPU needs.</p>
<p>The first strategy is preprocessing while you train:</p>
<p>Loop:</p>
<ol>
<li>Load mini-batch</li>
<li>Preprocess mini-batch</li>
<li>Train on mini-batch</li>
</ol>
<p>The second strategy is preprocessing before any training:</p>
<ol>
<li>Preprocess data</li>
<li>Loop:
<ol>
<li>Load preprocessed mini-batch</li>
<li>Train on mini-batch</li>
</ol>
</li>
</ol>
<p>For the first strategy, a good CPU with many cores can boost performance significantly. For the second strategy, you do not need a very good CPU. For the first strategy, I recommend a minimum of 4 threads per GPU &#8212; that is usually two cores per GPU. I have not done hard tests for this, but you should gain about 0-5% additional performance per additional core/GPU.</p>
<p>For the second strategy, I recommend a minimum of 2 threads per GPU &#8212; that is usually one core per GPU. You will not see significant gains in performance when you have more cores if you are using the second strategy.</p>
<h3>Needed CPU Clock Rate (Frequency)</h3>
<p>When people think about fast CPUs they usually first think about the clock rate.  4GHz is better than 3.5GHz, or is it? This is generally true for comparing processors with the same architecture, e.g. “Ivy Bridge”, but it does not compare well between processors. Also, it is not always the best measure of performance.</p>
<p>In the case of deep learning there is very little computation to be done by the CPU: Increase a few variables here, evaluate some Boolean expression there, make some function calls on the GPU or within the program – all these depend on the CPU core clock rate.</p>
<p>While this reasoning seems sensible, there is the fact that the CPU has 100% usage when I run deep learning programs, so what is the issue here? I did some CPU core rate underclocking experiments to find out.</p>
<figure id="attachment_161" aria-describedby="caption-attachment-161" style="width: 804px" class="wp-caption aligncenter"><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/cpu_underclocking2.png"><img data-attachment-id="161" data-permalink="https://timdettmers.com/2018/12/16/deep-learning-hardware-guide/cpu_underclocking/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/cpu_underclocking2.png?fit=603%2C406&amp;ssl=1" data-orig-size="603,406" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="cpu_underclocking" data-image-description="" data-image-caption="&lt;p&gt;CPU underclocking on MNIST and ImageNet: Performance is measured as time taken on 100 epochs MNIST or half an epoch on ImageNet with different CPU core clock rates, where the maximum clock rate is taken as a base line for each CPU. For comparison: Upgrading from a GTX 580 to a GTX Titan is about +20% performance; from GTX Titan to GTX 980 another +30% performance; GPU overclocking yields about +5% performance for any GPU&lt;/p&gt;
" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/cpu_underclocking2.png?fit=300%2C202&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/cpu_underclocking2.png?fit=603%2C406&amp;ssl=1" class="wp-image-161" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/cpu_underclocking2.png?resize=804%2C541" alt="CPU underclocking on MNIST and ImageNet: Performance is measured as time taken on 100 epochs MNIST or half an epoch on ImageNet with different CPU core clock rates, where the maximum clock rate is taken as a base line for each CPU. For comparison: Upgrading from a GTX 580 to a GTX Titan is about +20% performance; from GTX Titan to GTX 980 another +30% performance; GPU overclocking yields about +5% performance for any GPU" width="804" height="541" data-recalc-dims="1" /></a><figcaption id="caption-attachment-161" class="wp-caption-text"><strong>CPU underclocking on MNIST and ImageNet</strong>: Performance is measured as time taken on 200 epochs MNIST or a quarter epoch on ImageNet with different CPU core clock rates, where the maximum clock rate is taken as a baseline for each CPU. For comparison: Upgrading from a GTX 680 to a GTX Titan is about +15% performance; from GTX Titan to GTX 980 another +20% performance; GPU overclocking yields about +5% performance for any GPU</figcaption></figure>
<p style="text-align: justify;">Note that these experiments are on a hardware that is dated, however, these results should still be the same for modern CPUs/GPUs.</p>
<h2 style="text-align: justify;"><strong>Hard drive/SSD</strong></h2>
<p>The hard drive is not usually a bottleneck for deep learning. However, if you do stupid things it will hurt you: If you read your data from disk when they are needed (blocking wait) then a 100 MB/s hard drive will cost you about 185 milliseconds for an ImageNet mini-batch of size 32 — ouch! However, if you asynchronously fetch the data before it is used (for example torch vision loaders), then you will have loaded the mini-batch in 185 milliseconds while the compute time for most deep neural networks on ImageNet is about 200 milliseconds. Thus you will not face any performance penalty since you load the next mini-batch while the current is still computing.</p>
<p>However, I recommend an SSD for comfort and productivity: Programs start and respond more quickly, and pre-processing with large files is quite a bit faster. If you buy an NVMe SSD you will have an even smoother experience when compared to a regular SSD.</p>
<p>Thus the ideal setup is to have a large and slow hard drive for datasets and an SSD for productivity and comfort.</p>
<h2 style="text-align: justify;"><strong>Power supply unit (PSU)</strong></h2>
<p>Generally, you want a PSU that is sufficient to accommodate all your future GPUs. GPUs typically get more energy efficient over time; so while other components will need to be replaced, a PSU should last a long while so a good PSU is a good investment.</p>
<p>You can calculate the required watts by adding up the watt of your CPU and GPUs with an additional 10% of watts for other components and as a buffer for power spikes. For example, if you have 4 GPUs with each 250 watts TDP and a CPU with 150 watts TDP, then you will need a PSU with a minimum of 4&#215;250 + 150 + 100 = 1250 watts. I would usually add another 10% just to be sure everything works out, which in this case would result in a total of 1375 Watts. I would round up in this case an get a 1400 watts PSU.</p>
<p>One important part to be aware of is that even if a PSU has the required wattage, it might not have enough PCIe 8-pin or 6-pin connectors. Make sure you have enough connectors on the PSU to support all your GPUs!</p>
<p>Another important thing is to buy a PSU with high power efficiency rating – especially if you run many GPUs and will run them for a longer time.</p>
<p>Running a 4 GPU system on full power (1000-1500 watts) to train a convolutional net for two weeks will amount to 300-500 kWh, which in Germany – with rather high power costs of 20 cents per kWh – will amount to 60-100€ ($66-111). If this price is for a 100% efficiency, then training such a net with an 80% power supply would increase the costs by an additional 18-26€ – ouch! This is much less for a single GPU, but the point still holds – spending a bit more money on an efficient power supply makes good sense.</p>
<p>Using a couple of GPUs around the clock will significantly increase your carbon footprint and it will overshadow transportation (mainly airplane) and other factors that contribute to your footprint. If you want to be responsible, please consider going <a href="https://wp.nyu.edu/ml2/carbon-neutral-lab/">carbon neutral like the NYU Machine Learning for Language Group (ML2)</a> — it is easy to do, cheap, and should be standard for deep learning researchers.</p>
<h2>CPU and GPU Cooling</h2>
<p>Cooling is important and it can be a significant bottleneck which reduces performance more than poor hardware choices do. You should be fine with a standard heat sink or all-in-one (AIO) water cooling solution for your CPU, but what for your GPU you will need to make special considerations.</p>
<h3>Air Cooling GPUs</h3>
<p>Air cooling is safe and solid for a single GPU or if you have multiple GPUs with space between them (2 GPUs in a 3-4 GPU case). However, one of the biggest mistakes can be made when you try to cool 3-4 GPUs and you need to think carefully about your options in this case.</p>
<p>Modern GPUs will increase their speed – and thus power consumption – up to their maximum when they run an algorithm, but as soon as the GPU hits a temperature barrier – often 80 °C – the GPU will decrease the speed so that the temperature threshold is not breached. This enables the best performance while keeping your GPU safe from overheating.</p>
<p>However, typical pre-programmed schedules for fan speeds are badly designed for deep learning programs, so that this temperature threshold is reached within seconds after starting a deep learning program. The result is a decreased performance (0-10%) which can be significant for multiple GPUs (10-25%) where the GPU heat up each other.</p>
<p>Since NVIDIA GPUs are first and foremost gaming GPUs, they are optimized for Windows. You can change the fan schedule with a few clicks in Windows, but not so in Linux, and as most deep learning libraries are written for Linux this is a problem.</p>
<p>The only option under Linux is to use to set a configuration for your Xorg server (Ubuntu) where you set the option &#8220;coolbits&#8221;. This works very well for a single GPU, but if you have multiple GPUs where some of them are headless, i.e. they have no monitor attached to them, you have to emulate a monitor which is hard and hacky. I tried it for a long time and had frustrating hours with a live boot CD to recover my graphics settings – I could never get it running properly on headless GPUs.</p>
<p>The most important point of consideration if you run 3-4 GPUs on air cooling is to pay attention to the fan design. The &#8220;blower&#8221; fan design pushes the air out to the back of the case so that fresh, cooler air is pushed into the GPU. Non-blower fans suck in air in the vincity of the GPU and cool the GPU. However, if you have multiple GPUs next to each other then there is no cool air around and GPUs with non-blower fans will heat up more and more until they throttle themselves down to reach cooler temperatures. Avoid non-blower fans in 3-4 GPU setups at all costs.</p>
<h3>Water Cooling GPUs For Multiple GPUs</h3>
<p>Another, more costly, and craftier option is to use water cooling. I do not recommend water cooling if you have a single GPU or if you have space between your two GPUs (2 GPUs in 3-4 GPU board). However, water cooling makes sure that even the beefiest GPU stay cool in a 4 GPU setup which is not possible when you cool with air. Another advantage of water cooling is that it operates much more silently, which is a big plus if you run multiple GPUs in an area where other people work. Water cooling will cost you about $100 for each GPU and some additional upfront costs (something like $50). Water cooling will also require some additional effort to assemble your computer, but there are many detailed guides on that and it should only require a few more hours of time in total. Maintenance should not be that complicated or effortful.</p>
<h3>A Big Case for Cooling?</h3>
<p>I bought large towers for my deep learning cluster, because they have additional fans for the GPU area, but I found this to be largely irrelevant: About 2-5 °C decrease, not worth the investment and the bulkiness of the cases. The most important part is really the cooling solution directly on your GPU — do not select an expensive case for its GPU cooling capability. Go cheap here. The case should fit your GPUs but thats it!</p>
<h3>Conclusion Cooling</h3>
<p>So in the end it is simple: For 1 GPU air cooling is best. For multiple GPUs, you should get blower-style air cooling and accept a tiny performance penalty (10-15%), or you pay extra for water cooling which is also more difficult to setup correctly and you have no performance penalty. Air and water cooling are all reasonable choices in certain situations. I would however recommend air cooling for simplicity in general — get a blower-style GPU if you run multiple GPUs. If you want to user water cooling try to find all-in-one (AIO) water cooling solutions for GPUs.</p>
<h2>Motherboard</h2>
<p>Your motherboard should have enough PCIe ports to support the number of GPUs you want to run (usually limited to four GPUs, even if you have more PCIe slots); remember that most GPUs have a width of two PCIe slots, so buy a motherboard that has enough space between PCIe slots if you intend to use multiple GPUs. Make sure your motherboard not only has the PCIe slots, but actually supports the GPU setup that you want to run. You can usually find information in this if you search your motherboard of choice on newegg and look at PCIe section on the specification page.</p>
<h2>Computer Case</h2>
<p>When you select a case, you should make sure that it supports full length GPUs that sit on top of your motherboard. Most cases support full length GPUs, but you should be suspicious if you buy a small case. Check its dimensions and specifications; you can also try a google image search of that model and see if you find pictures with GPUs in them.</p>
<p>If you use custom water cooling, make sure your case has enough space for the radiators. This is especially true if you use water cooling for your GPUs. The radiator of each GPU will need some space — make sure your setup actually fits into the GPU.</p>
<h3 style="text-align: justify;"><strong>Monitors</strong></h3>
<p style="text-align: justify;">I first thought it would be silly to write about monitors also, but they make such a huge difference and are so important that I just have to write about them.</p>
<p style="text-align: justify;">The money I spent on my 3 27 inch monitors is probably the best money I have ever spent. Productivity goes up by a lot when using multiple monitors. I feel desperately crippled if I have to work with a single monitor.  Do not short-change yourself on this matter. What good is a fast deep learning system if you are not able to operate it in an efficient manner?</p>
<figure id="attachment_123" aria-describedby="caption-attachment-123" style="width: 700px" class="wp-caption aligncenter"><a href="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/2015-03-04-13-58-10.jpg"><img data-attachment-id="123" data-permalink="https://timdettmers.com/2018/12/16/deep-learning-hardware-guide/2015-03-04-13-58-10/" data-orig-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/2015-03-04-13-58-10.jpg?fit=3264%2C1836&amp;ssl=1" data-orig-size="3264,1836" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;2.4&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;U9200&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1425477490&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;4.13&quot;,&quot;iso&quot;:&quot;104&quot;,&quot;shutter_speed&quot;:&quot;0.016666&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}" data-image-title="2015-03-04 13.58.10" data-image-description="&lt;p&gt;Typical layout when I do deep learning: Left: Papers, google searcheres, gmail, stackoverflow threads; middle: Code; right: Output windows, R, folders, systems monitors, GPU monitors, to-do list, and other small applications.&lt;/p&gt;
" data-image-caption="" data-medium-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/2015-03-04-13-58-10.jpg?fit=300%2C169&amp;ssl=1" data-large-file="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/2015-03-04-13-58-10.jpg?fit=1024%2C576&amp;ssl=1" class="wp-image-123 size-full" src="https://i0.wp.com/timdettmers.com/wp-content/uploads/2015/03/2015-03-04-13-58-10.jpg?resize=700%2C394" alt="2015-03-04 13.58.10" width="700" height="394" data-recalc-dims="1" /></a><figcaption id="caption-attachment-123" class="wp-caption-text"><strong>Typical monitor layout when I do deep learning:</strong> Left: Papers, Google searches, gmail, stackoverflow; middle: Code; right: Output windows, R, folders, systems monitors, GPU monitors, to-do list, and other small applications.</figcaption></figure>
<h4 style="text-align: justify;"><strong>Some words on building a PC</strong></h4>
<p style="text-align: justify;">Many people are scared to build computers. The hardware components are expensive and you do not want to do something wrong. But it is really simple as components that do not belong together do not fit together. The motherboard manual is often very specific how to assemble everything and there are tons of guides and step by step videos which guide you through the process if you have no experience.</p>
<p style="text-align: justify;">The great thing about building a computer is, that you know everything that there is to know about building a computer when you did it once, because all computer are built in the very same way – so building a computer will become a life skill that you will be able to apply again and again. So no reason to hold back!</p>
<h2><strong>Conclusion / TL;DR</strong></h2>
<p><strong>GPU</strong>: RTX 2070 or RTX 2080 Ti. GTX 1070, GTX 1080, GTX 1070 Ti, and GTX 1080 Ti from eBay are good too!<br /><strong>CPU</strong>: 1-2 cores per GPU depending how you preprocess data. &gt; 2GHz; CPU should support the number of GPUs that you want to run. PCIe lanes do not matter.</p>
<p><strong>RAM</strong>:<br />&#8211; Clock rates do not matter — buy the cheapest RAM.<br />&#8211; Buy at least as much CPU RAM to match the RAM of your largest GPU.<br />&#8211; Buy more RAM only when needed.<br />&#8211; More RAM can be useful if you frequently work with large datasets.</p>
<p><strong>Hard drive/SSD</strong>:<br />&#8211; Hard drive for data (&gt;= 3TB)<br />&#8211; Use SSD for comfort and preprocessing small datasets.</p>
<p><strong>PSU</strong>:<br />&#8211; Add up watts of GPUs + CPU. Then multiply the total by 110% for required Wattage.<br />&#8211; Get a high efficiency rating if you use a multiple GPUs.<br />&#8211; Make sure the PSU has enough PCIe connectors (6+8pins)</p>
<p><strong>Cooling</strong>:<br />&#8211; CPU: get standard CPU cooler or all-in-one (AIO) water cooling solution<br />&#8211; GPU:<br />&#8211; Use air cooling<br />&#8211; Get GPUs with &#8220;blower-style&#8221; fans if you buy multiple GPUs<br />&#8211; Set coolbits flag in your Xorg config to control fan speeds</p>
<p><strong>Motherboard</strong>:<br />&#8211; Get as many PCIe slots as you need for your (future) GPUs (one GPU takes two slots; max 4 GPUs per system)</p>
<p><strong>Monitors</strong>:<br />&#8211; An additional monitor might make you more productive than an additional GPU.</p>
<p>Update 2018-12-14: Reworked entire blog post with up-to-date recommendations.<br />Update 2015-04-22: Removed recommendation for GTX 580</p><p>The post <a rel="nofollow" href="https://timdettmers.com/2018/12/16/deep-learning-hardware-guide/">A Full Hardware Guide to Deep Learning</a> appeared first on <a rel="nofollow" href="https://timdettmers.com">Tim Dettmers</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://timdettmers.com/2018/12/16/deep-learning-hardware-guide/feed/</wfw:commentRss>
			<slash:comments>945</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">121</post-id>	</item>
	</channel>
</rss>
