Skip to content

VKNN 1.3.1

Latest

Choose a tag to compare

@katolikov katolikov released this 14 Jul 12:46
f1ba412

1.3.1 — full-GPU VLM

The vision-language model now runs fully on the GPU. vknn_compile fuses the token-embedding lookup into the decoder (which takes input_ids directly) and replaces the host image-feature splice with an on-GPU ScatterND, so a VLM turn — text or image — runs end-to-end on the GPU with no per-token host round-trip.

Engine (#38)

  • Embed→decoder merge (generic): when one graph's output feeds another's input of the same name+shape, the producer's subgraph is copied into the consumer at compile time. On a VLM the embedding Gather moves inside the decoder. Model-agnostic — LLM prefill/decode buckets, the 3DGS encoder, and CNNs compile byte-identically.
  • On-GPU image splice: an image-capable decoder copy where an on-GPU ScatterND overwrites the image-token rows with the vision features (new image_hidden_states / image_positions inputs). Text turns dispatch to a plain decoder and pay nothing.

Correctness & untrusted-input hardening (#37)

A whole-engine release audit (correctness / untrusted-input / edge-case classes, on top of the #33 memory-safety pass): 22 fixes, each confirmed by an adversarial verification pass — out-of-bounds reads on malformed .onnx/.vxm inputs, a JSON-parser hang, quantized-tensor OOB, declared-dtype output readback, and a Vulkan Gemm gate. Behaviour-preserving for valid inputs; guards fire only on malformed/corrupt/error paths.

Models

  • SmolVLM2-2.2B-vknn — renamed HF repo katolikov/SmolVLM2-2.2B-vknn; both fp16 (~4.5 GB) and int4 (~1.35 GB) files recompiled with the fused, full-GPU pipeline.

Verification (two phone-class GPUs)

  • Text/image decode logits byte-identical to the previous host-splice path; the end-to-end greedy token stream is byte-identical through the full KV-cached multi-turn decode.
  • No regression: CNN (ResNet-50, MobileNetV2, EfficientNet-B0, DenseNet-121, MNASNet, ShuffleNet V2) and YoNoSplat 8-view PSNR/SNR bit-exact to the prior baselines, 0 CPU fallback; every non-VLM .vxm recompiles byte-identically.
  • VLM per-token decode ~6 ms faster (no CPU embed hop); model reload is bit-exact; 335 host tests pass.

APK: vknn-demo-1.3.1.apk (arm64, debug-signed).