Skip to content

ggml-openvino: keep the Q5_0 layout instead of converting it to Q4_0_64 - #463

Open
osabnis wants to merge 1 commit into
ravi9:dev_backend_openvinofrom
osabnis:ov-q5_0-8bit-rule
Open

osabnis wants to merge 1 commit into
ravi9:dev_backend_openvinofrom
osabnis:ov-q5_0-8bit-rule

Conversation

@osabnis

@osabnis osabnis commented Nov 28, 2026

Copy link
Copy Markdown
Collaborator

Overview

Q5_0 weights are currently converted to Q4_0_64 (4-bit, group size 64) on all devices, while Q5_1 and Q8_0 retain their original 8-bit layouts.

Converting Q5_0 weights to 4-bit reduces accuracy, particularly for models that use Q5_0 extensively, such as Nemotron and gemma-3-270m.

This change preserves the original Q5_0 layout, avoiding the unnecessary loss of precision.

Changes

  • Add is_8bit_layout() for Q5_0, Q5_1 and Q8_0, so that all three follow the same rules.
  • Replace the two existing Q5_1/Q8_0 checks (the q4_asym64_all rule and the 3D MoE expert rule) with is_8bit_layout(). Both rules now also cover Q5_0.
  • Remove the Q5_0-to-Q4_0_64 conversion.
  • Bump the model cache version to 11.
  • Update docs/backend/OPENVINO.md to document Q5_0 among the types that retain their original layout.

Results

Model KLD before KLD after Top-1 before Top-1 after
gemma-3-270m-it 0.488 0.0039 70.2% 97.1%
Nemotron-3-Nano-30B-A3B 0.0773 0.0415 88.2% 91.4%
Nemotron-3.5-Lightning-30B-A3B 0.0515 0.0278 - -
  • gemma-3-270m-it produced correct answers in all 3 test cases after the change.
  • Nemotron-3-Nano-30B-A3B performance remained effectively unchanged:
    • Prompt processing: 259 → 259 t/s (pp3131).
    • Token generation: 50.9 → 49.8 t/s (tg128).
    • Peak VRAM: 17.5 → 17.9 GB.

Requirements

  • I have read and agree with the contributing guidelines.
  • AI usage disclosure: YES - AI assistance was used to review and refine the implementation and run the tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant