← Back to Pull requests

arm64: optimize q4_k_q8_k kernel with i8mm #13886

Closed
unknown closed this pull request without merging on May 29, 2025 11:39 UTC
View on GitHub
unknown unknown commented on May 29, 2025 10:35 UTC
Author

This PR improves q4_k_q8_k gemm kernel with arm64 i8mm instruction.

Tested on neoverse-n2 with llama3 8b q4_k_m quantization model.

  • 34% ~ 50% S_PP uplift for all batch sizes

  • 12% ~ 37% S_TG uplift for batch size 4 and above
  • Perplexity doesn't change with this PR.

    // tested on neoverse-n2
    $ llama-batched-bench \
          -m Meta-Llama-3-8B-Instruct-Q4_K_M.gguf \
          --no-mmap -fa \
          -c 8192 -b 4096 -ub 512 -npp 128 -ntg 128 \
          -npl 1,2,4,8,16,32 \
          -t 64
    
    ---------------------------------------------------------------------
    |    PP |     TG |    B |       S_PP t/s      |       S_TG t/s      |
    |       |        |      | original |  this pr | original |  this pr |
    |-------|--------|------|----------|----------|----------|----------|
    |   128 |    128 |    1 |   110.12 |   147.83 |    24.36 |    24.28 |
    |   128 |    128 |    2 |   121.16 |   172.42 |    46.36 |    47.93 |
    |   128 |    128 |    4 |   120.15 |   169.75 |    74.68 |    84.00 |
    |   128 |    128 |    8 |   130.97 |   196.81 |    91.04 |   114.74 |
    |   128 |    128 |   16 |   131.01 |   196.88 |   101.43 |   135.79 |
    |   128 |    128 |   32 |   130.85 |   196.51 |   106.97 |   147.29 |
    ---------------------------------------------------------------------
    

    Make sure to read the contributing guidelines before submitting a PR

    Diff: 178 lines (+133 / -45) across 2 files Reviewer: cyb70289 Review duration: 63m
    All Vouch review confidence checks passed
    Residual risk 0.14 = Change Risk (0.35) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.35 · 178 lines diff across 2 files
    0.35
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.310
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #13886"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 35.5% (MEDIUM) · Higher = larger blast radius
    35.5%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 14% · Safe to merge
    14%