LM/SGLang: Difference between revisions

From Fundamental Ramen
< LM
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
= Structure =
<quickmmd name="sgl-xpu">
flowchart TD
    %% 前端與介面層
    subgraph Frontend ["1. 前端與高階語言層 (Frontend & Program)"]
        A["使用者輸入 (SGLang DSL / OpenAI API / Python)"]
        B["SGLang Router & Radix Cache 管理 (CPU)"]
        A --> B
    End
    %% SRT 引擎層
    subgraph Engine ["2. SGLang Runtime (SRT Engine)"]
        C["Model Runner / Forward Engine"]
        D{"Platform Abstraction Layer (DeviceMixin)"}
        B --> C
        C --> D
    End
    %% 轉接層:Intel XPU 平台分支
    subgraph PyTorch_XPU ["3. PyTorch Backend Branch (Intel Focus)"]
        E["PyTorch XPU Backend (torch_xpu)"]
        F["Distributed Processing (oneCCL / OneAPI)"]
        D -- "檢測到 Intel GPU" --> E
        D --> F
    End
    %% 高效算子與編譯層
    subgraph Kernels ["4. XPU Kernel Execution (sgl-kernel-xpu)"]
        G["FlashAttention / FMHA (SYCL)"]
        H["MLA & MoE Grouped GEMM (SYCL)"]
        I["oneDNN / oneMKL (Intel Libraries)"]
        J["SYCL JIT Compiler (Intel icpx)"]
       
        E --> G
        E --> H
        E --> I
        G & H -- "AOT 或 JIT 編譯" --> J
    End
    %% 硬體實體層
    subgraph Hardware ["5. Intel Hardware Target (XPU)"]
        K["Intel Data Center GPU (Max/Flex 系列 / Gaudi)"]
        J --> K
        I --> K
        F --> K
    End
    %% 樣式設定
    classDef frontend fill:#e1f5fe,stroke:#0288d1,stroke-width:2px;
    classDef engine fill:#fff3e0,stroke:#f57c00,stroke-width:2px;
    classDef xpu fill:#e8f5e9,stroke:#388e3c,stroke-width:2px;
    classDef kernel fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px;
    classDef hw fill:#eceff1,stroke:#455a64,stroke-width:2px;
    class A,B frontend;
    class C,D engine;
    class E,F xpu;
    class G,H,I,J kernel;
    class K hw;
</quickmmd>
= TODO =
= TODO =



Revision as of 07:21, 8 September 2026

Structure

Kroki API returned HTTP 400
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" width="1451" height="125" viewBox="0 0 1451 125" version="1.1">
<rect fill="#fff5f7" width="1451" height="125"/>
<text id="text" xml:space="preserve" font-weight="bold" fill="#cd0930" font-family="BlinkMacSystemFont, -apple-system, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 'Helvetica', Arial, sans-serif" font-size="16px" x="0" y="5" dy="0">
<tspan x="10" dy="16">Error 400: SyntaxError: Parse error on line 48:</tspan>
<tspan x="10" dy="16">...l;    class K hw;</tspan>
<tspan x="10" dy="16">--------------------^</tspan>
<tspan x="10" dy="16">Expecting &apos;SEMI&apos;, &apos;NEWLINE&apos;, &apos;SPACE&apos;, &apos;EOF&apos;, &apos;subgraph&apos;, &apos;end&apos;, &apos;acc_title&apos;, &apos;acc_descr&apos;, &apos;acc_descr_multiline_value&apos;, &apos;AMP&apos;, &apos;COLON&apos;, &apos;STYLE&apos;, &apos;LINKSTYLE&apos;, &apos;CL…</tspan>
<tspan x="10" dy="16">Error: Syntax error in graph</tspan>
<tspan x="10" dy="16">    at Worker.convert (file:///usr/local/kroki/src/worker.js:103:15)</tspan>
<tspan x="10" dy="16">    at async file:///usr/local/kroki/src/index.js:36:28</tspan>
</text>
<rect fill="#ff3860" width="3" height="125"/>
</svg>

TODO