Skip to content

knowledge: measure CPU vs MPS (fp32/fp16) p95 before choosing an Apple Silicon inference device - #335

Open
choiyounggi wants to merge 1 commit into
mainfrom
knowledge/autoflush-20261106-134854-81372
Open

choiyounggi wants to merge 1 commit into
mainfrom
knowledge/autoflush-20261106-134854-81372

Conversation

@choiyounggi

Copy link
Copy Markdown
Owner

Knowledge flush — 1 insight(s)

Headless autoflush run, 2026-11-06 (claims by run 20261106-134854-81372). Claimed 3 candidates: 1 ingested as a new page, 2 released back to pending as pending duplicates of open PRs.

Candidate Domain Disposition
2c78c188c0a60329 — Apple Silicon: measure CPU fp32 / MPS fp32 / MPS fp16 p95 for batch-1 embedding inference; re-check accuracy after fp16 platforms hint → backend/ml ingested — new page backend-common-ml-inference-device-choice-on-apple-silicon (verified)
b5863e2d758c98fb — Claude Code behind a gateway still sends bootstrap/penguin_mode requests while a claude.ai login remains platforms released — pending duplicate of open #328 / #298
fc76dc4dfa08ecde — Docker-gated schema validator: skip vs fail, known-bad document testing released — pending duplicate of open #300 / #317

Verified best-practice

2c78c188c0a60329 — confidence: verified. Official docs and PyTorch issue measurements back the method. The speed numbers are one machine's field measurement, and the page labels them that way.

  • Claim: on Apple Silicon, for one-sentence-per-call transformer inference, do not choose the device from the "MPS loses at small batch" rule. Measure CPU fp32, MPS fp32 and MPS fp16 p95 on the target machine, and re-check the task metric after switching to fp16.
  • Sources checked (WebSearch; this run has no WebFetch, so pages were confirmed through search summaries, not fetched):
  • Changed from the candidate:
    • Added "pin device and dtype explicitly", because the library auto-selects MPS and Transformers v5 loads the checkpoint dtype.
    • Added warm-up exclusion and version recording.
    • Turned "re-check accuracy" into "re-run the task metric on the eval set".
    • Added a decision table, a small-model edge row, a memory row and a half-precision-on-CPU row.
    • The "600M급" size claim became an edge row stated as a field measurement, not a general size cutoff.
  • Not verified externally: the exact model size at which MPS starts to beat CPU at batch 1. The page gives no cutoff and tells the reader to measure.

b5863e2d758c98fb, fc76dc4dfa08ecde: released before verification (see Open-PR check).

Existing-layer check

Pages read: backend-common-llm-self-hosted-model-load-latency, debugging-performance-profile-before-optimizing, backend-common-ml-mape-aligned-point-prediction

Open-PR check

23 open knowledge/* PRs: #334, #332, #331, #330, #329, #328, #324, #319, #318, #317, #315, #310, #309, #308, #307, #306, #305, #304, #301, #300, #299, #298, #293. This headless run cannot fetch or diff branch content. Overlap was judged from each PR's title and changed-file list (gh pr list --repo choiyounggi/dev-loop --state open --search "head:knowledge/" --json number,title,files), plus #334's report body.

Candidate Overlapping open PR Verdict
2c78c188c0a60329 inference device choice on Apple Silicon None on trigger. #334 adds backend/common/ml/grouped-cross-validation-for-templated-examples.md, which is about model-evaluation splits, a different trigger. It also adds one row to the same ml index table; its position could not be diffed from here. This PR inserts its row at the top of that table. If the two rows land next to each other, the merge conflict is two independent rows, and keeping both resolves it. No open PR touches debugging/performance/ or backend/common/llm/self-hosted-model-load-latency.md. The platforms PRs (#328, #324, #319, #309, #299, #298) cover agent CLIs, shells, tmux and tools, not ML inference new
b5863e2d758c98fb gateway + leftover claude.ai login #328 edits platforms/processes/spawning-an-agent-cli-from-a-server.md with ANTHROPIC_BASE_URL/ANTHROPIC_AUTH_TOKEN gateway rows. #298 adds backend/common/llm/gateway-model-alias-resolution.md. Same trigger family, and both PRs are still open pending duplicate → claim released
fc76dc4dfa08ecde Docker-gated schema validator: skip vs fail #300 and #317 edit testing/quality/checks-that-cannot-pass.md (and #300 also tests-that-cannot-fail.md). Same theme (a validator that skips or always passes), and both PRs are still open. This run could not locate the row's queue file. Its summary is taken from #334's report, which read it pending duplicate → claim released

Routing decision

  • 2c78c188c0a60329 → backend / common/ml → new page wiki/backend/common/ml/inference-device-choice-on-apple-silicon.md.
    • The candidate's domain hint was platforms. That domain covers OS-level differences that break code across macOS/Linux/Windows, and this lesson is about which device a model runs on, which backend/common/ml owns.
    • The directive is general: any PyTorch transformer served one request at a time on Apple Silicon. Project names and numbers appear only in the field-evidence Sources line.
    • No new category.

Local-layer candidates

none

Queue bookkeeping

@choiyounggi choiyounggi added the dev-loop:knowledge Auto-opened wiki knowledge ingest PR (owner reviews & merges) label Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Wiki agent gate: error — the agent run produced no verdict (failed closed). See the workflow log.

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

Labels

dev-loop:knowledge Auto-opened wiki knowledge ingest PR (owner reviews & merges)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant