掩碼 (Mask) 是一種位運算技巧,它使用一個特定的值(掩碼)與目標值進行 $\mathtt{\&}$ (與)、$\mathtt{|}$ (或)、$\mathtt{\wedge}$ (異或) 運算,以精確地、批次地操作、提取或檢查目標值中的一個或多個位。 基本概念 掩碼利用位運算的特性,透過設定掩碼中的特定位為 1 或 0 ,來控制目標值中對應位的行為。 具體來說,掩碼可以用來提取某些位的值,清…
Louis Aeilot's Blog 的其他文章
- How Close Is FlashAttention to the Limit? Understanding Attention Through Data Movement
- Beyond FLOPs: How COSMA Builds Parallel Matrix Multiplication from Communication Bounds
- The Red-Blue Pebble Game: Why Faster Processors Still Have to Move Data
- Git Needs a Trash Can
- RoPE: Properties, Patterns, and Long-Context Behavior
讨论
登录后参与讨论
还没有评论,来说第一句吧。