<?xml version='1.0' encoding='utf-8'?>
<mxfile host="app.diagrams.net" modified="2026-10-18T00:00:00.000Z" agent="Codex" version="24.7.17">
  <diagram id="deepseek-v41-decode-token" name="Decode token path">
    <mxGraphModel dx="1540" dy="680" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1540" pageHeight="680" math="0" shadow="0">
      <root>
        <mxCell id="0" />
        <mxCell id="1" parent="0" />
        <mxCell id="heading" value="One decode token: cache ownership and handoff" style="text;html=1;align=left;verticalAlign=middle;whiteSpace=wrap;fontSize=27;fontStyle=1;fontColor=#1f2d3d;" vertex="1" parent="1">
          <mxGeometry x="50" y="20" width="1100" height="42" as="geometry" />
        </mxCell>
        <mxCell id="subtitle" value="Text-only · non-speculative · compressed layer · index refresh · FlashMLA branch" style="text;html=1;align=left;whiteSpace=wrap;fontSize=16;fontColor=#536273;" vertex="1" parent="1">
          <mxGeometry x="50" y="61" width="1250" height="24" as="geometry" />
        </mxCell>
        <mxCell id="band" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8fafc;strokeColor=#c7d2df;arcSize=6;" vertex="1" parent="1">
          <mxGeometry x="35" y="225" width="1470" height="330" as="geometry" />
        </mxCell>
        <mxCell id="bandtitle" value="Inside one compressed-attention layer" style="text;html=1;align=left;whiteSpace=wrap;fontSize=18;fontStyle=1;fontColor=#31445c;" vertex="1" parent="1">
          <mxGeometry x="65" y="235" width="800" height="34" as="geometry" />
        </mxCell>
        <mxCell id="role_note" value="KV-source and index-source roles are independent; a layer may have both." style="text;html=1;align=left;whiteSpace=wrap;fontSize=15;fontColor=#536273;" vertex="1" parent="1">
          <mxGeometry x="65" y="521" width="1000" height="30" as="geometry" />
        </mxCell>
        <mxCell id="scheduler" value="&lt;b&gt;SchedulerOutput&lt;/b&gt;&lt;br&gt;scheduled token rows" style="rounded=1;whiteSpace=wrap;html=1;align=left;verticalAlign=middle;spacingLeft=16;fillColor=#e8f2ff;strokeColor=#2c63a1;strokeWidth=2.5;fontSize=17;fontColor=#1f2d3d;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="50" y="98" width="240" height="86" as="geometry" />
        </mxCell>
        <mxCell id="runner" value="&lt;b&gt;GPUModelRunner&lt;/b&gt;&lt;br&gt;InputBatch, slots, metadata" style="rounded=1;whiteSpace=wrap;html=1;align=left;verticalAlign=middle;spacingLeft=16;fillColor=#e8f2ff;strokeColor=#2c63a1;strokeWidth=2.5;fontSize=17;fontColor=#1f2d3d;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="380" y="98" width="300" height="86" as="geometry" />
        </mxCell>
        <mxCell id="decoder" value="&lt;b&gt;V4.1 decoder layer&lt;/b&gt;&lt;br&gt;attention input + position" style="rounded=1;whiteSpace=wrap;html=1;align=left;verticalAlign=middle;spacingLeft=16;fillColor=#efeaff;strokeColor=#7053a3;strokeWidth=2.5;fontSize=17;fontColor=#1f2d3d;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="770" y="98" width="335" height="86" as="geometry" />
        </mxCell>
        <mxCell id="swa" value="&lt;b&gt;Every attention layer&lt;/b&gt;&lt;br&gt;Q + local SWA KV / cache" style="rounded=1;whiteSpace=wrap;html=1;align=left;verticalAlign=middle;spacingLeft=16;fillColor=#fff3df;strokeColor=#a66716;strokeWidth=2.5;fontSize=17;fontColor=#1f2d3d;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="65" y="278" width="430" height="70" as="geometry" />
        </mxCell>
        <mxCell id="kv" value="&lt;b&gt;Configured KV source&lt;/b&gt;&lt;br&gt;main KV; index K if also index source" style="rounded=1;whiteSpace=wrap;html=1;align=left;verticalAlign=middle;spacingLeft=16;fillColor=#fff3df;strokeColor=#a66716;strokeWidth=2.5;fontSize=17;fontColor=#1f2d3d;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="65" y="365" width="430" height="70" as="geometry" />
        </mxCell>
        <mxCell id="index" value="&lt;b&gt;Configured index source&lt;/b&gt;&lt;br&gt;index Q + index K → shared top-k positions" style="rounded=1;whiteSpace=wrap;html=1;align=left;verticalAlign=middle;spacingLeft=16;fillColor=#fff3df;strokeColor=#a66716;strokeWidth=2.5;fontSize=17;fontColor=#1f2d3d;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="65" y="452" width="430" height="70" as="geometry" />
        </mxCell>
        <mxCell id="flashmla" value="&lt;b&gt;FlashMLA sparse decode&lt;/b&gt;&lt;br&gt;Q + local SWA + selected&lt;br&gt;compressed main KV" style="rounded=1;whiteSpace=wrap;html=1;align=left;verticalAlign=middle;spacingLeft=16;fillColor=#e5f5f0;strokeColor=#287462;strokeWidth=2.5;fontSize=17;fontColor=#1f2d3d;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="650" y="358" width="300" height="106" as="geometry" />
        </mxCell>
        <mxCell id="layer_out" value="&lt;b&gt;Layer output&lt;/b&gt;&lt;br&gt;projection → mHC → MoE&lt;br&gt;repeat through decoder stack" style="rounded=1;whiteSpace=wrap;html=1;align=left;verticalAlign=middle;spacingLeft=16;fillColor=#e5f5f0;strokeColor=#287462;strokeWidth=2.5;fontSize=17;fontColor=#1f2d3d;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="1080" y="358" width="365" height="106" as="geometry" />
        </mxCell>
        <mxCell id="sample" value="&lt;b&gt;Logits + GPU sampler&lt;/b&gt;&lt;br&gt;sampled token ID" style="rounded=1;whiteSpace=wrap;html=1;align=left;verticalAlign=middle;spacingLeft=16;fillColor=#e8f2ff;strokeColor=#2c63a1;strokeWidth=2.5;fontSize=17;fontColor=#1f2d3d;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="650" y="585" width="330" height="66" as="geometry" />
        </mxCell>
        <mxCell id="return" value="&lt;b&gt;Worker return&lt;/b&gt;&lt;br&gt;AsyncOutput / ModelRunnerOutput" style="rounded=1;whiteSpace=wrap;html=1;align=left;verticalAlign=middle;spacingLeft=16;fillColor=#e8f2ff;strokeColor=#2c63a1;strokeWidth=2.5;fontSize=17;fontColor=#1f2d3d;arcSize=12;" vertex="1" parent="1">
          <mxGeometry x="1080" y="585" width="365" height="66" as="geometry" />
        </mxCell>
        <mxCell id="edge_0" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;endFill=1;strokeWidth=3;strokeColor=#55718d;" edge="1" parent="1" source="scheduler" target="runner">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge_1" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;endFill=1;strokeWidth=3;strokeColor=#55718d;" edge="1" parent="1" source="runner" target="decoder">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge_2" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;endFill=1;strokeWidth=3;strokeColor=#7053a3;" edge="1" parent="1" source="decoder" target="band">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge_3" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;endFill=1;strokeWidth=3;strokeColor=#a66716;" edge="1" parent="1" source="swa" target="flashmla">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge_4" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;endFill=1;strokeWidth=3;strokeColor=#a66716;" edge="1" parent="1" source="kv" target="flashmla">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge_5" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;endFill=1;strokeWidth=3;strokeColor=#a66716;" edge="1" parent="1" source="index" target="flashmla">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge_6" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;endFill=1;strokeWidth=3;strokeColor=#287462;" edge="1" parent="1" source="flashmla" target="layer_out">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge_7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;endFill=1;strokeWidth=3;strokeColor=#287462;" edge="1" parent="1" source="layer_out" target="sample">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="edge_8" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=block;endFill=1;strokeWidth=3;strokeColor=#55718d;" edge="1" parent="1" source="sample" target="return">
          <mxGeometry relative="1" as="geometry" />
        </mxCell>
        <mxCell id="footer" value="Synthesized from vLLM commit 02aa10539f15; arrows show data handoffs, not kernel launch order." style="text;html=1;align=left;whiteSpace=wrap;fontSize=14;fontColor=#536273;" vertex="1" parent="1">
          <mxGeometry x="50" y="653" width="1430" height="20" as="geometry" />
        </mxCell>
      </root>
    </mxGraphModel>
  </diagram>
</mxfile>