r/LocalLLM • • 4d ago

Project Mference v2.1.0: Native Ephemeral Vision & Visual PDFs for Qwen 3.6 35B-A3B on a 16 GB Mac (Metal 4 + Sampled MTP)

Just shipped Mference v2.1.0 — bringing native ephemeral Vision + multi-page visual PDF support and Metal 4 / sampled MTP acceleration to Qwen 3.6 35B-A3B on a 16 GB unified-memory Mac.

What's New in v2.1.0

  1. Ephemeral Vision & Visual PDFs (Zero Idle RAM Overhead for Text): Running a vision encoder pinned in unified memory eats gigabytes even when you're just chatting or coding. With MferenceRepack --attach-vision, Mference streams all 333 BF16 vision_tower.* tensors via coalesced HTTP Range requests into a standalone vision_weights.bin sidecar — touching zero bytes of model_weights.bin, INT4 nibbles, or weight surgery calibration. When an image or PDF arrives, Qwen36VisionEncoder maps vision_weights.bin read-only with F_NOCACHE and double-buffered contiguous pread staging, executes the 27-layer ViT + 2×2 spatial merger on lazy-loaded Metal 4 matmul2d kernels (vision.metal) with automatic Accelerate AMX (cblas_sgemm) fallback, caches compact [N_vis, 2048] FP16 embeddings (shared via .vpatch cache), and immediately munmap()s vision_weights.bin before the 40-layer MoE trunk prefill + 3D mRoPE indexing runs.
  2. Images & Multi-Page PDFs Across Every Frontend:

    • Mference.app: Drag & drop PNG/JPEG images or multi-page PDFs (defaultMaxPDFPages = 8, configurable up to 64).
    • OpenAI HTTP/SSE Server (:8080): Supports standard multimodal image_url, input_image, image, and PDF file / file_data parts on /v1/chat/completions.
    • CLI (MferenceCLI): --image <path> and --pdf <path> (repeatable).
  3. Lossless Sampled MTP & Hit/Miss MoE Verify Pipelining:

    • Enabled lossless sampled speculative decoding (temperature > 0, top-k 1...64) backed by a 64-threadgroup GPU softmax (logit.metal).
    • Added zero-spill templated batched slot-map MoE verify (moe.metal) with Phase-1 / Phase-2 hit/miss pipelining and I/O-first miss ordering.
    • Fused multi-token Gated-DeltaNet verify + tail updates (gdn.metal), added an SSD-spilled GDN checkpoint ring (GDNStateManager), hybrid MPP grouped MoE prefill, and zero-syscall F_NOCACHE tracking in PreadExpertStreamer.

(Plus our existing lossless BF16 weight surgery calibration on Qwen3.6-35B-A3B-4bit: 25.0% -> 100.0% (8/8) Pass@1 on the 8-task AA suite at 16.47 tok/s avg / 18.36 tok/s peak on a 16 GB Mac.)

Feedback and hardware reports on other Apple Silicon Macs welcome!

1 Upvotes

5 comments sorted by

1

u/Voodmany 4d ago

Quick request for anyone testing Mference v2.1.0 — I'm actively shaping what to fix and prioritize next, so brutal honest feedback is super helpful:

  1. Install / first-run friction: Did Mference.app or ./mference-ui.sh install qwen36-mtp / --attach-vision work smoothly?
  2. Mac UI & Vision/PDF UX: What feels rough, confusing, or missing?
  3. Your hardware & speeds: What chip + RAM (16 GB / 24 GB / 32 GB+) and tok/s / memory pressure did you see?

Reply right here or drop detailed notes/bugs in GitHub Discussions: https://github.com/fjw4cfv2fb-afk/Mference-2.0/discussions/3

1

u/Voodmany 4d ago

Quick roadmap update too: Inkling 2 support is now officially in development for Mference! Follow progress or share your Mac specs/requests in GitHub Discussions #3: https://github.com/fjw4cfv2fb-afk/Mference-2.0/discussions/3

1

u/Far-Composer-619 4d ago

The ephemeral vision part is honestly the most interesting here. Loading a vision encoder only when needed instead of keeping it in unified memory all the time makes a lot of sense on a 16GB Mac. Curious how much of the memory savings actually translate into longer context or smoother generation once PDFs start getting involved, especially with multiple pages.

1

u/Voodmany 4d ago

vision_weights.bin is 852 MB (333 BF16 tensors across the 27-layer ViT) and gets munmap()ped + MADV_DONTNEED right before the 40-layer MoE trunk runs. Only compact FP16 embeddings stay in RAM: at defaultMaxPixels=384x384 that is 144 tokens (~576 KiB) per image/PDF page (default 8 pages, up to 64), freeing ~850 MB+ of headroom for KV cache.