Repository navigation
Conversation
Assisted-by: Gemini
Collaborator
please post complete results from llama-bench and llama-perplexity. The < 1% really depends on hw and quant type |
10 tasks
This branch has not been deployed
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.
Overview
Exclude
hc_*,ssm_beta,ssm_alpha, andple_conv1dfrom default quantization forLLM_ARCH_QWEN4EXPintensor_allows_quantization(). Without this rule,llama-quantizequantizes these small hyper-connection, linear-attention gate, and depthwise-conv tensors unless overridden manually with--tensor-type, whereas ggml-org/Qwen4-35B-A3B-GGUF keeps them in BF16 (reporting ~25-29% lower KL divergence for <1% size overhead).This matches the existing exclusions for neighboring hybrid architectures in
src/llama-quant.cpp:llama.cpp/src/llama-quant.cpp
Lines 387 to 418 in a4e5552
indexer.k_proj.weightandindexer.q_proj.weightare already excluded globally above, and 1D norm tensors are already skipped byggml_n_dims(tensor) < 2. Matchinghc_,ssm_beta,ssm_alpha, andple_conv1dcovers both merged and unmerged variants (hc_*_down_inject,output_hc_*,nextn.hc_head_*,ssm_beta_alpha, andple_conv1dwhosene[0] = 4previously fell back to F16).Verification
Built
llama-quantizeandtest-quantize-fnson macOS arm64 (Release), rantest-quantize-fns(all passing), and compared unpatchedmaster(a4e5552) vs patchedllama-quantizeacrossQ4_K_M,Q8_0, andQ2_Kon a synthetic BF16qwen4expGGUF containing all merged/unmerged control tensors:output_hc_{down,up},blk.0.hc_{attn,ffn}_*,blk.1.nextn.hc_head_{down,up}:Q4_K/Q8_0/Q2_K->BF16blk.0.ssm_{beta_alpha,beta,alpha}:Q4_K/Q8_0/Q2_K->BF16blk.0.ple_conv1d:F16->BF16token_embd,output,ssm_out,attn_qkv_gate,ple_{key,value},ffn_*_exps): unchangedRequirements
src/llama-quant.cpp/src/models/qwen4exp.cpp, implement the 8-line exclusion block, and run the synthetic before/after quantization check; all changes were reviewed by the author.Written with Gemini