<?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>GQA on Echo的技术博客</title><link>https://cybersecurityerial.github.io/echo_blog/tags/gqa/</link><description>Recent content in GQA on Echo的技术博客</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Mon, 17 Aug 2026 00:00:00 +0800</lastBuildDate><atom:link href="https://cybersecurityerial.github.io/echo_blog/tags/gqa/index.xml" rel="self" type="application/rss+xml"/><item><title>gemm和alltoall通算融合</title><link>https://cybersecurityerial.github.io/echo_blog/posts/llm-system-comm-comp-fusion-operators-03-gemm-alltoall-fusion/</link><pubDate>Mon, 17 Aug 2026 00:00:00 +0800</pubDate><guid>https://cybersecurityerial.github.io/echo_blog/posts/llm-system-comm-comp-fusion-operators-03-gemm-alltoall-fusion/</guid><description>&lt;h2 id="1-总体思想"&gt;1. 总体思想&lt;/h2&gt;
&lt;p&gt;这次做的是单机八卡 H200、NVLink、Ulysses CP 下的 GEMM 和 AllToAll 融合。先把 forward 写清楚：&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;A2A → QKV projection → QK → PV → A2A
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;需要接起来的主边界有两个。输入侧是 &lt;code&gt;A2A→QKV projection&lt;/code&gt;，通信先把各个 peer 的输入 tile 搬到本地最终布局，GEMM 拿到一块就算一块。输出侧是 &lt;code&gt;batched PV→A2A&lt;/code&gt;，每个本地 head 都有一组独立的 &lt;code&gt;P×V&lt;/code&gt;，GEMM 算完一个 tile，通信 CTA 立刻把它送到目标 rank 的最终 Ulysses 布局。&lt;/p&gt;
&lt;p&gt;如果 GEMM 和 NCCL 顺序执行，端到端时间接近两段时间相加。这里把通信 CTA 和 GEMM CTA 放进同一个 cooperative persistent grid，两种 CTA 常驻在不同的 SM 上，用 tile 级 ready epoch 接力。&lt;code&gt;A2A→GEMM&lt;/code&gt; 由通信生产、GEMM 消费；&lt;code&gt;GEMM→A2A&lt;/code&gt; 交换生产消费关系。这样首批 tile 到达后就能启动计算，前面的 tile 也可以在后续 GEMM 还在跑时发出去。&lt;/p&gt;</description></item></channel></rss>