[PR #50] [CLOSED] tools: add mmproj quantization utility #2429

Closed
opened 2026-11-04 02:00:03 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/50
Author: @code-martin
Created: 9/28/2026
Status: ❌ Closed

Base: main ← Head: feature/quantize-mmproj-tool


📝 Commits (1)

  • f3a2949 tools: add mmproj quantization utility

📊 Changes

1 file changed (+103 additions, -0 deletions)

View changed files

➕ tools/quantize_mmproj.py (+103 -0)

📄 Description

Summary

Adds a standalone utility script ( ools/quantize_mmproj.py) to quantize multimodal projector (mmproj) GGUF files for Strata.

Motivation

By default, multimodal projectors distributed for vision models (such as Swift-Qwen) are shipped in unquantized 16-bit float formats (BF16 or F16), consuming ~907 MB of RAM/VRAM. On memory-constrained GPUs (8 GB – 12 GB), this footprint directly reduces the VRAM available for the MoE expert cache by over 300–600 slots.

Quantizing the projector to Q4_0 reduces its size from ~907 MB down to ~461 MB (~50% reduction) without noticeable loss in grounding and visual perception quality.

Key Changes

  • ** ools/quantize_mmproj.py**:
    • Automatically locates standard llama-quantize binaries in PATH or standard system installation directories.
    • Automatically derives output filename from source format tag (e.g. mmproj-...-BF16.gguf -> mmproj-...-Q4_0.gguf).
    • Supports --type Q4_0 (default), Q8_0, or any supported GGML quantization format.
    • Reports byte savings and reduction percentages.

Testing

  • Tested on mmproj-Swift-Qwen3.8-Flash-Next-BF16.gguf (907 MB) -> successfully generated mmproj-Swift-Qwen3.8-Flash-Next-Q4_0.gguf (461 MB).
  • Verified end-to-end with strata-vision.exe on live image queries.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/50 **Author:** [@code-martin](https://github.com/code-martin) **Created:** 9/28/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feature/quantize-mmproj-tool` --- ### 📝 Commits (1) - [`f3a2949`](https://github.com/Niko1221/Strata/commit/f3a294937bfb627374aeafd3569c7b3588da4ca4) tools: add mmproj quantization utility ### 📊 Changes **1 file changed** (+103 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `tools/quantize_mmproj.py` (+103 -0) </details> ### 📄 Description ### Summary Adds a standalone utility script ( ools/quantize_mmproj.py) to quantize multimodal projector (mmproj) GGUF files for Strata. ### Motivation By default, multimodal projectors distributed for vision models (such as Swift-Qwen) are shipped in unquantized 16-bit float formats (BF16 or F16), consuming ~907 MB of RAM/VRAM. On memory-constrained GPUs (8 GB – 12 GB), this footprint directly reduces the VRAM available for the MoE expert cache by over 300–600 slots. Quantizing the projector to Q4_0 reduces its size from ~907 MB down to ~461 MB (~50% reduction) without noticeable loss in grounding and visual perception quality. ### Key Changes - ** ools/quantize_mmproj.py**: - Automatically locates standard llama-quantize binaries in PATH or standard system installation directories. - Automatically derives output filename from source format tag (e.g. mmproj-...-BF16.gguf -> mmproj-...-Q4_0.gguf). - Supports --type Q4_0 (default), Q8_0, or any supported GGML quantization format. - Reports byte savings and reduction percentages. ### Testing - Tested on mmproj-Swift-Qwen3.8-Flash-Next-BF16.gguf (907 MB) -> successfully generated mmproj-Swift-Qwen3.8-Flash-Next-Q4_0.gguf (461 MB). - Verified end-to-end with strata-vision.exe on live image queries. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-04 02:00:03 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#2429
No description provided.