Repository navigation
feat(gguf): serve image input on glm5-next ggufs from a glm5v mmproj - #810
Merged
jason-fxz merged 1 commit intoOct 23, 2026
Merged
Conversation
This was referenced Oct 23, 2026
KarrAcaRn
pushed a commit
to KarrAcaRn/FreeToken-ByAI
that referenced
this pull request
Oct 23, 2026
FlashML-org#805 FlashML-org#797 FlashML-org#795 adopted (FlashML-org#805 replaces our 8236bb3 kernel changes), FlashML-org#806 and FlashML-org#810 deferred. Assisted-by: Claude Opus 5.5
jason-fxz
approved these changes
Oct 23, 2026
jason-fxz
left a comment
Collaborator
There was a problem hiding this comment.
LGTM. Checked on real files:
- unsloth
mmproj-BF16.ggufis bit-exact against the HF safetensors, 347/347 tower tensors after the patch-embedding stack. F16 differs only in f16 subnormals, max rel 5e-8. - The derived
vision_config,image_token_idand processor budgets (16 / 8000 tokens) match the HF config. The image processor built from the derived config gives pixel values and grids identical to HFAutoImageProcessoron 11 images, from 20x20 to 8000x8000. - Served unsloth UD-IQ4_XS next to RedHatAI GLM-5.3-Flash-NVFP4 (HF checkpoint) on 10 probes: text, photos, OCR, shapes, two images, 48x48, 2400x240, a 5184x3456 photo at the 8000-token cap, and
/v1/messages. Prompt token counts are identical on every request, and the answers match. Same with ggml-org's Q8_0 mmproj via--mmproj. Auto-discovery picks BF16 over F16 and logs the skipped file.--mm-disable visionserves text and rejects images.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Serves the GLM-5.3-Flash vision tower from a llama.cpp
glm5vmmproj on the #803 shared base:gguf_mm_configanditer_mmproj_weightsinglm5_next/gguf.py, and the GGUF registry row gainsencoders/mm_processorand switches to the ConditionalGeneration class. Closes theglm5vitem of #794 (sub-issue of #671).The tower config comes from the mmproj metadata: geometry from the
clip.vision.*keys,swiglu_limitfromclip.vision.swiglu_clamp,image_token_idlooked up in the text GGUF's tokenizer (<|image|>), and the processor's token budgets from llama.cpp's single-frame pixel budgets divided by (patch * merge)^2, refusing a non-whole result.Glm5NextImageProcessorbuilds from the derived preprocessor config, so the multimodal path above is the HF checkpoint's own. The only tensor transform is stacking the Conv3d patch embedding's two temporal halves back; everything else is HF layout (the #794 survey measured the set bit-exact vs HF; here the reader matches the constructed tower 347/347 in names and shapes). A gelu tower (clip.use_silunot true) and a mmproj missing its second patch half refuse.gguf_check sweep
fetch_headers
--search GLM-5.3-Flash(2,145 shards, 107 repos), plus a header stub of every*mmproj*.ggufin those repos (72/73; one 403-gated), kernels.json probed on the GPU. 270/792 files of served architectures pass.Every failure is a #721 ignore class or a clean refusal; nothing new: per-layer streaming exports, ik_llama / custom ggml types, mixed gate/up expert banks, IQ1_M kernel gaps (18, first sweep here with a kernel table), missing
head_count_kv/swiglu_clamp_exprefusals, MTP drafts, broken uploads.Vision: 25 shard<->mmproj pairs exercised (11 auto-discovered in-folder, 14 forced with
FREETOKEN_MMPROJfor the subfolder layouts), allglm5v, BF16 / F16 / Q8_0 alike - tower config, weights, image processor and chat-template placeholder, 0 problems.Not covered
glm5nextprojector spelling (18 files, 17 repos)PROJECTOR_TYPE_UNKNOWN, checked on dd002b91f: the names table hasglm5vonly); refused under--mmproj, skipped with a warning by discoveryglm5-next-vision(2 files)--mmprojpicks the fileReal-file serving
unsloth
GLM-5.3-Flash-UD-IQ4_XS(5 shards) + the siblingmmproj-F16.gguf, auto-discovered:projector=glm5v type=F16 -> bf16, 348 tensors, 1.05 GiB.RTX 5090 32 GB (driver 580.95.05), Ryzen 9 7950X3D, 187 GB RAM, python 3.10.19, torch 2.14.1+cu130, triton 3.8.0, transformers 5.18.0.
Tests
No per-family GGUF test file, per the #721 review direction;
tests/models/test_models_registry.pycovers the row, and the glm5_next family tests pass (18).