Repository navigation
Prepare Mac Metal receipt rounding support and hardware regression coverage - #216
michaelneale wants to merge 14 commits into
Conversation
A client of a node cannot tell which model the node ran. This adds the shared format of an inference receipt: the Merkle commitments of a turn, the signed turn root, the VRF challenge, and the checks a client runs on opened values against the weights of the claimed model. The node side keeps what a turn needs to be opened by a replay. Co-authored-by: Michael Neale <14976+michaelneale@users.noreply.github.com>
A stage reports every ubatch and every change of its KV cells to a recorder, and replays a recorded turn in a scratch context to open it. The KV pool is fitted to that: chunked placement leaves pinned cells alone, a recorded cache keeps the pages of its freed chunks, and the replay cache is zeroed when it is made. Skippy ABI 0.1.88. Co-authored-by: Michael Neale <14976+michaelneale@users.noreply.github.com>
A stage issues a signed receipt with each chat turn when it is asked to, keeps the turn for a challenge, and opens it. The audit-receipt command asks a node for a turn and audits it, and recheck-receipt checks saved evidence again. Receipts are off by default. Stage protocol generation 18 adds issue_receipts to the stage load, so the later stages of a split record their part. Co-authored-by: Michael Neale <14976+michaelneale@users.noreply.github.com>
The design, the glue checks and every measurement come from the mesh-llm repository, where the feature was written, without the parts that describe the audit policy of a Mesh node.
Rust 1.99.1 deprecates fetch_update in favor of try_update. Preserve the compare-and-update closure and memory ordering. Co-authored-by: Melkor <b36010fa5b9ec1747270cff036f6b47ff5dce56f179564e169fcb6cdc64c836b@buzz.gdk.so>
…backends Add Q8_0 hardware captures and candidate weight-aware rounding profiles for legacy and tensor-API Metal prefill. Keep Metal admission closed until output-head integration and live receipt qualification are complete. Co-authored-by: Melkor <b36010fa5b9ec1747270cff036f6b47ff5dce56f179564e169fcb6cdc64c836b@buzz.gdk.so>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Skippy Lab Qualification: PassedCommit: Native Spark lab qualification. Latest successful main: run 45835599636, attempt 1, commit
TPS comes from three separate warmed, uncached probes at concurrency 1, each generating exactly 128 tokens. The scored correctness answers and each probe's 64-token warmup are excluded. Each rate is total tokens / total server-reported phase time, not an average of request rates. Client elapsed times and raw responses are retained in throughput-probe.json. These bounded samples are not sustained benchmarks or controlled speedup comparisons. Legacy short-answer receipts and missing or invalid probe evidence show as Unavailable. Deltas use unrounded rates from matching PR-profile smoke receipts on the latest successful main run, including the nightly smoke evidence. Positive means faster. Changed workload inputs, different serving host classes, unequal phase token counts or missing evidence show Unavailable. Physical Spark placement and runtime conditions can differ; deltas are descriptive, not controlled speedup claims. Smoke checks cover GPU startup, deterministic endpoint repeats and bounded streaming. They do not establish an AgentX performance score. Nightly history and saved performance baselines are published separately; a saved baseline can be older than the latest successful main run used here. Native build and qualification output streams into each configuration’s Actions log, with per-attempt copies in Saved evidence. Any capture gaps are reported in the log and saved diagnostics. GitHub evidence copies expire after 30 days. |
|
🤖 Diagnosed the failed Spark qualification at 1a26839: qwen38-flash-next-standalone failed while linking skippy-correctness, before serving a model. Lab job job_pdzzs32t8gmty3w reports an undefined common_peg_arena::add_parser from bundled ling3.cpp.o. Its requested variant includes common_peg_token_parser/common_peg_token_not_parser, whereas this prepared source declares a different variant (including common_peg_ac_parser). This is incompatible native-object evidence, consistent with the cache-isolation defect addressed by #212; it is not a Metal receipt numerical failure. I have not established which cache layer first supplied the incompatible object. Six other Spark configurations passed. No cache deletion, blind rerun, or unrelated source fix applied; #216 should incorporate the cache fix when its dependency/base is updated. General CI is still running. These Spark results do not qualify Metal receipts. |
i386
left a comment
There was a problem hiding this comment.
Draft feedback (no verdict yet) — reviewed at 1a268398b723f51da299b74ed26ee123eb3823ad, follow-on-only diff on top of #180 (5b554478292a319549ce1a5822eee598d8fcfa84): 12 files, +356/−5.
What I verified on the follow-on:
- Admission stays closed, as intended.
BackendFamily::ofreturnsNoneforMTL0/MTL1/Metal, andprofiles_forfor CPU/CUDA never containsMetalTensororF16Weights— the candidate profiles exist only as enum variants and are not reachable from any production profile table.matrix_candidates_do_not_enable_unqualified_metal_receiptspins this directly. - Truncation semantics are precise.
MetalTensordiscards the low 13 fraction bits toward zero while preserving non-finite values (NaN payloads do not become infinities), and the edge-case test pins−0.0bit-identity, subnormals, and NaN/Inf behavior. Weight rounding is applied consistently in both the matrix reference and the near-tie repair (column_check), which matches the capture finding that rounding only activations models neither path. - The fixtures are honest evidence, not a rubber stamp. Committed captures match the candidate profiles under the production checker (error < 2e-6, zero repair flips),
Rawis distinguishable (> 1e-4), and 5%-scaled wrong outputs still fail the production tolerance. Fresh hardware captures override the fixtures viaSKIPPY_METAL_CAPTURE_DIRand fail hard when missing, so nothing passes silently. fetch_update→try_updateis the pinned-Rust API replacement with unchanged closure and orderings.- The capture tool is explicitly opt-in (
just receipts-metal-build, never in the offline/default suite), and the README documents provenance and the remaining gates before admission.
On the red CI at head: qwen38-flash-next-standalone (and summary) failed while linking skippy-correctness — the author's diagnosis of an incompatible cached native object from the pre-#212 cache identity is consistent with the failure shape and with the other six configurations passing; it is not a Metal-numerics failure. Since main now carries #212's cache isolation, rebasing this stack (after #180 lands and picks it up) should clear the lane; worth doing before this leaves draft.
Remaining gates before any Metal admission are correctly and exhaustively listed in the description and README. Nothing in this follow-on changes my assessment of #180 itself.
Original problem
Draft follow-on to #180: Mac/Metal receipt support is not enabled yet.
The receipts implementation refuses Metal because existing activation-rounding profiles do not explain prefill arithmetic reliably. Merely admitting
MTL0risks provable audit failures for honest nodes. This draft establishes reproducible Q8_0 kernel evidence and candidate profiles; it deliberately keeps backend admission closed while output-head integration and live qualification are unfinished.Based on #180 at
5b554478292a319549ce1a5822eee598d8fcfa84. Until that PR lands, the main comparison includes its changes. The follow-on-only comparison is here: two commits, 12 files, approximately 356 added lines plus 68 KiB of synthetic captured fixtures. This does not replace or supersede #180.Diagnostics
An Apple M5 Max / macOS 27.2.1 native probe of the exact prepared #180 patch queue found two distinct prefill paths:
For the checked-in Q8_0 capture (K=256, M=16, N=17), the production matrix checker reports:
Decode fits Raw. These are kernel correctness measurements, not end-to-end serving results, performance benchmarks, or general Apple-device qualification.
Fix
AtomicU64::fetch_updatewithtry_update, as required by its pinned Rust 1.99.1. The closure and memory ordering are unchanged.The remaining work and reproducible capture commands are in
evals/receipts-metal/README.md. In particular, precomputed head-key projections need to use rounded weight elements, not round an already-aggregated projection. Real serving, signed openings, cached prefixes, sampling, concurrency, splits, wrong-quantization controls and recording overhead remain gates before admission. Q4_K has a separate mismatch and is not included in the candidate scope.Compatibility
No dependency, ABI, wire-format, hash-domain, backend-admission or native runtime precision-policy changes. The Rust profile enum gains candidate variants, but no production profile table selects them. The capture tool is opt-in and is not a CI policy or lab-admission change. Receipts remain disabled on Metal.
Validation
Completed at
1a268398b723f51da299b74ed26ee123eb3823ad, Rust 1.99.1, Apple M5 Max:cargo fmt -p skippy-receipts --check— pass.just with-lld cargo check --locked -p skippy-receipts— pass.just with-lld cargo clippy --locked -p skippy-receipts --all-targets -- -D warnings— pass.just receipts-metal-build— pass; builds the capture tool and the pinned ggml Metal implementation, with warnings denied for the tool.env -u GGML_METAL_TENSOR_DISABLE target/receipts-metal/receipts-metal-captureandGGML_METAL_TENSOR_DISABLE=1 target/receipts-metal/receipts-metal-capture— actual device captures, both exit 0. Fresh captures reproduce the committed SHA-256s documented in the README.SKIPPY_METAL_CAPTURE_DIR=<fresh-capture-directory> just with-lld cargo test --locked -p skippy-receipts -- --nocapture— 435 unit tests and 7 integration tests pass; documentation tests complete (0 cases).just with-lld cargo test --locked -p skippy-receipts— the full package passes again using the offline fixtures.git diff --check— pass.Not run: full product/workspace builds, other backends/devices, real-model serving/audit qualification or receipt-overhead benchmarks. This draft changes only the receipts crate and opt-in calibration tooling; it is not ready for Metal enablement or merge as complete support. The native experiment must not be confused with validation of the signed-receipt workflow.
CI repair validation
The Flash Next qualification failed to link
common_peg_arena::add_parser; the retained job log shows Cargo reuse from a cache whose key omitted the native source recipe. Ported the two existing main fixes that bind Cargo and sccache outputs to the native patch tree and create the identity directory on cold builds.git diff --checkandSKIPPY_PYTHON=/tmp/skippy-ci-repair/automation-venv312/bin/python just ci-automationpassed on macOS ARM64, including the cache-isolation regression contracts. The initial automation run lacked pyarrow; the explicit Python 3.12 reporting environment passed. Fresh Spark qualification is pending in CI.Main CI fixes refreshed —
fe82aca50c30Merged target main
cc2a27435e798649a9cb938d600d39722e4a2263, including #254's separate queue/execution budgets and #256's formation-bound peer rendezvous, verified child listener readiness and control availability during preparation. Earlier split qualification failures included connection-refused/timeouts at the leader control port; those older results predate these shared fixes. Other merged CI fixes include Windows Vulkan path handling and the shared Windows GPU smoke workflow.SKIPPY_PYTHON=/tmp/skippy-ci-repair/automation-venv312/bin/python just ci-automationpassed on the merged tree, including deadline, peer identity, listener ownership, log streaming, reporting/publication and workflow contracts.git diff --checkandgit diff --cached --checkpassed. This is a normal base merge preserving the PR's feature changes; no additional Rust/native feature change was authored in this refresh. New exact-head source/package/device checks and native inference qualification are pending; earlier native results do not qualify this new head. The previous head remains available in history as052b72f84b7f6b99b777157945484c1b22593eba.Acceptance criteria