{"id":81512,"date":"2026-07-25T02:36:51","date_gmt":"2026-07-24T18:36:51","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/81512.html"},"modified":"2026-07-25T02:36:51","modified_gmt":"2026-07-24T18:36:51","slug":"gfx936-dcu%e4%b8%8a%e5%ae%9e%e7%8e%b0int8-qk-mmac%ef%bc%9a%e5%88%86%e9%a1%b5%e8%ae%bf%e5%ad%98%e3%80%81fragment%e6%98%a0%e5%b0%84%e4%b8%8egqa%e9%80%82%e9%85%8d","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/81512.html","title":{"rendered":"gfx936 DCU\u4e0a\u5b9e\u73b0INT8 QK MMAC\uff1a\u5206\u9875\u8bbf\u5b58\u3001Fragment\u6620\u5c04\u4e0eGQA\u9002\u914d"},"content":{"rendered":"<h2>gfx936 DCU\u4e0a\u5b9e\u73b0INT8 QK MMAC&#xff1a;\u5206\u9875\u8bbf\u5b58\u3001Fragment\u6620\u5c04\u4e0eGQA\u9002\u914d<\/h2>\n<h3>\u524d\u8a00<\/h3>\n<p>\u672c\u6587\u662f\u7cfb\u5217\u7b2c\u4e8c\u7bc7\u3002\u7b2c\u4e00\u7bc7\u300agfx936 DCU\u4e0a\u5b9e\u73b0INT8 KV\u4e0eINT8 MMAC Attention\u63a8\u7406\u4f18\u5316\u300b\u4ecb\u7ecd\u4e86\u5b8c\u6574\u6570\u636e\u6d41&#xff0c;\u672c\u6587\u805a\u7126 Attention \u7684\u7b2c\u4e00\u6b21\u77e9\u9635\u4e58\u6cd5 QK^T\u3002<\/p>\n<p>\u628a K Cache \u5b58\u6210 INT8 \u5e76\u4e0d\u4ee3\u8868 QK \u5df2\u7ecf\u4f7f\u7528\u4f4e\u7cbe\u5ea6\u8ba1\u7b97\u3002\u6700\u5bb9\u6613\u5b9e\u73b0\u7684\u4e00\u79cd\u8def\u5f84\u662f\u4ece Cache \u8bfb\u53d6 INT8 K&#xff0c;\u5728\u5bc4\u5b58\u5668\u4e2d\u8f6c\u6210 BF16&#xff0c;\u518d\u8c03\u7528\u539f\u6765\u7684 BF16 MMAC\u3002\u6211\u4eec\u5728\u771f\u5b9e Qwen tile \u4e0a\u6d4b\u8fc7&#xff0c;\u8fd9\u6761\u8def\u7ebf\u53ea\u6709 BF16 QK \u7684 0.71x-1.00x&#xff0c;\u8bfb\u53d6\u91cf\u867d\u7136\u4e0b\u964d&#xff0c;\u8f6c\u6362\u548c Scale \u5f00\u9500\u5374\u628a\u6536\u76ca\u5403\u6389\u4e86\u3002<\/p>\n<p>\u6700\u7ec8\u91c7\u7528\u7684\u8def\u7ebf\u662f&#xff1a;Query \u4e5f\u505a\u52a8\u6001 INT8 \u91cf\u5316&#xff0c;\u8ba9 Q_int8\u00d7K_int8^T \u76f4\u63a5\u8fdb\u5165 gfx936 \u7684 v_mmac_i32_16x16x32_i8&#xff0c;\u5728 INT32 \u4e2d\u7d2f\u52a0&#xff0c;\u518d\u6062\u590d Query Scale\u3001Key Scale \u548c softmax Scale\u3002\u5b9e\u73b0\u8fc7\u7a0b\u4e2d\u771f\u6b63\u56f0\u96be\u7684\u4e0d\u662f\u8c03\u7528\u4e00\u6761 MMAC \u6307\u4ee4&#xff0c;\u800c\u662f\u8ba9\u5206\u9875 K Cache\u3001Query fragment\u3001Scale \u4e0b\u6807\u548c softmax token \u4f7f\u7528\u540c\u4e00\u5957 lane \u6620\u5c04\u3002<\/p>\n<p>\u672c\u6587\u5b9e\u9a8c\u73af\u5883&#xff1a;\u5355\u5f20 gfx936 DCU\u3001DTK 26.04\u3001Qwen3.5-27B\u3002\u5bf9\u5e94\u4ee3\u7801\u4e3b\u8981\u4f4d\u4e8e csrc\/rocm\/attention.cu&#xff1a;Decode \u4f7f\u7528 paged_attention_int8_kv&#xff0c;\u5e26\u5386\u53f2\u7684\u5206\u5757 Prefill \u4f7f\u7528 gfx936_int8_prefix_attention_kernel&#xff0c;Python \u5165\u53e3\u4f4d\u4e8e vllm\/v1\/attention\/backends\/rocm_aiter_fa.py\u3002<\/p>\n<h3>1. INT8 QK\u7684\u91cf\u5316\u548cScale\u6062\u590d<\/h3>\n<p>Attention Score \u4e3a&#xff1a;<\/p>\n<p>S &#061; Q \u00d7 K^T \/ sqrt(d)<\/p>\n<p>\u5bf9 Query \u548c Key \u5206\u522b\u505a\u5bf9\u79f0\u52a8\u6001\u91cf\u5316&#xff1a;<\/p>\n<p>Q \u2248 Qq \u00d7 sQ<br \/>\nK \u2248 Kq \u00d7 sK<\/p>\n<p>\u4ee3\u56de\u539f\u5f0f\u53ef\u5f97&#xff1a;<\/p>\n<p>S \u2248 MMAC_INT8(Qq, Kq^T) \u00d7 sQ \u00d7 sK \/ sqrt(d)<\/p>\n<p>Qq\u3001Kq \u662f INT8&#xff0c;MMAC \u8f93\u51fa\u662f INT32 accumulator\u3002\u8f6c\u6210 FP32 \u540e&#xff0c;\u6bcf\u4e2a score \u9700\u8981\u4e58&#xff1a;<\/p>\n<p>post_scale &#061; sQ(query_token, query_head)<br \/>\n           \u00d7 sK(key_token, kv_head)<br \/>\n           \u00d7 softmax_scale<\/p>\n<p>\u8fd9\u91cc\u6709\u4e00\u4e2a\u5bb9\u6613\u5ffd\u89c6\u7684\u533a\u522b&#xff1a;Query Scale \u968f\u5f53\u524d Query token \u548c Query head \u53d8\u5316&#xff0c;Key Scale \u5219\u968f\u5386\u53f2 key token \u548c KV head \u53d8\u5316\u3002\u6700\u7ec8 K Scale \u91c7\u7528 per-token\u3001per-KV-head \u7c92\u5ea6&#xff0c;\u56e0\u6b64\u4e00\u4e2a QK tile \u4e2d\u4e0d\u540c\u5217\u5bf9\u5e94\u7684 Scale \u4e5f\u4e0d\u540c&#xff0c;\u4e0d\u80fd\u5728\u6574\u5757\u77e9\u9635\u4e58\u6cd5\u7ed3\u675f\u540e\u53ea\u4e58\u4e00\u4e2a\u7edf\u4e00\u7cfb\u6570\u3002<\/p>\n<p>Scale \u8fd8\u5fc5\u987b\u5728 score \u8fdb\u5165 softmax \u4e4b\u524d\u6062\u590d\u3002\u82e5\u5148\u5bf9 INT32 accumulator \u505a softmax&#xff0c;\u518d\u8865\u4e58 Key Scale&#xff0c;\u6539\u53d8\u7684\u5c31\u4e0d\u53ea\u662f\u8fd1\u4f3c\u7cbe\u5ea6&#xff0c;\u800c\u662f\u4e0d\u540c key token \u4e4b\u95f4\u7684\u76f8\u5bf9\u6982\u7387\u3002\u6700\u7ec8\u5b9e\u73b0\u4e0d\u751f\u6210\u5168\u5c40 Score tensor&#xff0c;\u800c\u662f\u5728\u5bc4\u5b58\u5668\u4e2d\u6062\u590d\u6bcf\u4e2a score&#xff0c;\u968f\u540e\u76f4\u63a5\u8fdb\u5165 online softmax\u3002<\/p>\n<h3>2. Q\u548cK\u5982\u4f55\u6620\u5c04\u5230gfx936 MMAC<\/h3>\n<h4>2.1 Q\u653e\u5728operand A&#xff0c;K\u653e\u5728operand B<\/h4>\n<p>\u672c\u6587\u4f7f\u7528\u7684\u6574\u6570\u77e9\u9635\u6307\u4ee4\u4e3a&#xff1a;<\/p>\n<p>v_mmac_i32_16x16x32_i8<\/p>\n<p>\u4e00\u4e2a wave64 \u534f\u540c\u5b8c\u6210&#xff1a;<\/p>\n<p>A: 16 \u00d7 32, INT8<br \/>\nB: 32 \u00d7 16, INT8<br \/>\nC: 16 \u00d7 16, INT32<\/p>\n<p>\u5728\u8fd9\u4e2a\u5e03\u5c40\u4e2d&#xff0c;operand A \u5bf9\u5e94\u8f93\u51fa\u77e9\u9635\u7684\u884c&#xff0c;operand B \u5bf9\u5e94\u8f93\u51fa\u77e9\u9635\u7684\u5217\u3002QK \u7684\u81ea\u7136\u6620\u5c04\u662f&#xff1a;<\/p>\n<p>A &#061; Q&#xff0c;\u8f93\u51fa\u884c\u5bf9\u5e94 Query row<br \/>\nB &#061; K&#xff0c;\u8f93\u51fa\u5217\u5bf9\u5e94\u5386\u53f2 token<\/p>\n<p>\u6211\u4eec\u65e9\u671f\u4e5f\u8003\u8651\u8fc7\u6267\u884c MMAC(K,Q) \u518d\u8f6c\u7f6e\u3002\u6570\u5b66\u4e0a\u4e24\u8005\u7b49\u4ef7&#xff0c;\u4f46\u8fd9\u79cd\u987a\u5e8f\u4f1a\u8ba9\u8f93\u51fa\u5f52\u5c5e\u3001Key Scale \u8bfb\u53d6\u548c softmax \u5199\u5165\u90fd\u53d8\u590d\u6742\u3002\u6700\u7ec8 CPU fragment \u6a21\u578b\u548c GPU \u5185\u6838\u90fd\u56fa\u5b9a\u4e3a Q \u5728 A\u3001K \u5728 B\u3002<\/p>\n<p>\u5bf9\u4e8e Qwen3.5 \u7684 head_dim&#061;256&#xff0c;INT8 \u6307\u4ee4\u6bcf\u6b21\u63a8\u8fdb K \u7ef4 32&#xff0c;\u56e0\u6b64\u53ea\u9700&#xff1a;<\/p>\n<p>256 \/ 32 &#061; 8 \u4e2a K-step<\/p>\n<p>\u76f8\u540c\u8f93\u51fa\u5757\u7684 BF16 \u6307\u4ee4\u6bcf\u6b21\u63a8\u8fdb K \u7ef4 16&#xff0c;\u9700\u8981 16 \u4e2a K-step\u3002\u8fd9\u4e2a\u5dee\u5f02\u53ea\u5c5e\u4e8e\u77e9\u9635\u4e58\u52a0\u90e8\u5206&#xff0c;\u5206\u9875\u5bfb\u5740\u3001Scale \u6062\u590d\u548c softmax \u4e0d\u4f1a\u540c\u65f6\u51cf\u534a\u3002<\/p>\n<p>INT32 \u7d2f\u52a0\u4e5f\u4e0d\u5b58\u5728\u6ea2\u51fa\u538b\u529b\u3002\u91cf\u5316\u8303\u56f4\u4e3a [-127,127] \u65f6&#xff0c;\u5b8c\u6574 256 \u7ef4\u70b9\u79ef\u7684\u7edd\u5bf9\u4e0a\u754c\u4e3a&#xff1a;<\/p>\n<p>256 \u00d7 127 \u00d7 127 &#061; 4,129,024<\/p>\n<p>\u5b83\u8ddd\u79bb 2^31-1 \u4ecd\u6709\u7ea6 500 \u500d\u4f59\u91cf\u3002\u5b9e\u9645\u7cbe\u5ea6\u98ce\u9669\u4e3b\u8981\u6765\u81ea\u91cf\u5316\u540e score \u7684\u76f8\u5bf9\u6270\u52a8&#xff0c;\u800c\u4e0d\u662f INT32 \u9971\u548c\u3002<\/p>\n<h4>2.2 MMAC\u8f93\u51fa\u4e0d\u662f\u56db\u4e2a\u8fde\u7eedtoken<\/h4>\n<p>\u4e00\u4e2a wave \u6709 64 \u4e2a lane&#xff0c;\u6bcf\u4e2a lane \u4e3a A\u3001B \u5206\u522b\u63d0\u4f9b 8 \u4e2a INT8 \u5143\u7d20&#xff0c;\u5e76\u6301\u6709 4 \u4e2a INT32 \u8f93\u51fa\u3002\u4e0b\u6587\u628a\u6bcf\u4e2a lane \u6301\u6709\u7684\u8f93\u5165\u6216\u8f93\u51fa\u7247\u6bb5\u79f0\u4e3a fragment\u3002<\/p>\n<p>MMAC \u7684\u56db\u4e2a\u8f93\u51fa\u5e76\u4e0d\u662f\u56db\u4e2a\u8fde\u7eed\u5217\u3002\u4ee4&#xff1a;<\/p>\n<p>lane_col &#061; lane_id % 16<\/p>\n<p>\u4e00\u4e2a lane \u5b9e\u9645\u6301\u6709\u7684\u8f93\u51fa\u5217\u4e3a&#xff1a;<\/p>\n<p>lane_col &#043; {0, 4, 8, 12}<\/p>\n<p>\u4f8b\u5982 lane_col&#061;2 \u65f6&#xff0c;\u5bf9\u5e94\u7684\u662f\u7b2c 2\u30016\u300110\u300114 \u5217&#xff0c;\u800c\u4e0d\u662f\u7b2c 2\u30013\u30014\u30015 \u5217\u3002\u82e5\u5171\u4eab\u5185\u5b58\u5199\u5165\u3001Key Scale \u8bfb\u53d6\u6216\u5c3e\u90e8 mask \u4ecd\u6309\u8fde\u7eed\u56db\u4e2a token \u5904\u7406&#xff0c;\u5185\u6838\u53ef\u4ee5\u6b63\u5e38\u7ed3\u675f&#xff0c;\u7ed3\u679c\u5374\u4f1a\u6084\u6084\u9519\u4f4d\u3002<\/p>\n<p>QK \u4e3b\u5faa\u73af\u53ef\u4ee5\u7b80\u5316\u4e3a&#xff1a;<\/p>\n<p>int32x4 acc <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">{<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">pragma<\/span> <span class=\"token expression\">unroll<\/span><\/span><br \/>\n<span class=\"token keyword\">for<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token keyword\">int<\/span> k_base <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span> k_base <span class=\"token operator\">&lt;<\/span> <span class=\"token number\">256<\/span><span class=\"token punctuation\">;<\/span> k_base <span class=\"token operator\">&#043;&#061;<\/span> <span class=\"token number\">32<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    int8x8 q_frag <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">load_q_fragment<\/span><span class=\"token punctuation\">(<\/span>q_int8<span class=\"token punctuation\">,<\/span> k_base<span class=\"token punctuation\">,<\/span> lane<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    int8x8 k_frag <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">load_k_fragment<\/span><span class=\"token punctuation\">(<\/span>k_cache<span class=\"token punctuation\">,<\/span> page<span class=\"token punctuation\">,<\/span> slot<span class=\"token punctuation\">,<\/span><br \/>\n                                    k_base<span class=\"token punctuation\">,<\/span> lane<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    acc <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">mmac_i32_16x16x32_i8<\/span><span class=\"token punctuation\">(<\/span>q_frag<span class=\"token punctuation\">,<\/span> k_frag<span class=\"token punctuation\">,<\/span> acc<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token keyword\">int<\/span> lane_col <span class=\"token operator\">&#061;<\/span> lane_id <span class=\"token operator\">%<\/span> <span class=\"token number\">16<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">for<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token keyword\">int<\/span> i <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span> i <span class=\"token operator\">&lt;<\/span> <span class=\"token number\">4<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token operator\">&#043;&#043;<\/span>i<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">int<\/span> col <span class=\"token operator\">&#061;<\/span> lane_col <span class=\"token operator\">&#043;<\/span> <span class=\"token number\">4<\/span> <span class=\"token operator\">*<\/span> i<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">int<\/span> key_token <span class=\"token operator\">&#061;<\/span> token_base <span class=\"token operator\">&#043;<\/span> col<span class=\"token punctuation\">;<\/span><br \/>\n    score<span class=\"token punctuation\">[<\/span>i<span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">float<\/span><span class=\"token punctuation\">(<\/span>acc<span class=\"token punctuation\">[<\/span>i<span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">*<\/span> q_scale<br \/>\n               <span class=\"token operator\">*<\/span> k_scale<span class=\"token punctuation\">[<\/span>key_token<span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">[<\/span>kv_head<span class=\"token punctuation\">]<\/span><br \/>\n               <span class=\"token operator\">*<\/span> softmax_scale<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u771f\u6b63\u7684\u96be\u70b9\u96c6\u4e2d\u5728 load_q_fragment\u3001load_k_fragment \u548c key_token \u4e09\u8005\u662f\u5426\u5bf9\u5e94\u540c\u4e00\u4e2a\u77e9\u9635\u4f4d\u7f6e\u3002\u6700\u7ec8\u4ee3\u7801\u4fdd\u7559 MMAC \u7684\u5bc4\u5b58\u5668\u987a\u5e8f&#xff0c;\u5230\u5199\u5165 softmax \u5de5\u4f5c\u533a\u65f6\u518d\u5b8c\u6210 4\u00d74 \u8f6c\u7f6e\u3002<\/p>\n<h4>2.3 \u4fdd\u5b88\u6307\u4ee4\u5c01\u88c5\u548c\u6d41\u6c34\u6307\u4ee4\u5c01\u88c5<\/h4>\n<p>\u6700\u7ec8\u4ee3\u7801\u4fdd\u7559\u4e86\u4e24\u79cd wrapper\u3002\u7528\u4e8e\u72ec\u7acb\u9a8c\u8bc1\u548c Decode QK \u5faa\u73af\u7684\u4fdd\u5b88\u7248\u672c&#xff0c;\u5728 MMAC \u524d\u540e\u4fdd\u7559\u7b49\u5f85&#xff1a;<\/p>\n<p><span class=\"token keyword\">asm<\/span> <span class=\"token keyword\">volatile<\/span><span class=\"token punctuation\">(<\/span><br \/>\n    <span class=\"token string\">&#034;s_nop 4\\\\n\\\\t&#034;<\/span><br \/>\n    <span class=\"token string\">&#034;v_mmac_i32_16x16x32_i8 %0, %1, %2, %0\\\\n\\\\t&#034;<\/span><br \/>\n    <span class=\"token string\">&#034;s_nop 4\\\\n\\\\t&#034;<\/span><br \/>\n    <span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;&#043;v&#034;<\/span><span class=\"token punctuation\">(<\/span>acc<span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;v&#034;<\/span><span class=\"token punctuation\">(<\/span>a<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;v&#034;<\/span><span class=\"token punctuation\">(<\/span>b<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u5206\u5757 Prefill \u4f7f\u7528\u7684\u6d41\u6c34\u7248\u672c\u53ea\u53d1\u51fa MMAC&#xff0c;\u8ba9\u5c55\u5f00\u5faa\u73af\u4e2d\u7684 fragment load\u3001Scale \u8ba1\u7b97\u548c\u5176\u4ed6\u72ec\u7acb\u5de5\u4f5c\u8986\u76d6\u6307\u4ee4\u95f4\u9694\u3002\u5220\u9664 s_nop \u5e76\u4e0d\u662f\u666e\u904d\u6210\u7acb\u7684\u4f18\u5316&#xff1b;\u82e5\u8c03\u7528\u70b9\u6ca1\u6709\u8db3\u591f\u7684\u72ec\u7acb\u6307\u4ee4&#xff0c;\u786c\u4ef6\u76f8\u5173\u7b49\u5f85\u4ecd\u53ef\u80fd\u91cd\u65b0\u51fa\u73b0&#xff0c;\u751a\u81f3\u4ea7\u751f\u65f6\u5e8f\u6216\u6b63\u786e\u6027\u95ee\u9898\u3002<\/p>\n<p>\u56e0\u6b64\u6211\u4eec\u540c\u65f6\u68c0\u67e5 dccobjdump \u4e2d\u7684\u771f\u5b9e\u6307\u4ee4\u3001VGPR \u4e0e scratch \u4f7f\u7528\u91cf&#xff0c;\u4ee5\u53ca\u5b8c\u6574 kernel \u7684\u5b9e\u6d4b\u65f6\u5ef6\u3002\u53ea\u770b C&#043;&#043; \u6e90\u7801\u91cc\u5c11\u4e86\u4e24\u884c s_nop&#xff0c;\u4e0d\u80fd\u8bc1\u660e\u5185\u6838\u5df2\u7ecf\u53d8\u5feb\u3002<\/p>\n<h3>3. \u5206\u9875K Cache\u5982\u4f55\u6301\u7eed\u4e3aMMAC\u4f9b\u6570<\/h3>\n<p>PagedAttention \u4e2d\u7684 K \u5e76\u4e0d\u662f\u4e00\u4e2a\u8fde\u7eed\u7684 [token,head,dim] \u77e9\u9635\u3002\u903b\u8f91 token \u9700\u8981\u5148\u901a\u8fc7 block table \u627e\u5230\u7269\u7406 block&#xff0c;\u518d\u901a\u8fc7 slot \u627e\u5230\u9875\u5185\u4f4d\u7f6e\u3002\u5982\u679c\u5b8c\u5168\u6309\u7167\u903b\u8f91\u77e9\u9635\u9010\u5143\u7d20\u8bfb\u53d6&#xff0c;MMAC \u7684 16 \u4e2a\u8f93\u51fa\u5217\u4f1a\u4ea7\u751f\u5927\u91cf\u5206\u6563\u8bbf\u95ee\u3002<\/p>\n<p>\u7b2c\u4e00\u7bc7\u5df2\u7ecf\u4ecb\u7ecd\u8fc7 K Cache \u7684\u603b\u4f53\u5e03\u5c40&#xff0c;\u8fd9\u91cc\u53ea\u770b QK \u5982\u4f55\u6d88\u8d39\u5b83&#xff1a;<\/p>\n<p>K cache: [block, kv_head, head_dim \/ 16, block_size, 16]<\/p>\n<p>\u52a0\u8f7d\u4e00\u4e2a K fragment \u65f6&#xff0c;\u5185\u6838\u4f9d\u6b21\u5b8c\u6210&#xff1a;<\/p>\n<li>\u6839\u636e\u903b\u8f91 key token \u67e5\u8be2 block table&#xff1b;<\/li>\n<li>\u8ba1\u7b97\u8be5 token \u5728\u7269\u7406\u9875\u4e2d\u7684 slot&#xff1b;<\/li>\n<li>\u6839\u636e lane_k_base\/16 \u9009\u62e9 head-dimension \u5c0f\u5757&#xff1b;<\/li>\n<li>\u7528 8-byte \u6216 16-byte \u5411\u91cf load \u53d6\u5f97 INT8 fragment&#xff1b;<\/li>\n<li>\u5c06 fragment \u76f4\u63a5\u9001\u5165 MMAC\u3002<\/li>\n<p>\u8fd9\u91cc\u4e0d\u751f\u6210\u5b8c\u6574 BF16 K tensor\u3002K \u4ece\u5206\u9875 INT8 Cache \u8fdb\u5165\u5bc4\u5b58\u5668\u6216 LDS \u540e&#xff0c;\u4ecd\u4fdd\u6301 INT8&#xff0c;\u76f4\u5230\u53c2\u4e0e\u77e9\u9635\u4e58\u6cd5\u3002\u8fd9\u6837\u624d\u80fd\u540c\u65f6\u4fdd\u7559\u4e24\u7c7b\u6536\u76ca&#xff1a;\u8bfb\u53d6 K \u7684\u6709\u6548\u5b57\u8282\u6570\u4e0b\u964d&#xff0c;QK \u53c8\u80fd\u4f7f\u7528\u539f\u751f INT8 MMAC\u3002<\/p>\n<p>\u6211\u4eec\u4e13\u95e8\u6d4b\u8fc7\u53e6\u4e00\u6761\u770b\u4f3c\u4fdd\u5b88\u7684\u8def\u7ebf&#xff1a;\u8bfb\u53d6 INT8 K&#xff0c;\u5728\u5bc4\u5b58\u5668\u91cc\u4e58 Scale \u5e76\u8f6c\u6210 BF16&#xff0c;\u518d\u8c03\u7528\u6210\u719f BF16 MMAC\u3002\u5b83\u4e0d\u9700\u8981\u5168\u5c40 BF16 \u4e2d\u95f4\u5f20\u91cf&#xff0c;\u4f46\u771f\u5b9e Qwen tile \u53ea\u6709 BF16 \u5bf9\u7167\u7684 0.71x-1.00x\u3002\u539f\u56e0\u662f\u77ed fragment \u4e0a\u7684\u7c7b\u578b\u8f6c\u6362\u3001Scale \u548c\u91cd\u6392\u6307\u4ee4\u5df2\u7ecf\u8db3\u4ee5\u62b5\u6d88\u8bfb\u53d6\u91cf\u4e0b\u964d\u3002<\/p>\n<h3>4. Query\u91cf\u5316\u53ea\u505a\u4e00\u6b21<\/h3>\n<p>K \u5df2\u7ecf\u4fdd\u5b58\u5728 INT8 Cache \u4e2d&#xff0c;Q \u5219\u662f\u5f53\u524d\u6b65\u9aa4\u65b0\u751f\u6210\u7684 BF16 \u6570\u636e\u3002\u6bcf\u4e2a Query row \u9700\u8981\u8ba1\u7b97&#xff1a;<\/p>\n<p>sQ &#061; max(abs(Q)) \/ 127<br \/>\nQq &#061; round(Q \/ sQ)<\/p>\n<p>Decode Attention \u4f1a\u628a\u957f\u4e0a\u4e0b\u6587\u5206\u6210\u591a\u4e2a segment\u3002\u82e5\u6bcf\u4e2a segment \u90fd\u91cd\u65b0\u91cf\u5316 Q&#xff0c;\u540c\u4e00\u6761 256-element Query \u4f1a\u88ab\u53cd\u590d\u8bfb\u53d6\u3001\u5f52\u7ea6\u548c\u820d\u5165\u3002\u5206\u6bb5\u8d8a\u591a&#xff0c;\u8fd9\u9879\u91cd\u590d\u6210\u672c\u8d8a\u660e\u663e\u3002<\/p>\n<p>\u6700\u7ec8\u5b9e\u73b0\u628a Q \u91cf\u5316\u5e76\u5165 RoPE\/KV producer\u3002\u4e00\u4e2a Query \u53ea\u751f\u6210\u4e00\u4efd INT8 \u6570\u636e\u548c Scale&#xff0c;\u6240\u6709 split-K segment \u5171\u540c\u590d\u7528\u3002\u5e26\u5386\u53f2\u7684\u5206\u5757 Prefill\u4e5f\u91c7\u7528\u76f8\u540c\u539f\u5219&#xff1a;Query \u91cf\u5316\u53d1\u751f\u5728 Attention \u4e4b\u524d&#xff0c;\u4e0d\u653e\u8fdb\u6bcf\u4e2a\u5386\u53f2\u5206\u6bb5\u5185\u90e8\u3002<\/p>\n<p>\u4e3a\u4e86\u5224\u65ad\u8fd9\u9879\u6210\u672c\u7684\u91cf\u7ea7&#xff0c;\u6211\u4eec\u66fe\u5355\u72ec\u6d4b\u91cf\u5904\u7406\u5168\u90e8 24 \u4e2a Query \u5934\u7684\u6210\u719f\u91cf\u5316\u5185\u6838&#xff1a;<\/p>\n<table>\n<tr>\u5f53\u524d Query token \u6570Query\u91cf\u5316\u65f6\u95f4<\/tr>\n<tbody>\n<tr>\n<td align=\"right\">4096<\/td>\n<td align=\"right\">0.450 ms<\/td>\n<\/tr>\n<tr>\n<td align=\"right\">8192<\/td>\n<td align=\"right\">0.896 ms<\/td>\n<\/tr>\n<tr>\n<td align=\"right\">16384<\/td>\n<td align=\"right\">1.787 ms<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8fd9\u4e9b\u662f Prefill\/Extend \u5927\u5757 Query \u7684\u6d4b\u8bd5&#xff0c;\u4e0d\u662f\u5355 token Decode \u7684\u91cf\u5316\u65f6\u95f4\u3002\u548c 20 ms \u4ee5\u4e0a\u7684\u957f\u4e0a\u4e0b\u6587 Attention \u76f8\u6bd4&#xff0c;\u5b83\u4e0d\u662f\u6700\u5927\u9879&#xff0c;\u4f46\u4e5f\u7edd\u4e0d\u662f\u96f6\u6210\u672c\u3002\u628a\u5b83\u878d\u5408\u8fdb producer \u7684\u4ef7\u503c\u5728\u4e8e\u51cf\u5c11\u5168\u5c40 Q \u8bfb\u5199\u3001kernel launch \u548c\u5206\u6bb5\u91cd\u590d\u5f52\u7ea6\u3002<\/p>\n<h3>5. Decode\u548cPrefill\u4e0d\u80fd\u5171\u7528\u4e00\u79cd\u884c\u6620\u5c04<\/h3>\n<p>Qwen3.5 \u7684\u5168 Attention \u4f7f\u7528 24 \u4e2a Query \u5934\u548c 4 \u4e2a KV \u5934&#xff0c;\u5373 6:1 GQA\u3002\u6bcf\u4e2a KV \u5934\u7531 6 \u4e2a Query \u5934\u5171\u4eab&#xff0c;\u800c gfx936 MMAC \u7684\u8f93\u51fa\u5757\u56fa\u5b9a\u6709 16 \u884c\u3002<\/p>\n<h4>5.1 Decode&#xff1a;16\u884c\u4e2d\u53ea\u67096\u79cd\u72ec\u7acbQuery<\/h4>\n<p>Decode \u6bcf\u6b21\u53ea\u6709\u4e00\u4e2a\u65b0 token&#xff0c;\u65e0\u6cd5\u7528 token \u7ef4\u586b\u6ee1 16 \u884c\u3002\u6700\u7ec8 wxp \u5185\u6838\u6309\u7167 Query \u5934\u7f16\u53f7\u5bf9 6 \u53d6\u6a21&#xff0c;\u5c06 6 \u4e2a Query \u5934\u91cd\u590d\u586b\u5165 16 \u4e2a MMAC \u884c\u3002<\/p>\n<p>16 \u884c\u90fd\u4f1a\u6267\u884c&#xff0c;\u4f46\u53ea\u6709 6 \u884c\u5305\u542b\u5f7c\u6b64\u4e0d\u540c\u7684 Query&#xff0c;\u56e0\u6b64\u72ec\u7acb\u6709\u6548\u884c\u6bd4\u4f8b\u4e3a&#xff1a;<\/p>\n<p>6 \/ 16 &#061; 37.5%<\/p>\n<p>\u8fd9\u4e0d\u7b49\u4e8e\u53ea\u6709 37.5% \u7684\u7ebf\u7a0b\u5de5\u4f5c&#xff0c;\u800c\u662f 62.5% \u7684\u77e9\u9635\u884c\u91cd\u590d\u4e86\u5df2\u6709 Query\u3002INT8 \u7684 K-step \u867d\u7136\u51cf\u534a&#xff0c;\u8fd9\u90e8\u5206\u91cd\u590d\u8ba1\u7b97\u4ecd\u7136\u5b58\u5728\u3002\u6bd4\u8d5b\u7ed3\u675f\u524d&#xff0c;\u53e6\u4e00\u79cd GQA6 \u7d27\u51d1\u6253\u5305\u5e03\u5c40\u6ca1\u6709\u5b8c\u6210\u5b8c\u6574\u6b63\u786e\u6027\u548c\u7aef\u5230\u7aef\u9a8c\u8bc1&#xff0c;\u56e0\u6b64\u6700\u7ec8\u63d0\u4ea4\u63a5\u53d7\u4e86\u8fd9\u4e00\u4e0a\u9650\u3002<\/p>\n<h4>5.2 Prefill&#xff1a;\u7528Query token\u586b\u6ee116\u884c<\/h4>\n<p>\u5e26\u5386\u53f2\u7684\u5206\u5757 Prefill \u6709\u5927\u91cf\u5f53\u524d Query token&#xff0c;\u53ef\u4ee5\u91c7\u7528\u66f4\u81ea\u7136\u7684\u6620\u5c04&#xff1a;\u6bcf\u4e2a Query \u5934\u5355\u72ec\u5904\u7406&#xff0c;MMAC \u7684\u884c\u5bf9\u5e94\u5f53\u524d\u8f93\u5165\u5757\u4e2d\u7684 Query token&#xff0c;KV \u5934\u901a\u8fc7 query_head\/6 \u6620\u5c04\u3002<\/p>\n<p>\u65e9\u671f\u5185\u6838\u7531\u4e00\u4e2a workgroup \u5904\u7406 64 \u4e2a Query row&#xff0c;\u6539\u8fdb\u540e\u7531 8 \u4e2a wave \u534f\u540c\u5904\u7406 128 \u4e2a Query row&#xff0c;\u4f7f\u540c\u4e00\u4efd K\/V tile \u88ab\u66f4\u591a Query \u590d\u7528\u3002\u8fd9\u91cc\u7684 128 \u662f Query token \u65b9\u5411\u4e0a\u7684\u884c\u6570&#xff0c;\u4e0d\u662f 128 \u4e2a Query \u5934\u3002<\/p>\n<p>\u56e0\u6b64&#xff0c;Decode \u4e0e Prefill \u7684\u5171\u540c\u70b9\u662f\u90fd\u6267\u884c INT8 QK&#xff0c;\u533a\u522b\u5728\u4e8e M \u7ef4\u4ece\u54ea\u91cc\u53d6\u5f97\u5e76\u884c\u5ea6&#xff1a;<\/p>\n<p>Decode&#xff1a;  M\u7ef4\u6765\u81eaGQA\u7ec4\u5185Query\u5934&#xff0c;\u53ea\u67096\u79cd\u72ec\u7acb\u884c<br \/>\nPrefill&#xff1a; M\u7ef4\u6765\u81ea\u5f53\u524dQuery token&#xff0c;\u53ef\u4ee5\u586b\u6ee1MMAC\u884c<\/p>\n<p>\u8fd9\u4e5f\u662f\u4e3a\u4ec0\u4e48\u4e00\u4e2a\u5728 Prefill \u4e0a\u5229\u7528\u7387\u5f88\u9ad8\u7684 QK tile&#xff0c;\u4e0d\u80fd\u76f4\u63a5\u5957\u5230\u5355\u8bf7\u6c42 Decode\u3002<\/p>\n<h3>6. QK\u7b97\u5b50\u5b9e\u6d4b\u7ed3\u679c<\/h3>\n<p>\u4e3a\u4e86\u907f\u514d\u628a\u5176\u4ed6\u7b97\u5b50\u7684\u6536\u76ca\u7b97\u5230 QK \u4e0a&#xff0c;\u6211\u4eec\u53ea\u4fdd\u7559\u4e24\u7c7b QK \u5bf9\u7167&#xff1a;<\/p>\n<table>\n<tr>QK\u8def\u7ebf\u5bf9\u7167\u5b9e\u6d4b\u7ed3\u679c\u7ed3\u8bba<\/tr>\n<tbody>\n<tr>\n<td>INT8 K\u8f6cBF16&#xff0c;\u518d\u6267\u884cBF16 MMAC<\/td>\n<td>\u539f\u751fBF16 QK<\/td>\n<td align=\"right\">0.71x-1.00x<\/td>\n<td>\u8f6c\u6362\u548cScale\u62b5\u6d88\u8bfb\u53d6\u6536\u76ca<\/td>\n<\/tr>\n<tr>\n<td>Query\u548cKey\u76f4\u63a5\u6267\u884cINT8 MMAC<\/td>\n<td>\u539f\u751fBF16 QK<\/td>\n<td align=\"right\">\u5927tile\u4e3a1.55x-1.63x<\/td>\n<td>\u957f\u4e0a\u4e0b\u6587QK\u6709\u660e\u786e\u6536\u76ca<\/td>\n<\/tr>\n<tr>\n<td>\u539f\u751fINT8 MMAC\u5c0f\u5f62\u72b6<\/td>\n<td>\u539f\u751fBF16 QK<\/td>\n<td align=\"right\">256-token\u9644\u8fd1\u63a5\u8fd1\u6301\u5e73<\/td>\n<td>kernel\u542f\u52a8\u548c\u56fa\u5b9a\u5f00\u9500\u5360\u4e3b\u5bfc<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8fd9\u7ec4\u6570\u636e\u8bf4\u660e&#xff0c;INT8 K Cache \u5fc5\u987b\u548c INT8 QK \u8ba1\u7b97\u7ed3\u5408&#xff0c;\u5355\u7eaf\u628a K \u538b\u7f29\u540e\u518d\u6062\u590d BF16 \u5f88\u96be\u62ff\u5230\u540c\u6837\u6536\u76ca\u3002\u540c\u65f6&#xff0c;1.55x-1.63x \u53ea\u8986\u76d6 QK \u5185\u5c42\u77e9\u9635\u5757&#xff0c;\u4e0d\u5305\u542b Query \u91cf\u5316\u3001online softmax\u3001PV\u3001KV producer \u548c\u8f93\u51fa\u5199\u56de\u3002<\/p>\n<p>\u5b8c\u6574 Attention \u548c\u7aef\u5230\u7aef\u6536\u76ca\u5df2\u7ecf\u5728\u7b2c\u4e00\u7bc7\u7ed9\u51fa\u3002\u6700\u7ec8 QK \u4e0e INT8 PV\u3001\u878d\u5408 producer \u548c\u9009\u62e9\u6027 Prefill \u4e00\u8d77\u8fdb\u5165\u6b63\u5f0f\u63d0\u4ea4.<\/p>\n<h3>7. QK\u6b63\u786e\u6027\u548c\u9002\u7528\u8fb9\u754c<\/h3>\n<p>QK \u4f4d\u4e8e softmax \u4e4b\u524d&#xff0c;\u4e00\u4e2a\u4e0d\u5927\u7684 score \u8bef\u5dee\u4e5f\u53ef\u80fd\u6539\u53d8\u6700\u7ec8\u6982\u7387\u6392\u5e8f\u3002\u6211\u4eec\u91c7\u7528\u4e86\u56db\u5c42\u9a8c\u8bc1&#xff1a;<\/p>\n<li>CPU fragment\u6a21\u578b&#xff1a;\u91cd\u5efa wave64 \u7684 16\u00d716\u00d732 \u8f93\u5165\u548c\u8f93\u51fa&#xff0c;\u786e\u8ba4\u6bcf\u4e2a lane \u7684\u56db\u4e2a accumulator \u5bf9\u5e94\u54ea\u4e9b\u5217&#xff1b;<\/li>\n<li>\u5b8c\u6574head_dim&#061;256&#xff1a;INT8 \u5bf9\u7167\u8986\u76d6 8 \u4e2a K-step&#xff0c;BF16 \u5bf9\u7167\u8986\u76d6 16 \u4e2a K-step&#xff0c;\u907f\u514d\u53ea\u8ba1\u7b97\u4e00\u534a\u7ef4\u5ea6&#xff1b;<\/li>\n<li>\u5206\u9875\u548cScale&#xff1a;\u8986\u76d6\u8de8\u7269\u7406 block\u3001\u975e\u96f6 slot\u3001per-token Key Scale\u3001\u5c3e\u90e8 mask \u548c GQA head mapping&#xff1b;<\/li>\n<li>\u8fd0\u884c\u65f6\u8def\u5f84&#xff1a;\u68c0\u67e5\u76ee\u6807\u539f\u751f\u6269\u5c55\u3001\u8def\u7531\u547d\u4e2d\u4e0e\u771f\u5b9e kernel \u8c03\u7528&#xff0c;\u800c\u4e0d\u662f\u53ea\u770b\u4e8c\u8fdb\u5236\u4e2d\u5b58\u5728 MMAC \u6307\u4ee4\u3002<\/li>\n<p>\u5176\u4e2d\u7b2c\u4e8c\u9879\u6765\u81ea\u4e00\u6b21\u771f\u5b9e\u6559\u8bad&#xff1a;\u65e9\u671f BF16 \u63a7\u5236\u7ec4\u53ea\u52a0\u8f7d\u4e86 128 \u7ef4 Query&#xff0c;\u5bfc\u81f4\u6211\u4eec\u9519\u8bef\u5730\u628a\u63a7\u5236\u7ec4\u95ee\u9898\u5f52\u56e0\u6210 INT8 \u8bef\u5dee\u3002\u7b2c\u4e09\u9879\u4e5f\u4e0d\u80fd\u53ea\u9a8c\u8bc1\u8fde\u7eed token&#xff0c;\u56e0\u4e3a MMAC \u8f93\u51fa\u5217\u672c\u8eab\u662f\u4ea4\u7ec7\u7684\u3002<\/p>\n<p>\u6700\u7ec8\u8fd9\u6761\u4e13\u7528\u8def\u5f84\u660e\u786e\u68c0\u67e5 head_size&#061;256\u3001GQA ratio\u4e3a6\u3001\u65e0 sliding window\u548c\u65e0 shuffle cache&#xff1b;Prefill \u8def\u5f84\u8fd8\u8981\u6c42 Q24\/KV4&#xff0c;\u5e76\u6392\u9664 ALiBi \u4e0e logits soft cap\u3002\u9875\u9762\u5e03\u5c40\u3001stride\u6216\u6a21\u578b\u7ed3\u6784\u4e0d\u6ee1\u8db3\u65f6\u76f4\u63a5\u62d2\u7edd\u542f\u7528&#xff0c;\u800c\u4e0d\u662f\u5e26\u7740\u9519\u8bef\u6620\u5c04\u9759\u9ed8\u8fd0\u884c\u3002<\/p>\n<p>INT8 QK\u66f4\u9002\u5408&#xff1a;<\/p>\n<ul>\n<li>head dimension\u8f83\u5927&#xff0c;\u4f8b\u5982256&#xff1b;<\/li>\n<li>\u5386\u53f2\u4e0a\u4e0b\u6587\u8db3\u591f\u957f&#xff0c;\u77e9\u9635\u4e58\u6cd5\u4e0d\u518d\u4e3b\u8981\u53d7\u542f\u52a8\u5f00\u9500\u9650\u5236&#xff1b;<\/li>\n<li>K\u5df2\u7ecf\u6309MMAC\u8bfb\u53d6\u65b9\u5411\u6392\u5e03&#xff1b;<\/li>\n<li>Query\u91cf\u5316\u53ef\u4ee5\u878d\u5408\u5e76\u8de8segment\u590d\u7528&#xff1b;<\/li>\n<li>MMAC\u884c\u80fd\u7531token\u6216\u591a\u4e2aGQA group\u6709\u6548\u586b\u5145&#xff1b;<\/li>\n<li>INT32\u7ed3\u679c\u53ef\u4ee5\u5728\u5bc4\u5b58\u5668\u4e2d\u6062\u590dScale\u5e76\u76f4\u63a5\u8fdb\u5165softmax\u3002<\/li>\n<\/ul>\n<p>\u4e0d\u9002\u5408\u76f4\u63a5\u5957\u7528\u7684\u60c5\u51b5\u5305\u62ec&#xff1a;<\/p>\n<ul>\n<li>\u5f88\u5c0f\u7684QK tile&#xff1b;<\/li>\n<li>\u5148\u5b8c\u6574\u53cd\u91cf\u5316&#xff0c;\u518d\u8c03\u7528\u53e6\u4e00\u4e2aBF16 kernel&#xff1b;<\/li>\n<li>\u6bcf\u4e2asplit-K segment\u91cd\u590d\u91cf\u5316Query&#xff1b;<\/li>\n<li>\u53ea\u6bd4\u8f83MMAC\u5cf0\u503c&#xff0c;\u4e0d\u68c0\u67e5GQA\u884c\u5229\u7528\u7387&#xff1b;<\/li>\n<li>\u6ca1\u6709\u8bc1\u660e\u670d\u52a1\u5b9e\u9645\u6267\u884c\u76ee\u6807\u5185\u6838\u3002<\/li>\n<\/ul>\n<h3>8. \u7ed3\u8bed<\/h3>\n<p>\u5728 gfx936 \u4e0a\u5b9e\u73b0 INT8 QK&#xff0c;\u6700\u5173\u952e\u7684\u5e76\u4e0d\u662f\u628a Query \u548c Key \u8f6c\u6210 INT8&#xff0c;\u800c\u662f\u8ba9\u5206\u9875 K Cache\u3001Query fragment\u3001Scale \u4e0b\u6807\u548c softmax token\u4e25\u683c\u5bf9\u9f50\u5230\u540c\u4e00\u5957 MMAC \u5bc4\u5b58\u5668\u6620\u5c04\u3002<\/p>\n<p>\u6700\u7ec8\u53ef\u4ee5\u786e\u8ba4\u4e24\u70b9&#xff1a;\u539f\u751f INT8 QK MMAC \u5728\u957f tile \u4e0a\u8fbe\u5230 1.55x-1.63x&#xff0c;\u800c\u201cINT8 K\u8f6cBF16\u540e\u7ee7\u7eed\u4f7f\u7528BF16 MMAC\u201d\u6ca1\u6709\u7a33\u5b9a\u6536\u76ca\u3002\u4f4e\u7cbe\u5ea6\u6570\u636e\u53ea\u6709\u4e00\u76f4\u4fdd\u7559\u5230\u77e9\u9635\u6307\u4ee4\u5165\u53e3&#xff0c;\u624d\u80fd\u540c\u65f6\u5151\u73b0\u5e26\u5bbd\u548c\u8ba1\u7b97\u4e24\u65b9\u9762\u7684\u4ef7\u503c\u3002<\/p>\n<p>\u4e0b\u4e00\u7bc7\u300agfx936 DCU\u4e0a\u5b9e\u73b0INT8 PV MMAC&#xff1a;V Scale\u878d\u5408\u3001\u6982\u7387\u91cf\u5316\u4e0eFragment\u5206\u7ec4\u300b\u5c06\u7ee7\u7eed\u4ecb\u7ecd\u66f4\u590d\u6742\u7684 INT8 PV\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>gfx936 DCU\u4e0a\u5b9e\u73b0INT8 QK MMAC&#xff1a;\u5206\u9875\u8bbf\u5b58\u3001Fragment\u6620\u5c04\u4e0eGQA\u9002\u914d<br \/>\n\u524d\u8a00<br \/>\n\u672c\u6587\u662f\u7cfb\u5217\u7b2c\u4e8c\u7bc7\u3002\u7b2c\u4e00\u7bc7\u300agfx936 DCU\u4e0a\u5b9e\u73b0INT8 KV\u4e0eINT8 MMAC Attention\u63a8\u7406\u4f18\u5316\u300b\u4ecb\u7ecd\u4e86\u5b8c\u6574\u6570\u636e\u6d41&#xff0c;\u672c\u6587\u805a\u7126 Attention \u7684\u7b2c\u4e00\u6b21\u77e9\u9635\u4e58\u6cd5 QK^T\u3002<br \/>\n\u628a K Cache \u5b58\u6210 INT8 \u5e76\u4e0d\u4ee3\u8868 QK \u5df2\u7ecf\u4f7f\u7528\u4f4e\u7cbe\u5ea6\u8ba1\u7b97\u3002\u6700\u5bb9\u6613\u5b9e\u73b0\u7684\u4e00\u79cd\u8def\u5f84\u662f\u4ece Cache \u8bfb\u53d6 INT8 K&#xff0c;\u5728\u5bc4\u5b58<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[208,51],"topic":[],"class_list":["post-81512","post","type-post","status-publish","format-standard","hentry","category-server","tag-gpu","tag-51"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>gfx936 DCU\u4e0a\u5b9e\u73b0INT8 QK MMAC\uff1a\u5206\u9875\u8bbf\u5b58\u3001Fragment\u6620\u5c04\u4e0eGQA\u9002\u914d - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/81512.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"gfx936 DCU\u4e0a\u5b9e\u73b0INT8 QK MMAC\uff1a\u5206\u9875\u8bbf\u5b58\u3001Fragment\u6620\u5c04\u4e0eGQA\u9002\u914d - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"gfx936 DCU\u4e0a\u5b9e\u73b0INT8 QK MMAC&#xff1a;\u5206\u9875\u8bbf\u5b58\u3001Fragment\u6620\u5c04\u4e0eGQA\u9002\u914d \u524d\u8a00 \u672c\u6587\u662f\u7cfb\u5217\u7b2c\u4e8c\u7bc7\u3002\u7b2c\u4e00\u7bc7\u300agfx936 DCU\u4e0a\u5b9e\u73b0INT8 KV\u4e0eINT8 MMAC Attention\u63a8\u7406\u4f18\u5316\u300b\u4ecb\u7ecd\u4e86\u5b8c\u6574\u6570\u636e\u6d41&#xff0c;\u672c\u6587\u805a\u7126 Attention \u7684\u7b2c\u4e00\u6b21\u77e9\u9635\u4e58\u6cd5 QK^T\u3002 \u628a K Cache \u5b58\u6210 INT8 \u5e76\u4e0d\u4ee3\u8868 QK \u5df2\u7ecf\u4f7f\u7528\u4f4e\u7cbe\u5ea6\u8ba1\u7b97\u3002\u6700\u5bb9\u6613\u5b9e\u73b0\u7684\u4e00\u79cd\u8def\u5f84\u662f\u4ece Cache \u8bfb\u53d6 INT8 K&#xff0c;\u5728\u5bc4\u5b58\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/81512.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-24T18:36:51+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/81512.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/81512.html\",\"name\":\"gfx936 DCU\u4e0a\u5b9e\u73b0INT8 QK MMAC\uff1a\u5206\u9875\u8bbf\u5b58\u3001Fragment\u6620\u5c04\u4e0eGQA\u9002\u914d - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-24T18:36:51+00:00\",\"dateModified\":\"2026-07-24T18:36:51+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/81512.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/81512.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/81512.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"gfx936 DCU\u4e0a\u5b9e\u73b0INT8 QK MMAC\uff1a\u5206\u9875\u8bbf\u5b58\u3001Fragment\u6620\u5c04\u4e0eGQA\u9002\u914d\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"gfx936 DCU\u4e0a\u5b9e\u73b0INT8 QK MMAC\uff1a\u5206\u9875\u8bbf\u5b58\u3001Fragment\u6620\u5c04\u4e0eGQA\u9002\u914d - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/81512.html","og_locale":"zh_CN","og_type":"article","og_title":"gfx936 DCU\u4e0a\u5b9e\u73b0INT8 QK MMAC\uff1a\u5206\u9875\u8bbf\u5b58\u3001Fragment\u6620\u5c04\u4e0eGQA\u9002\u914d - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"gfx936 DCU\u4e0a\u5b9e\u73b0INT8 QK MMAC&#xff1a;\u5206\u9875\u8bbf\u5b58\u3001Fragment\u6620\u5c04\u4e0eGQA\u9002\u914d \u524d\u8a00 \u672c\u6587\u662f\u7cfb\u5217\u7b2c\u4e8c\u7bc7\u3002\u7b2c\u4e00\u7bc7\u300agfx936 DCU\u4e0a\u5b9e\u73b0INT8 KV\u4e0eINT8 MMAC Attention\u63a8\u7406\u4f18\u5316\u300b\u4ecb\u7ecd\u4e86\u5b8c\u6574\u6570\u636e\u6d41&#xff0c;\u672c\u6587\u805a\u7126 Attention \u7684\u7b2c\u4e00\u6b21\u77e9\u9635\u4e58\u6cd5 QK^T\u3002 \u628a K Cache \u5b58\u6210 INT8 \u5e76\u4e0d\u4ee3\u8868 QK \u5df2\u7ecf\u4f7f\u7528\u4f4e\u7cbe\u5ea6\u8ba1\u7b97\u3002\u6700\u5bb9\u6613\u5b9e\u73b0\u7684\u4e00\u79cd\u8def\u5f84\u662f\u4ece Cache \u8bfb\u53d6 INT8 K&#xff0c;\u5728\u5bc4\u5b58","og_url":"https:\/\/www.wsisp.com\/helps\/81512.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-24T18:36:51+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/81512.html","url":"https:\/\/www.wsisp.com\/helps\/81512.html","name":"gfx936 DCU\u4e0a\u5b9e\u73b0INT8 QK MMAC\uff1a\u5206\u9875\u8bbf\u5b58\u3001Fragment\u6620\u5c04\u4e0eGQA\u9002\u914d - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-24T18:36:51+00:00","dateModified":"2026-07-24T18:36:51+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/81512.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/81512.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/81512.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"gfx936 DCU\u4e0a\u5b9e\u73b0INT8 QK MMAC\uff1a\u5206\u9875\u8bbf\u5b58\u3001Fragment\u6620\u5c04\u4e0eGQA\u9002\u914d"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/81512","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=81512"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/81512\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=81512"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=81512"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=81512"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=81512"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}