llama.cpp b11851:LFM2 图像缩放对齐 torchvision
原标题:b11851
AI 摘要
llama.cpp 发布 b11851 版本,主要更新 mtmd 多模态模块:为 LFM2 和 d1-omni 视觉模型新增与 torchvision 一致的 bilinear 和 bicubic 图像缩放算法,通过将 Pillow 移植版的权重舍入到 int16 精度再缩放回 22 位,使输出与 torchvision 相同。此前 Pillow 移植版在约 1% 的 d1-omni 与 LFM2.5-VL 裁剪值上偏差 1-2 个级别,bicubic 下约 0.25% 的 d1-3B 裁剪值存在偏差。该改动提升了多模态推理中图像预处理的数值一致性,其他模型仍保留 Pillow 算法。
正文节选
<details open> mtmd : lfm2 resize matches torchvision (#30943) * mtmd : lfm2 bilinear resize matches torchvision Lfm2VlImageProcessor and d1-omni vision.py resize uint8 images with torchvision (antialias=True). That is Pillow's algorithm, except that the weights are int16 with as many fractional bits as the largest weight allows, where Pillow uses 22 bits. The Pillow port was 1-2 levels off on about 1% of the values of the d1-omni and LFM2.5-VL crops. RESIZE_ALGO_BILINEAR_TORCH rounds the we