<?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 mayulu的AI笔记</title><link>https://mayulu.co/tags/cuda/</link><description>Recent content in CUDA on mayulu的AI笔记</description><generator>Hugo</generator><language>zhcn</language><copyright>Copyright © 2025–2026 mayulu All Rights Reserved</copyright><lastBuildDate>Sat, 03 Oct 2026 10:00:00 +0800</lastBuildDate><atom:link href="https://mayulu.co/tags/cuda/index.xml" rel="self" type="application/rss+xml"/><item><title>CUDA 编程系列之三：内存墙与分块（tiling）的诞生</title><link>https://mayulu.co/posts/cuda-series-03-memory-and-tiling/</link><pubDate>Sat, 03 Oct 2026 10:00:00 +0800</pubDate><guid>https://mayulu.co/posts/cuda-series-03-memory-and-tiling/</guid><description>本文是 CUDA 编程读书笔记系列第三篇，解释为什么算力强悍的 GPU 依然会被内存带宽卡住。文章从 H100 的 66.9 TFLOPS 与 3.35 TB/s 出发，引出算术强度（FLOP/Byte）与 Roofline 模型这套判断框架，并用向量加法 1 FLOP 对 12 字节、比值仅 0.083 FLOP/B 的算例说明什么是深陷带宽受限。随后梳理寄存器、共享内存、常量内存、全局内存的层级，完整还原分块（tiling）技术的推导过程：矩阵乘法如何把 2N³ 次全局读取降到约 2N³/TILE，以及 __syncthreads 屏障、halo、占用率这三项代价。适合想建立 GPU 性能分析直觉的读者。</description></item><item><title>CUDA 编程系列之二：SM、warp 与那个反直觉的占用率</title><link>https://mayulu.co/posts/cuda-series-02-compute-architecture/</link><pubDate>Fri, 02 Oct 2026 09:30:00 +0800</pubDate><guid>https://mayulu.co/posts/cuda-series-02-compute-architecture/</guid><description>本文是 CUDA 编程读书笔记系列第二篇，向下钻一层看 GPU 的硬件组织与调度机制。文章以 H100 的 132 个 SM、16896 个流处理器为例，讲清 SM 与 GPC 的层级关系，解释线程块被任意分派所带来的透明可伸缩性，以及为什么跨块同步是执行模型里的禁忌。文章详细拆解 warp 的 SIMD 执行与控制发散代价、零开销线程切换如何隐藏延迟，并用一个 2048 线程/SM、32 块/SM、64K 寄存器、96KB 共享内存的算例演示占用率四个上限如何取最小。最后指出占用率是延迟隐藏预算而非分数，为后续低占用率高性能 kernel 埋下伏笔。</description></item><item><title>CUDA 编程系列之一：网格、线程与数据的对位</title><link>https://mayulu.co/posts/cuda-series-01-grid-and-data/</link><pubDate>Thu, 01 Oct 2026 09:00:00 +0800</pubDate><guid>https://mayulu.co/posts/cuda-series-01-grid-and-data/</guid><description>本文是 CUDA 编程读书笔记系列第一篇，围绕线程的两级组织（网格与线程块）、dim3 执行配置、线程到数据的坐标映射展开。文章用两行索引代码讲清 blockIdx/threadIdx/blockDim 的配合关系，用 62×76 图像的具体算例推导行主序线性化 row*Width+col，并以彩色转灰度、图像模糊、矩阵乘法三个由浅入深的例子说明网格形状的选法。文章还解释了为什么边界检查 if (row &amp;lt; Width) 不是可选项，并预告朴素矩阵乘法 2N³ 次全局读取的性能病灶，适合刚接触 CUDA、想建立线程与数据对应直觉的读者。</description></item></channel></rss>