Skip to content

[Mirror] New quantization type: Q3_HIFI#65

Open
ngxson wants to merge 295 commits intongxson:masterfrom
geoffmunn:master
Open

[Mirror] New quantization type: Q3_HIFI#65
ngxson wants to merge 295 commits intongxson:masterfrom
geoffmunn:master

Conversation

@ngxson
Copy link
Copy Markdown
Owner

@ngxson ngxson commented Dec 22, 2025

Mirror from upstream PR: ggml-org#18246

Summary by CodeRabbit

  • New Features

    • Adds a HIFI quantization family (Q3/Q5/Q6 HIFI variants) and new conversion/output option for HIFI formats.
  • Runtime / Backend

    • Broad HIFI runtime support across CPU, CUDA, Metal, Vulkan, SYCL and GPU shader/kernels; file-format mappings updated.
  • Documentation

    • Adds IMatrix guide, Q3_HIFI cross-model analysis, Q4_K_HIFI roadmap; removes CONTRIBUTING.md and AGENTS.md.
  • Testing & Tools

    • New benchmarks, perplexity tests, dataset download/creation utilities, quantization and benchmarking scripts.
  • Chores

    • Expanded .gitignore to exclude additional dataset and model artifacts.

geoffmunn and others added 30 commits March 1, 2026 21:57
Q5_K_HIFI speed improvements
… add whitespace for clarity in CPU quantization functions
…fy output weight matching and streamline default type returns for various quantization formats.
- Refactor `.editorconfig` to apply settings for public tools and remove deprecated entries.
- Add `.gitattributes` to treat the WebUI build as binary for diff purposes.
- Update `.gitignore` to exclude gzipped index.html files.
- Introduce `AGENTS.md` and `CONTRIBUTING.md` to clarify AI usage policies and contribution guidelines.
- Modify `CMakeLists.txt` to include an option for building the embedded Web UI.
- Update `README.md` with recent API changes and hot topics.
- Adjust Dockerfiles and other configuration files for compatibility and dependency updates.
- Add new model support in `convert_hf_to_gguf_update.py` and related scripts.

These changes enhance project maintainability and clarify contribution expectations.
- Introduce fallback defaults for layer normalization and rope frequency base if not specified in hparams.
- Remove unnecessary addition of BOS token in Gemma4Model.
- Ensure compatibility with updated model parameter requirements.

These changes improve the robustness of model parameter handling and align with the latest specifications.
The previous refactoring removed explicit parameter writes from
Gemma3Model.set_gguf_parameters() and Gemma4Model.set_vocab(),
assuming TextModel would handle them. This broke Gemma4 inference
because the GGUF file's key ordering matters: gguf_find_key() returns
the *first* occurrence of a key, so TextModel writing head_count_kv as
a scalar first caused all 60 layers to use n_head_kv=1 instead of the
correct per-layer array (1 for SWA, 4 for global). This produced
all-zero logits and PPL == n_vocab == 262144 for every imatrix chunk.

Restore Gemma3Model to explicitly write all parameters (matching
upstream exactly), and restore add_add_bos_token(True) in Gemma4Model.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants