Skip to content

v0.20.2

Latest

Choose a tag to compare

@ohdearquant ohdearquant released this 04 Dec 03:32
· 2 commits to main since this release
aca180d

lattice v0.20.2

Date: 2026-12-03
Previous: v0.20.1

Upgrading from 0.20.1

No public item is removed or changed in signature. On macOS the f16 CPU prompt prefill of lattice-model-qwen35
adds its products in a different order, so the text and image embeddings it produces differ from 0.20.1 in the
last bits, as described under Changed outputs.

Changelog

Changed outputs

  • Qwen3.5 f16 prompt prefill on macOS. The prompt's projections run as one matrix product per chunk of
    positions, so on macOS their sums are accumulated in a different order. With Qwen3.5-0.8B and a 448x448 image, the
    pooled embedding from VisionEmbeddingModel::embed_image differs from 0.20.1 by at most 1.2e-7 per value with
    mean pooling and 5.2e-7 with last-token pooling, in a unit-length vector of 1024 values. On other targets the
    chunked prefill matches the one-position-at-a-time prefill bit for bit.
    (#3118)

Performance

  • Batched f16 prompt prefill in lattice-model-qwen35. The f16 CPU prefill behind the text and image
    embeddings runs the prompt in chunks of up to 256 positions, and on macOS converts and multiplies each f16
    projection weight once per chunk instead of once per position. On an Apple M4 with Qwen3.5-0.8B (two runs per case), the decoder prefill and pooling of a 448x448
    image embedding fell from 9.4 s to 0.73 s (12.9x), and a 49-token text embedding from 2.3 s to 0.20 s (11.4x).
    The whole image embedding on the Metal path (embed_image_metal, where only the vision transformer runs on the
    GPU) fell from 11.4 s to 2.73 s (4.2x); on the host path (embed_image) it fell from 43.1 s to 34.5 s (1.25x),
    most of which is now the vision transformer on the CPU. Generation still prefills its prompt one position at a
    time, and its time is unchanged.
    (#3118)