Skip to content

tools : split Metal FA-vec tuning into a standalone tuner - #26498

Open
forforever73 wants to merge 10 commits into
ggml-org:dev-metalfrom
forforever73:metal-tuning-tool
Open

tools : split Metal FA-vec tuning into a standalone tuner#26498
forforever73 wants to merge 10 commits into
ggml-org:dev-metalfrom
forforever73:metal-tuning-tool

Conversation

@forforever73

Copy link
Copy Markdown
Contributor

Overview

cont #25750, implementing two of its follow-ups.

The (Q, NE) sweep / compression / emit generator moves out of tests/test-backend-ops.cpp into a new binary ggml-metal-tuning (tools/tuning), which links only ggml and is gated on GGML_METAL, and gains a closed-loop cooldown for thermal drift. What stays in the test file is a 240-case Metal-gated numerical slice that every Apple-silicon CI run executes.

ggml-metal-tuning fa-vec [-b MTL0] [--dtype f16,q4_0] [--dk 128,192]
                         [--reps 7] [--seed 1234]
                         [--no-cooldown] [--cool-drift 0.10] [--cool-eps 0.03]
                         [--cool-max-wait 120] [--cool-max-retry 2]

stdout is the pasteable table, stderr is everything else (> rows.txt 2> sweep.log). The old generator put both on one stream, so the rows had to be dug out of six blocks in a 2396-line file, and the 2>/dev/null it documented discarded the Metal log; keeping that log instead tore 4 of 108 cell lines in half per run.

Where the old sweep printed a drift warning and kept the measurement, the cooldown discards every candidate timed since the last clean anchor, waits for the GPU to cool, re-measures them, and drops the cell from the table if it never converges, so a throttled timing can no longer reach the table.

Requirements

  • I have read and agree with the contributing guidelines.
  • AI usage disclosure: Yes, claude was used for the port, the cooldown implementation and the validation runs. The decisions (what stays in the test file, the dirty-window definition, dropping untrusted cells rather than pausing) were made by a human.

@forforever73
forforever73 requested review from a team and ggerganov as code owners August 3, 2026 06:27
@github-actions github-actions Bot added documentation Improvements or additions to documentation testing Everything test related examples ggml changes relating to the ggml tensor library for machine learning Apple Metal https://en.wikipedia.org/wiki/Metal_(API) labels Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Apple Metal https://en.wikipedia.org/wiki/Metal_(API) documentation Improvements or additions to documentation examples ggml changes relating to the ggml tensor library for machine learning testing Everything test related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant