<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>CUDA on Ganko Space</title><link>https://ganko.asia/tags/cuda/</link><description>Recent content in CUDA on Ganko Space</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Mon, 08 Jun 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://ganko.asia/tags/cuda/index.xml" rel="self" type="application/rss+xml"/><item><title>CS336 Lecture 5-6: GPUs &amp; Kernels, Triton</title><link>https://ganko.asia/posts/cs336-lecture5-6-gpus-kernels-triton/</link><pubDate>Mon, 08 Jun 2026 00:00:00 +0000</pubDate><guid>https://ganko.asia/posts/cs336-lecture5-6-gpus-kernels-triton/</guid><description>&lt;h2 id="为什么这两讲至关重要">为什么这两讲至关重要&lt;/h2>
&lt;p>在已经学过的课程中，L1-L4 讲的是&amp;quot;模型长什么样&amp;quot;，L7-L8 讲的是&amp;quot;多卡怎么协作&amp;quot;。&lt;strong>L5-L6 卡在两者之间——单卡内部到底在发生什么。&lt;/strong>&lt;/p>
&lt;p>如果你不理解 GPU 的硬件结构，你就无法理解：&lt;/p>
&lt;ul>
&lt;li>为什么 Flash Attention 是过去五年 LLM 领域最重要的系统优化&lt;/li>
&lt;li>为什么大矩阵乘法是&amp;quot;compute-bound&amp;quot;而 Attention 是&amp;quot;memory-bound&amp;quot;&lt;/li>
&lt;li>为什么你写的 PyTorch 代码有时 GPU 利用率只有 30%&lt;/li>
&lt;li>ZeRO-3 的通信开销到底卡在哪里（看懂 L7-8 那块没懂的）&lt;/li>
&lt;/ul>
&lt;p>Percy 在 L6 的原话很直白：&lt;strong>&amp;ldquo;You cannot optimize what you don&amp;rsquo;t measure, and you cannot measure what you don&amp;rsquo;t understand.&amp;rdquo;&lt;/strong>&lt;/p>
&lt;hr>
&lt;h2 id="lecture-5gpu-架构解剖tatsu">Lecture 5：GPU 架构解剖（Tatsu）&lt;/h2>
&lt;h3 id="51-从一张-h100-说起">5.1 从一张 H100 说起&lt;/h3>
&lt;p>H100 的基本参数：&lt;/p>
&lt;ul>
&lt;li>&lt;strong>HBM（显存）&lt;/strong>：80GB，带宽 ~3.35 TB/s&lt;/li>
&lt;li>&lt;strong>SRAM（片上共享内存）&lt;/strong>：每 SM 约 256KB，总带宽 ~几十 TB/s（比 HBM 快一个数量级）&lt;/li>
&lt;li>&lt;strong>计算能力&lt;/strong>：BF16 下 ~990 TFLOPS&lt;/li>
&lt;/ul>
&lt;p>关键不在于这些数字有多大，而在于&lt;strong>数字之间的比例&lt;/strong>。&lt;/p></description></item></channel></rss>