Skip to content
This repository was archived by the owner on Nov 12, 2026. It is now read-only.

Measure opt-in Vulkan batching on M1 Pro - #648

Merged
techmore merged 39 commits into
devfrom
codex/tensorfold-vulkan
Oct 28, 2026
Merged

techmore merged 39 commits into
devfrom
codex/tensorfold-vulkan

Conversation

@techmore

@techmore techmore commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Rapid cache follow-up

For Qwen3.8 distill, three 20k-versus-80k Rapid pairs gave a 1.74% median request-time reduction, with one pair slower. At 20k, three 586-token cold/repeat prompt pairs were 1.889→0.948 s, 1.831→0.898 s, and 1.868→0.899 s: median 50.93% shorter repeat HTTP time with 571 cached tokens and matching text. This is a repeated-prompt cache gain, not a general decoding speedup or an engine ranking. Memory and thermal guards stayed active. The maderix and solatticus ANE projects were reviewed as macOS/iOS research references; neither supplies the missing Linux task-stream converter. Receipts and 29 passing guard tests are recorded.

H13 Qwen export and Rapid follow-up

The user's M4 Mac mini generated a 38-program Qwen manifest and successfully cross-compiled every program for h13, using the hash-verified upstream GGUF; hashes and logs are retained. Linux conversion stopped before any program due to upstream's undefined uniform_task_relayout (with another uninitialized payload in the same branch). The HWX set is retained on the mini and no ANE device test occurred.

For an MLX conversion of the same named Qwen distillation, the 20k work budget reduced median paired request time 11.79% across three direct MLX pairs and 17.95% across two Rapid loopback HTTP pairs, with matching output text. MLX and Rapid use different warmups and timing boundaries, so this is not an engine ranking; the GGUF uses different quantization and is not a matched checkpoint. Six-GiB reserve and 80 C guard retained. Raw data, source pins and methods are committed; 29 guard tests pass.

ANE tile-unit compatibility follow-up

An isolated patch updates stale converter tests and requires an explicit 512-byte or 16-KiB header unit in the direct production probe and staged decoder. A clean pinned-source checkout passes 84 host-only tests; the decoder rejects missing units before opening the device. The patch is not installed or hardware-qualified, and the separate libane runner and layout still require review. The split-decoder ANEForge source commit is public, but no compiled 38-program Qwen bundle was found locally or in GitHub releases/actions. No ANE test or MLX comparison has run. See the ANE preflight receipt for acquisition and validation requirements.

Qwen 4B guarded test

Memory rose without closing applications; the 4B smoke was admitted at 12.69 GiB available and answered 19. Three alternating 4B pairs at 20k versus 5k gave a median 12.86% reduction in request time, median reported decode rate 19.46 to 23.29 tokens/s, 823 to 249 submissions, and matching 32-token outputs. The candidate GTK animation probe recorded one 50.49 ms callback gap (baseline max 25.64 ms); longer interactive and fidelity tests remain open, and no default changed. The ANE decoder still requires its compiled model bundle and converter ABI resolution. Raw samples and receipt are committed; 29 guard tests pass.

Qwen ANE preflight

The public staged Qwen decoder requires a compatible 38-program compiled ANE bundle and manifest, which were not found locally; upstream's M1 run reported 8.38 GB peak RSS, and current available memory is insufficient alongside the 6 GiB reserve. No ANE model or MLX comparison ran. The host-only Qwen reference and contract suite passed 18 tests; five converter tests failed on 512-byte versus 16-KiB header unit expectations, requiring ABI investigation before device submission. See the committed ANE preflight receipt. No system driver, firmware or settings were changed.

Longer generation follow-up

  • On Qwen 2B, 256-token requests showed 21.06% median paired latency reduction at 80k (two completed pairs; admission stopped the third) and 20.69% at 120k (three pairs). 120k median reported decode throughput rose from 37.12 to 47.77 tokens/s, about 28.7%; throughput and latency percentages are different. All ten output sequences matched.
  • An animated GTK frame callback probe ran during individual 6–8 second requests: no callback gaps over 33.33 ms. This is not a sustained interactive, input-latency or display-presentation qualification. Wave scheduling at 80k yielded less than 1% improvement in the 32-token comparison.
  • 4B admission remained refused at 10.61 GiB against the 12.5 GiB requirement. Reserve and temperature guards were retained; defaults were not changed. 4B, sustained desktop and fidelity tests remain outstanding before a later matched Rapid-MLX comparison. ANE is a separate follow-up, not an available TensorFold batching backend.
  • Raw receipts, interrupted runs and graph are committed. The 29 guard tests pass.

Desktop and higher-budget follow-up

  • With an animated GTK frame-clock probe, 20k and 80k budgets reduced median paired Qwen 2B request time 14.29% and 17.55% respectively (three pairs each); 80k reduced submissions 429 to 69. All 30 measured outputs across the experiments have identical 32 token IDs. No 30% gain has been demonstrated.
  • No animation callback interval exceeded 33.33 ms during these short measured requests. This does not qualify actual frame presentation, input latency, sustained desktop responsiveness or broader numerical fidelity.
  • Qwen 4B was refused at 11.28 GiB available: the 6.5 GiB allowance plus 6 GiB desktop reserve requires 12.5 GiB. Retry when memory permits. Keep the optimization opt-in; the Rapid-MLX matched comparison follows MLX characterization.
  • Raw frame timestamps, model timings and the updated graph are committed. The guard unit suite passes 29 tests.

The M1 Pro uses a conservative fallback for Vulkan submission sizes. Three paired Qwen3.5 2B experiments found that an opt-in 20,000-work-group budget reduced median short-request wall time by 16.37% versus the 5,000 fallback, with matching generated token IDs. This adds a guarded, process-local switch for the model smoke test and retains the individual timings, trace counters, telemetry and graph.

The result is experimental: desktop frame pacing, broader model correctness and sustained workloads are untested, so the default is unchanged. The TensorFold Vulkan engine and its reported batching change remain private and are not represented as this implementation.

The branch also records metal2vk kernel tests, Qwen/LFM3 smoke tests and exploratory timing, and fixes memory-guard stop reporting and admission diagnostics while preserving the six-GiB reserve.

Validation: 18 guarded M1 Pro experiment runs with matching token IDs; 20,000-budget smoke; 29 local AI assistant tests; Python compile checks and git diff --check.

Created with Codex.

TensorFold PR 1517 port (merged in from #656)

Pinned build of ashhart/TensorFold PR 1517 (tensorfold-vulkan.sh): host tests and 39/39 GPU gates pass on the M1 Pro under wip4, but decode is 2.4–2.8 tok/s versus 47–49 for MLX at the 120k budget (engine-compare.py). Adds the TensorFold-style MLX gate (mlx-gate.py) and the generated engine scoreboard (scoreboard.py, ENGINE-SCOREBOARD.md). No kernel change was needed.

@techmore techmore changed the title Assess metal2vk and local model performance on M1 Pro Measure opt-in Vulkan batching on M1 Pro Oct 28, 2026
techmore added a commit that referenced this pull request Oct 28, 2026
* Add LFM3-Audio assistant service and F6 inline suggestions (#649 M1)

- mseries/assistant/assistd.py: one local LFM3-Audio-2B (MLX 8-bit) model on
  127.0.0.1:8772 for inline completion, chat, speech-to-text, text-to-speech
  and speech-to-speech; lazy load, idle unload, memory admission, prompt caches.
- mseries-assistd.service with the 20k Vulkan work budget from PR #648.
- mseries-reply suggest (F6): reads the focused field's text before the caret
  over AT-SPI and holds the continuation in the Smart Reply input method;
  Tab inserts, Esc drops. Terminals, password managers and sensitive fields
  are refused.
- mseries-ai: loopback-only assistd client.
- install.sh: overlay venv on the private MLX, pinned mlx-vlm with
  LFM3-Audio support, service, F6 binding.
- Dictation: the English installer now also installs the stream-dictate
  unit, so the login ordering-cycle fix from #614 reaches installed machines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Assistant spec: own Rust desktop driver modeled on cua-driver, qemu sandbox VMs (#649)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
techmore and others added 2 commits October 28, 2026 05:56
Adds a pinned, private-prefix build/test/gpu script for ashhart/TensorFold
PR 1517 (native Vulkan Qwen3.5-2B backend) on the private Honeykrisp ICD,
and records what the PR changes, its overlap with this branch, that no
kernel change is needed on wip4, and same-day sibling repo findings
(Honeykrisp HK_SYSMEM heap cap). Not built or run here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
techmore and others added 12 commits October 28, 2026 06:10
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Zig 0.17 prints passing tests' stderr under a 'failed command' header,
which reads like a failure. Add --summary all and an explicit PASS/FAIL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Run the built stage probes directly with --vendor 0x106b and a 60 s fence
timeout, continue past a failure, and print one verdict per stage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Honeykrisp reports vendorID 0x10005 (VK_VENDOR_ID_MESA), so the 0x106b
pin refused the M1 Pro before any GPU work.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rotates installed MLX at 5k (baseline) and 120k submit budgets, Rapid-MLX
at 120k, and the TensorFold PR 1517 Vulkan server over the same pinned
checkpoint, prompt and greedy token limit, under the shared lock, 6 GiB
reserve and 80 C guard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Three rotated rounds: MLX 5k 36.0 tok/s, MLX 120k 47.2, Rapid-MLX 120k
42.4 (server), TensorFold Vulkan 2.4 (server); all 12 outputs identical.
Long runs get a 600 s deadline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- mlx-gate.py: TensorFold-style gate for MLX (finite logits, teacher-forced
  argmax and RMSE vs a CPU float32 reference, token parity, pre-declared
  1.05/1.15 margins) plus a sweep of scheduling knobs and a negative control.
- engine-compare.py: --model qwen2b|qwen4b|lfm3, records the driver.
- scoreboard.py: rebuilds ENGINE-SCOREBOARD.md, engine-scoreboard.csv and
  an SVG chart from receipts, marks the most functional setup, and documents
  how we track upstream. scoreboard-notes.json holds ANE and other rows
  reported elsewhere, kept apart from our measurements.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TensorFold 2.8 tok/s and diverges after ~170 tokens; MLX 120k 49.3,
Rapid-MLX 43.2, MLX default 37.2, all three identical. Scoreboard now
compares each engine with the MLX default instead of all engines at once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pin TensorFold Vulkan engine PR 1517 for an opt-in M1 Pro build
@techmore
techmore merged commit fb8c738 into dev Oct 28, 2026
18 checks passed
@techmore
techmore deleted the codex/tensorfold-vulkan branch October 31, 2026 17:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant