← 回到 Reading
Daily Dose of DS 2026-10-03

How Work is Organized Inside a GPU

Datalab 推出了 Lift,這是一款具備 9B parameters 的 open-weights 模型,能透過單一步驟直接從文件與影像中擷取結構化 JSON。該模型淘汰了傳統結合 OCR、LLM inference 與 JSON repair code 的多階段 pipelines。Lift 根據使用者提供的 JSON schema 單次(single pass)處理多頁文件,並對遺漏值回傳 null 以避免 hallucinations。Benchmarks 顯示其在超過 11,000 個 fields 中達到 90.2% 的 field accuracy,效能媲美 Gemini Flash 3.5 且速度提升三倍,並可透過 vLLM 或 Hugging Face 進行 self-hosted。GPU 透過將大型運算工作負載細分為由 grids、thread blocks、warps 和 threads 組成的階層式執行模型來執行。當 kernel function 被呼叫時,它會實例化一個劃分為 blocks 的 grid,這些 blocks 會被獨立映射到 Streaming Multiprocessors (SMs) 上。在每個 SM 內部,threads 會以 32 個為一組綁定為稱為 warps 的單位,並在不同資料值上同時執行相同的指令。SM 透過在執行中的 warps 遇到 stalls 時,迅速在就緒的 resident warps 之間切換,從而實現高 throughput 並隱藏 memory access latency。許多 LLM use cases(如 routing 和 classification)涉及從已知的一組有效答案中進行選擇,而非生成開放式文字。標準的 LLM decoding 仰賴 autoregressive token generation 產生需要 downstream parsing 的文字,而 structured output 則透過遮罩非法 tokens 來強制執行如 JSON 般可預測的 schema,同時仍然以逐 token(token-by-token)的方式進行解碼。相較之下,Jev-style scoring 則完全跳過 sequence decoding,直接對預定義的 candidate labels 進行評分並輸出其機率分佈。最佳方法取決於系統需要的是開放式文字、受 schema 約束的未知值,還是對已知選項的直接評分。

閱讀原文 ↗
目錄 3 段
  1. 01大家竟然都忽略了這個全新的 JSON extraction 模型!
  2. 02GPU 內部的工作組織與排程機制
  3. 03Jev-style scoring、LLM decoding 與 structured output
OPEN-SOURCE

大家竟然都忽略了這個全新的 JSON extraction 模型!

Datalab 推出了 Lift,這是一款具備 9B parameters 的 open-weights 模型,能透過單一步驟直接從文件與影像中擷取結構化 JSON。該模型淘汰了傳統結合 OCR、LLM inference 與 JSON repair code 的多階段 pipelines。Lift 根據使用者提供的 JSON schema 單次處理多頁文件,並對遺漏值回傳 null 以避免 hallucinations。Benchmarks 顯示其在超過 11,000 個 fields 中達到 90.2% 的 field accuracy,效能媲美 Gemini Flash 3.5 且速度提升三倍,並可透過 vLLM 或 Hugging Face 進行 self-hosted。

  • Lift 將 OCR、LLM inference 與 JSON repair 整合至單一 open-weights 模型中。
  • 這款 9B parameter model 在 11,000 個 benchmark 欄位中達到 90.2% 的 field accuracy。
  • Lift 的效能幾乎與 Gemini Flash 3.5 相當,同時運作速度達到其三倍。
  • 該模型能在 single pass 中處理跨越多頁的文件。
  • Lift 經過專門設計,可在缺少資料時回傳 null,以減緩 hallucination。
  • 該模型可使用 vLLM 或 Hugging Face 進行 self-host。
AI ENGINEERING

GPU 內部的工作組織與排程機制

GPU 透過將龐大的運算 workloads 細分為由 grids、thread blocks、warps 與 threads 組成的階層式 execution model 來執行。當一個 kernel 函式被呼叫時,它會實例化一個劃分為多個 block 的 grid,這些 block 會被獨立映射至 Streaming Multiprocessors (SMs)。在每個 SM 內部,threads 會以 32 個為一組打包為 warp,在不同的資料值上同時執行相同的指令。每當執行中的 warps 遇到 stall 時,SM 會透過在就緒的 resident warps 之間快速切換,以實現高 throughput 並隱藏 memory access latency。

  • 一次 GPU kernel launch 會實例化一個 execution grid,該 grid 會被分解為可獨立排程的 thread blocks。
  • Thread blocks 駐留在 Streaming Multiprocessors (SMs) 上,共享 execution state 與高速 shared memory。
  • 硬體將 32 個 threads 組成一個 warp,作為 SM 上排程的基本執行單位。
  • Warp 內的 branch divergence 會迫使執行路徑序列化(serialized),暫時停用非活躍的 threads 並導致效能下降。
  • GPU 是透過 warp scheduling 而非降低 latency 來隱藏 memory latency,以極低的成本將 stalled warps 置換為 ready warps。
  • Workloads 必須提供足夠的 blocks 與 resident warps,以充分填滿 SM 的運算資源並實現有效的 latency hiding。
JEV

Jev-style scoring、LLM decoding 與 structured output

許多 LLM 使用場景(如 routing 與 classification)涉及在已知的一組有效答案中進行選擇,而非生成開放式文本。標準的 LLM decoding 仰賴 autoregressive token 生成,產生的文本需要下游解析;而 structured output 則透過遮罩非法 token 來強制遵循如 JSON 等可預測的 schema,但仍需逐 token 進行解碼。相較之下,Jev-style scoring 完全繞過 sequence decoding,直接對預先定義的候選標籤進行評分並輸出其機率分佈。最佳做法取決於系統需要的是開放式文本、受 schema 約束的未知數值,還是對已知選項進行直接評分。

  • 標準 LLM decoding 逐 token 生成文本,需要透過後處理與解析來擷取離散的決策。
  • Structured output 在每個生成步驟中使用 schema 或 grammar 來遮罩無效的 token,但仍需要完整的逐 token 解碼過程。
  • 當目標值無法事先得知,但需要像 JSON 或 tool calls 這樣的結構化格式時,structured output 最為合適。
  • Jev-style scoring 直接評估預先定義的候選答案,無需解碼句子或 JSON 物件即可回傳機率。
  • Jev-style scoring 專為固定選項的 classification、routing、policy checks 與 ranking 進行了最佳化。