本文从标准自注意力出发,依次说明核化线性注意力、循环状态、门控与 Delta 规则,并最终落到 Kimi Linear 的核心组件 Kimi Delta Attention(KDA)。重点 …
GLM-5: From Vibe Coding to Agentic Engineering
背景
在之前的文章 DeepSeek-V3.2 Lightning Indexer 中,我们详细介绍了 DeepSeek Sparse Attention (DSA) 的 Lightning Indexer 如何通过 top-k 选择实现 token 级别的稀疏注意力。GLM-5 作为智谱 …
DeepSeek-V4: 1MM Token Context
背景
在之前的文章中,我们详细介绍了 DeepSeek-V3 的 MLA 机制 和 DeepSeek-V3.2 的 Lightning Indexer。MLA 解决了推理时的内存带宽问题,DSA 通过 sparse attention 将计算复 …
DeepSeek-V3.2 Lightning Indexer
背景
在之前的文章 DeepSeek V3 Multi-head Latent Attention (MLA) 中,我们详细介绍了 DeepSeek-V3 的 MLA 机制如何通过低秩压缩减少 KV Cache 的内存占用。MLA 解决了推理 …
MHA和MLA的KV cache比较
Setup
- Model: L layers, hidden dimension \(d\) = 7168, num_heads \(h\) = 128, head_dim \(d_h\) = 128 (so \(d = h × d_h\), for deepseek V3 like setting)
- MLA latent dimension: \(d_c\) = 512 (compressed KV latent)
- Sequence: tokens t₁, t₂, ..., t₁₀₀
- Assume t₁ to t₉₉ are already cached (prefill done). Now we process t₁₀₀ (decode …
DeepSeek Expert Parallelism Load Balancer (EPLB) Code Reading
Introduction
In the previous Introduction to DeepSeek-V3, a crucial component highlighted was the use of DeepSeekMoE. When employing Expert Parallelism, different Experts are assigned to different GPUs. Since the load on different Experts may vary depending on the current workload, maintaining load balance across GPUs is critical. DeepSeek-MoE addresses this …
DeepSeek V3 MoE
1. Deepseek MoE 的结构
DeepSeek-V3 的 MoE 架构延续并优化了其特有的 DeepSeekMoE 设计,并引入了 无辅助损失的负载均衡(Auxiliary-loss-free Load Balancing 策略。
1. 整体结构公式 …
DeepSeek V3 Multi-head Latent Attention (MLA)
在上一篇blog中,我们讨论了DeepSeek-V3 采用了 MLA (Multi-Head Latent Attention) 架构,其核心目的是通过低秩联合压缩 Key 和 Value 来减少 KV 缓存。特别是在推理 …
DeepSeek V3 learning notes
1. What the problem to solve?
When I went back for the Spring Festival, DeepSeek released a new model. For a while, all kinds of media discussed it a lot, almost rising to the height of national destiny. The most important points discussed should be two: the first is the …
DeepSeek V3
1. What the problem to solve?
春节回去的时候正好碰上DeepSeek发布新的模型,一时间各路媒体讨论的沸沸扬扬,几乎上升到国运的高度。讨论的最重要的应 …