Skip to content

cortiq 0.8.54

Choose a tag to compare

@infosave2007 infosave2007 released this 02 Nov 18:45
· 65 commits to master since this release
d979ebf

Added

  • Unlimited-OCR-2 (unlimited-ocr, uocr.rs): multi-page document parsing. The
    DeepEncoder (SAM ViT-B feeding CLIP-L), the MoE decoder and its DASH attention:
    a per-layer router scores 32-token blocks through a learned summary, restricts
    them to the query's page, takes entmax-1.5 over the best 16 and reads the best
    12 with a centered log-prior bias plus the last 128 tokens, at most 512 rows
    per query. Two-axis page2d rotary, the page-count guard, Pillow's fixed-point
    bicubic. On wgpu the router and attend ride the token graph and a 64-row batch
    graph chunk (gpu_wgpu/uocr.rs), SAM and CLIP stay resident (vit::sam_encode).
    An RTX PRO 4500 decodes at 320 tok/s against 20 in Transformers float32 and holds
    it over 24 pages; a tiled page's encoder takes 0.84 s. q8_2f matches float32
    on the first 300 greedy tokens of a page.
  • MiniCPM-OCR-1.0 (minicpm_ocr, minicpm_ocr.rs): the SigLIP tower with nearest
    position buckets, the 2×2 merger, the slicing image processor and its prompt
    layout, on the resident ViT kernels. 254–267 tok/s against 35 in Transformers
    float32; q8_2f matches float32 on 300 greedy tokens of a page.
  • cortiq run --image and /v1/chat/completions image parts for both models.
  • Native Metal for both models. gpu_metal/vit.rs keeps a vision tower resident
    (SigLIP, CLIP-L, SAM's windows, global blocks and neck) on the encoders' GEMMs;
    gpu_metal/uocr.rs is the DASH router and attend on the token graph and the
    chunk prefill. On a 10-core M4, Unlimited-OCR decodes at 95–112 tok/s against 71
    on its CPU, a tiled page's encoder takes 3.5 s against 20 s, its prompt 1.4 s
    against 12.6 s; MiniCPM-OCR decodes at 73–102 tok/s with 0.5 s a view against 1.2 s.

Changed

  • A MoE shared expert wider than its routed bank rides the batch graph, and in
    q8_2f the token graph too; on Metal the token graph and the chunk prefill too.
  • Metal's rows graph takes a q8_2f prompt chunk through the f32-tile GEMM instead
    of a matvec per position (MiniCPM-OCR q8_2f, 2511 rows: 19.4 s to 2.5 s).

Fixed

  • vision_gemm_nt on Metal refuses a k off the kernel's grid of 32. SigLIP's
    588-wide patch embedding read past each row, last row into unwritten memory.
  • The decision server installs its signal listeners before it binds the port: a
    SIGTERM right after the first response could kill it without the ledger flush.